2004-04-22 Benjamin Otte <otte@gnome.org>
+ * docs/gst/tmpl/gstcaps.sgml:
+ * docs/gst/tmpl/gstfilesrc.sgml:
+ * docs/gst/tmpl/gststructure.sgml:
+ * docs/gst/tmpl/gstvalue.sgml:
+ update for recent API changes
+ * gst/gstcaps.c: (gst_caps_do_simplify):
+ fix to stop trying with a freed structure
+ * gst/gstpad.c: (gst_pad_link_fixate):
+ simplify caps
+ * gst/gstpad.c: (gst_pad_template_get_caps_by_name):
+ remove C++ comment
+ * gst/gstpad.h:
+ deprecate gst_pad_template_get_caps_by_name, it doesn't work anyway
+ * gst/gststructure.c: (gst_structure_value_get_generic_type),
+ (gst_structure_to_string):
+ keep the correct type when using lists of ranges
+ * gst/gstvalue.c: (gst_value_list_prepend_value),
+ (gst_value_list_append_value):
+ copy the value before adding to the list (d'oh)
+ * gst/gstvalue.c: (gst_value_subtract_int_range_int),
+ (gst_value_subtract_int_range_int_range):
+ handle overflows correctly
+ * gst/gstvalue.c: (gst_value_subtract_from_list):
+ fix memleak
+ * testsuite/caps/caps.h:
+ add a caps that caused segfaults
+
+2004-04-22 Benjamin Otte <otte@gnome.org>
+
* testsuite/refcounting/pad.c: (main):
fix test
@Returns:
+<!-- ##### FUNCTION gst_caps_is_equal ##### -->
+<para>
+
+</para>
+
+@caps1:
+@caps2:
+@Returns:
+
+
<!-- ##### FUNCTION gst_caps_is_equal_fixed ##### -->
<para>
@Returns:
+<!-- ##### FUNCTION gst_caps_is_subset ##### -->
+<para>
+
+</para>
+
+@subset:
+@superset:
+@Returns:
+
+
<!-- ##### FUNCTION gst_caps_intersect ##### -->
<para>
@Returns:
+<!-- ##### FUNCTION gst_caps_do_simplify ##### -->
+<para>
+
+</para>
+
+@caps:
+
+
<!-- ##### FUNCTION gst_caps_save_thyself ##### -->
<para>
@Returns:
+<!-- ##### FUNCTION gst_caps_subtract ##### -->
+<para>
+
+</para>
+
+@minuend:
+@subtrahend:
+@Returns:
+
+
@block_size:
@touch:
@using_mmap:
+@is_regular:
@mapbuf:
@mapsize:
@need_discont:
@name:
-<!-- ##### FUNCTION gst_structure_id_set_value ##### -->
+<!-- ##### FUNCTION gst_structure_get_name_id ##### -->
+<para>
+
+</para>
+
+@structure:
+@Returns:
+
+
+<!-- ##### FUNCTION gst_structure_id_get_value ##### -->
<para>
</para>
@structure:
@field:
-@value:
+@Returns:
-<!-- ##### FUNCTION gst_structure_set_value ##### -->
+<!-- ##### FUNCTION gst_structure_id_set_value ##### -->
<para>
</para>
@structure:
-@fieldname:
-@value:
-<!-- # Unused Parameters # -->
@field:
+@value:
-<!-- ##### FUNCTION gst_structure_set ##### -->
+<!-- ##### FUNCTION gst_structure_get_value ##### -->
<para>
</para>
@structure:
@fieldname:
-@Varargs:
+@Returns:
<!-- # Unused Parameters # -->
@field:
-<!-- ##### FUNCTION gst_structure_set_valist ##### -->
+<!-- ##### FUNCTION gst_structure_set_value ##### -->
<para>
</para>
@structure:
@fieldname:
-@varargs:
+@value:
<!-- # Unused Parameters # -->
@field:
-<!-- ##### FUNCTION gst_structure_id_get_value ##### -->
+<!-- ##### FUNCTION gst_structure_set ##### -->
<para>
</para>
@structure:
+@fieldname:
+@Varargs:
+<!-- # Unused Parameters # -->
@field:
-@Returns:
-<!-- ##### FUNCTION gst_structure_get_value ##### -->
+<!-- ##### FUNCTION gst_structure_set_valist ##### -->
<para>
</para>
@structure:
@fieldname:
-@Returns:
+@varargs:
<!-- # Unused Parameters # -->
@field:
@Returns:
+<!-- ##### USER_FUNCTION GstValueSubtractFunc ##### -->
+<para>
+
+</para>
+
+@dest:
+@minuend:
+@subtrahend:
+@Returns:
+
+
<!-- ##### STRUCT GstValueTable ##### -->
<para>
@func:
+<!-- ##### FUNCTION gst_value_subtract ##### -->
+<para>
+
+</para>
+
+@dest:
+@minuend:
+@subtrahend:
+@Returns:
+
+
+<!-- ##### FUNCTION gst_value_can_subtract ##### -->
+<para>
+
+</para>
+
+@minuend:
+@subtrahend:
+@Returns:
+
+
+<!-- ##### FUNCTION gst_value_register_subtract_func ##### -->
+<para>
+
+</para>
+
+@minuend_type:
+@subtrahend_type:
+@func:
+
+
<!-- ##### FUNCTION gst_value_intersect ##### -->
<para>
#include "config.h"
#endif
#include <string.h>
+#include <signal.h>
#include <gst/gst.h>
break;
}
result = gst_caps_structure_simplify (simplify, compare);
- /*g_print ("%s - %s = %s\n",
- gst_structure_to_string (simplify),
- gst_structure_to_string (compare),
- result ? gst_structure_to_string (result) : "---");
- */
+#if 0
+ g_print ("%s - %s = %s\n",
+ gst_structure_to_string (simplify),
+ gst_structure_to_string (compare),
+ result ? gst_structure_to_string (result) : "---");
+#endif
if (result) {
gst_structure_free (simplify);
g_ptr_array_index (caps->structs, i) = result;
} else {
gst_caps_remove_structure (caps, i);
start--;
+ break;
}
}
}
return NULL;
/* FIXME */
- //return gst_caps_copy (gst_caps_get_by_name (caps, name));
return NULL;
}
GstPadTemplate * gst_static_pad_template_get (GstStaticPadTemplate *pad_template);
const GstCaps* gst_pad_template_get_caps (GstPadTemplate *templ);
+#ifndef GST_DISABLE_DEPRECATED
const GstCaps* gst_pad_template_get_caps_by_name (GstPadTemplate *templ, const gchar *name);
+#endif
#ifndef GST_DISABLE_LOADSAVE
xmlNodePtr gst_ghost_pad_save_thyself (GstPad *pad,
return g_type_name (type);
}
+static GType
+gst_structure_value_get_generic_type (GValue * val)
+{
+ if (G_VALUE_TYPE (val) == GST_TYPE_LIST) {
+ GArray *array = g_value_peek_pointer (val);
+
+ if (array->len > 0) {
+ GValue *value = &g_array_index (array, GValue, 0);
+
+ return gst_structure_value_get_generic_type (value);
+ } else {
+ return G_TYPE_INT;
+ }
+ } else if (G_VALUE_TYPE (val) == GST_TYPE_INT_RANGE) {
+ return G_TYPE_INT;
+ } else if (G_VALUE_TYPE (val) == GST_TYPE_DOUBLE_RANGE) {
+ return G_TYPE_DOUBLE;
+ }
+ return G_VALUE_TYPE (val);
+}
+
#define GST_ASCII_IS_STRING(c) (g_ascii_isalnum((c)) || ((c) == '_') || \
((c) == '-') || ((c) == '+') || ((c) == '/') || ((c) == ':') || \
((c) == '.'))
field = GST_STRUCTURE_FIELD (structure, i);
t = gst_value_serialize (&field->value);
- type = G_VALUE_TYPE (&field->value);
-
- if (type == GST_TYPE_LIST) {
- GArray *array = g_value_peek_pointer (&field->value);
+ type = gst_structure_value_get_generic_type (&field->value);
- if (array->len > 0) {
- GValue *value = &g_array_index (array, GValue, 0);
-
- type = G_VALUE_TYPE (value);
- } else {
- type = G_TYPE_INT;
- }
- } else if (G_VALUE_TYPE (&field->value) == GST_TYPE_INT_RANGE) {
- type = G_TYPE_INT;
- } else if (G_VALUE_TYPE (&field->value) == GST_TYPE_DOUBLE_RANGE) {
- type = G_TYPE_DOUBLE;
- }
g_string_append_printf (s, ", %s=(%s)%s", g_quark_to_string (field->name),
gst_structure_to_abbr (type), t);
g_free (t);
void
gst_value_list_prepend_value (GValue * value, const GValue * prepend_value)
{
+ GValue val = { 0, };
+
g_return_if_fail (GST_VALUE_HOLDS_LIST (value));
- g_array_prepend_vals ((GArray *) value->data[0].v_pointer, prepend_value, 1);
+ gst_value_init_and_copy (&val, prepend_value);
+ g_array_prepend_vals ((GArray *) value->data[0].v_pointer, &val, 1);
}
/**
void
gst_value_list_append_value (GValue * value, const GValue * append_value)
{
+ GValue val = { 0, };
+
g_return_if_fail (GST_VALUE_HOLDS_LIST (value));
- g_array_append_vals ((GArray *) value->data[0].v_pointer, append_value, 1);
+ gst_value_init_and_copy (&val, append_value);
+ g_array_append_vals ((GArray *) value->data[0].v_pointer, &val, 1);
}
/**
int min2 = gst_value_get_int_range_min (subtrahend);
int max2 = gst_value_get_int_range_max (subtrahend);
- if (max2 == G_MAXINT) {
- max2--;
- max1--;
- }
- if (min2 == G_MININT) {
- min2++;
- min1++;
+ if (max2 == G_MAXINT && min2 == G_MININT) {
+ return FALSE;
+ } else if (max2 == G_MAXINT) {
+ return gst_value_create_new_range (dest, min1, MIN (min2 - 1, max1), 1, 0);
+ } else if (min2 == G_MININT) {
+ return gst_value_create_new_range (dest, MAX (max2 + 1, min1), max1, 1, 0);
+ } else {
+ return gst_value_create_new_range (dest, min1, MIN (min2 - 1, max1),
+ MAX (max2 + 1, min1), max1);
}
- return gst_value_create_new_range (dest, min1, MIN (min2 - 1, max1),
- MAX (max2 + 1, min1), max1);
}
static gboolean
gst_value_init_and_copy (&temp, dest);
g_value_unset (dest);
gst_value_list_concat (dest, &temp, &subtraction);
+ g_value_unset (&temp);
}
g_value_unset (&subtraction);
}
include this file */
static const gchar *caps_list[] = {
+ "audio/x-adpcm, layout=(string)quicktime; audio/x-adpcm, layout=(string)quicktime; audio/x-adpcm, layout=(string)wav; audio/x-adpcm, layout=(string)wav; audio/x-adpcm, layout=(string)dk3; audio/x-adpcm, layout=(string)dk3; audio/x-adpcm, layout=(string)dk4; audio/x-adpcm, layout=(string)dk4; audio/x-adpcm, layout=(string)westwood; audio/x-adpcm, layout=(string)westwood; audio/x-adpcm, layout=(string)smjpeg; audio/x-adpcm, layout=(string)smjpeg; audio/x-adpcm, layout=(string)microsoft; audio/x-adpcm, layout=(string)microsoft; audio/x-adpcm, layout=(string)4xm; audio/x-adpcm, layout=(string)4xm; audio/x-adpcm, layout=(string)xa; audio/x-adpcm, layout=(string)xa; audio/x-adpcm, layout=(string)adx; audio/x-adpcm, layout=(string)adx; audio/x-adpcm, layout=(string)ea; audio/x-adpcm, layout=(string)ea; audio/x-adpcm, layout=(string)g726; audio/x-adpcm, layout=(string)g726",
"video/x-raw-yuv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(double)[ 0, 1.7976931348623157e+308 ], format=(fourcc)I420; video/x-raw-yuv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(double)[ 0, 1.7976931348623157e+308 ], format=(fourcc)YUY2; video/x-raw-rgb, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(double)[ 0, 1.7976931348623157e+308 ], bpp=(int)24, depth=(int)24, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, endianness=(int)4321; video/x-raw-rgb, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(double)[ 0, 1.7976931348623157e+308 ], bpp=(int)24, depth=(int)24, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, endianness=(int)4321; video/x-raw-yuv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(double)[ 0, 1.7976931348623157e+308 ], format=(fourcc)Y42B; video/x-raw-rgb, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(double)[ 0, 1.7976931348623157e+308 ], bpp=(int)32, depth=(int)24, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, endianness=(int)4321; video/x-raw-yuv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(double)[ 0, 1.7976931348623157e+308 ], format=(fourcc)YUV9; video/x-raw-yuv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(double)[ 0, 1.7976931348623157e+308 ], format=(fourcc)Y41B; video/x-raw-rgb, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(double)[ 0, 1.7976931348623157e+308 ], bpp=(int)16, depth=(int)16, red_mask=(int)63488, green_mask=(int)2016, blue_mask=(int)31, endianness=(int)1234; video/x-raw-rgb, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(double)[ 0, 1.7976931348623157e+308 ], bpp=(int)16, depth=(int)15, red_mask=(int)31744, green_mask=(int)992, blue_mask=(int)31, endianness=(int)1234",
"video/x-raw-yuv, format=(fourcc){ YUY2, I420 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-jpeg, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-divx, divxversion=(int)[ 3, 5 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-xvid, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-3ivx, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-msmpeg, msmpegversion=(int)[ 41, 43 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/mpeg, mpegversion=(int)1, systemstream=(boolean)false, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h263, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-dv, systemstream=(boolean)false, width=(int)720, height=(int){ 576, 480 }; video/x-huffyuv, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]",
"video/x-raw-yuv, format=(fourcc){ YUY2, I420 }, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ]; image/jpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ]; video/x-divx, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], divxversion=(int)[ 3, 5 ]; video/x-xvid, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ]; video/x-3ivx, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ]; video/x-msmpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], msmpegversion=(int)[ 41, 43 ]; video/mpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], mpegversion=(int)1, systemstream=(boolean)false; video/x-h263, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ]; video/x-dv, width=(int)720, height=(int){ 576, 480 }, systemstream=(boolean)false; video/x-huffyuv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ]",
include this file */
static const gchar *caps_list[] = {
+ "audio/x-adpcm, layout=(string)quicktime; audio/x-adpcm, layout=(string)quicktime; audio/x-adpcm, layout=(string)wav; audio/x-adpcm, layout=(string)wav; audio/x-adpcm, layout=(string)dk3; audio/x-adpcm, layout=(string)dk3; audio/x-adpcm, layout=(string)dk4; audio/x-adpcm, layout=(string)dk4; audio/x-adpcm, layout=(string)westwood; audio/x-adpcm, layout=(string)westwood; audio/x-adpcm, layout=(string)smjpeg; audio/x-adpcm, layout=(string)smjpeg; audio/x-adpcm, layout=(string)microsoft; audio/x-adpcm, layout=(string)microsoft; audio/x-adpcm, layout=(string)4xm; audio/x-adpcm, layout=(string)4xm; audio/x-adpcm, layout=(string)xa; audio/x-adpcm, layout=(string)xa; audio/x-adpcm, layout=(string)adx; audio/x-adpcm, layout=(string)adx; audio/x-adpcm, layout=(string)ea; audio/x-adpcm, layout=(string)ea; audio/x-adpcm, layout=(string)g726; audio/x-adpcm, layout=(string)g726",
"video/x-raw-yuv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(double)[ 0, 1.7976931348623157e+308 ], format=(fourcc)I420; video/x-raw-yuv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(double)[ 0, 1.7976931348623157e+308 ], format=(fourcc)YUY2; video/x-raw-rgb, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(double)[ 0, 1.7976931348623157e+308 ], bpp=(int)24, depth=(int)24, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, endianness=(int)4321; video/x-raw-rgb, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(double)[ 0, 1.7976931348623157e+308 ], bpp=(int)24, depth=(int)24, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, endianness=(int)4321; video/x-raw-yuv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(double)[ 0, 1.7976931348623157e+308 ], format=(fourcc)Y42B; video/x-raw-rgb, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(double)[ 0, 1.7976931348623157e+308 ], bpp=(int)32, depth=(int)24, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, endianness=(int)4321; video/x-raw-yuv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(double)[ 0, 1.7976931348623157e+308 ], format=(fourcc)YUV9; video/x-raw-yuv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(double)[ 0, 1.7976931348623157e+308 ], format=(fourcc)Y41B; video/x-raw-rgb, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(double)[ 0, 1.7976931348623157e+308 ], bpp=(int)16, depth=(int)16, red_mask=(int)63488, green_mask=(int)2016, blue_mask=(int)31, endianness=(int)1234; video/x-raw-rgb, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(double)[ 0, 1.7976931348623157e+308 ], bpp=(int)16, depth=(int)15, red_mask=(int)31744, green_mask=(int)992, blue_mask=(int)31, endianness=(int)1234",
"video/x-raw-yuv, format=(fourcc){ YUY2, I420 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-jpeg, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-divx, divxversion=(int)[ 3, 5 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-xvid, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-3ivx, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-msmpeg, msmpegversion=(int)[ 41, 43 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/mpeg, mpegversion=(int)1, systemstream=(boolean)false, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h263, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-dv, systemstream=(boolean)false, width=(int)720, height=(int){ 576, 480 }; video/x-huffyuv, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]",
"video/x-raw-yuv, format=(fourcc){ YUY2, I420 }, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ]; image/jpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ]; video/x-divx, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], divxversion=(int)[ 3, 5 ]; video/x-xvid, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ]; video/x-3ivx, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ]; video/x-msmpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], msmpegversion=(int)[ 41, 43 ]; video/mpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], mpegversion=(int)1, systemstream=(boolean)false; video/x-h263, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ]; video/x-dv, width=(int)720, height=(int){ 576, 480 }, systemstream=(boolean)false; video/x-huffyuv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ]",