From: <sl...@ke...> - 2008-05-14 10:59:03
|
CVS Root: /cvs/gstreamer Module: gst-plugins-base Changes by: slomo Date: Wed May 14 2008 10:59:06 UTC Log message: * gst/adder/gstadder.c: (gst_adder_setcaps), (gst_adder_class_init): Correctly declare the supported endianness on the pad templates and check for correct endianness in the set caps function. Adder only supports native endianness. Also use gst_element_class_set_details_simple(). Modified files: . : ChangeLog gst/adder : gstadder.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ChangeLog.diff?r1=1.3927&r2=1.3928 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/gst/adder/gstadder.c.diff?r1=1.93&r2=1.94 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-base/ChangeLog,v retrieving revision 1.3927 retrieving revision 1.3928 diff -u -d -r1.3927 -r1.3928 --- ChangeLog 14 May 2008 09:12:08 -0000 1.3927 +++ ChangeLog 14 May 2008 10:58:50 -0000 1.3928 @@ -1,3 +1,12 @@ +2008-05-14 Sebastian Dröge <sl...@ci...> + + * gst/adder/gstadder.c: (gst_adder_setcaps), + (gst_adder_class_init): + Correctly declare the supported endianness on the pad templates + and check for correct endianness in the set caps function. Adder + only supports native endianness. + Also use gst_element_class_set_details_simple(). 2008-05-14 Stefan Kost <en...@us...> * sys/xvimage/xvimagesink.c: Index: gstadder.c RCS file: /cvs/gstreamer/gst-plugins-base/gst/adder/gstadder.c,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- gstadder.c 18 Feb 2008 13:51:34 -0000 1.93 +++ gstadder.c 14 May 2008 10:58:52 -0000 1.94 @@ -71,25 +71,33 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); /* elementfactory information */ -static const GstElementDetails adder_details = GST_ELEMENT_DETAILS ("Adder", - "Generic/Audio", - "Add N audio channels together", - "Thomas <th...@ap...>"); +#define CAPS \ + "audio/x-raw-int, " \ + "rate = (int) [ 1, MAX ], " \ + "channels = (int) [ 1, MAX ], " \ + "endianness = (int) BYTE_ORDER, " \ + "width = (int) { 8, 16, 24, 32 }, " \ + "depth = (int) [ 1, 32 ], " \ + "signed = (boolean) { true, false } ;" \ + "audio/x-raw-float, " \ + "width = (int) { 32, 64 }" static GstStaticPadTemplate gst_adder_src_template = - GST_STATIC_PAD_TEMPLATE ("src", +GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, - GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS "; " - GST_AUDIO_FLOAT_PAD_TEMPLATE_CAPS) + GST_STATIC_CAPS (CAPS) ); static GstStaticPadTemplate gst_adder_sink_template = - GST_STATIC_PAD_TEMPLATE ("sink%d", +GST_STATIC_PAD_TEMPLATE ("sink%d", GST_PAD_SINK, GST_PAD_REQUEST, static void gst_adder_class_init (GstAdderClass * klass); @@ -257,6 +265,10 @@ GST_DEBUG_OBJECT (adder, "parse_caps sets adder to format float"); adder->format = GST_ADDER_FORMAT_FLOAT; gst_structure_get_int (structure, "width", &adder->width); + gst_structure_get_int (structure, "endianness", &adder->endianness); + if (adder->endianness != G_BYTE_ORDER) + goto not_supported; switch (adder->width) { case 32: @@ -567,7 +579,9 @@ gst_static_pad_template_get (&gst_adder_src_template)); gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&gst_adder_sink_template)); - gst_element_class_set_details (gstelement_class, &adder_details); + gst_element_class_set_details_simple (gstelement_class, "Adder", + "Generic/Audio", + "Add N audio channels together", "Thomas <th...@ap...>"); parent_class = g_type_class_peek_parent (klass); |