summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d6abd21)
raw | patch | inline | side by side (parent: d6abd21)
author | Luciana Fujii Pontello <luciana.fujii@collabora.co.uk> | |
Thu, 22 Mar 2012 01:42:30 +0000 (21:42 -0400) | ||
committer | Luciana Fujii Pontello <luciana.fujii@collabora.co.uk> | |
Thu, 29 Mar 2012 01:41:46 +0000 (21:41 -0400) |
The caps of the src pad should not change with upstream negotiation
except between regular yuv and rowstrided.
except between regular yuv and rowstrided.
src/gstducatividdec.c | patch | blob | history |
diff --git a/src/gstducatividdec.c b/src/gstducatividdec.c
index 43210248856d9d3d3c55e83e8df669c1549ad272..36f04a00691fa74e8873b39de2b0a978758bd559 100644 (file)
--- a/src/gstducatividdec.c
+++ b/src/gstducatividdec.c
return ret;
}
return ret;
}
+static GstCaps *
+gst_ducati_viddec_src_getcaps (GstPad * pad)
+{
+ GstCaps *caps = NULL;
+ GstCaps *outcaps = NULL;
+ int i;
+
+ caps = GST_PAD_CAPS (pad);
+ if (caps == NULL) {
+ outcaps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
+ return outcaps;
+ }
+
+ outcaps = gst_caps_new_empty ();
+
+ /* allow -rowstrided and regular yuv */
+ for (i = 0; i < gst_caps_get_size (caps); i++) {
+ GstStructure *structure;
+ GstStructure *modified_structure;
+
+ structure = gst_caps_get_structure (caps, i);
+ gst_caps_append_structure (outcaps, gst_structure_copy (structure));
+ modified_structure = gst_structure_copy (structure);
+
+ if (gst_structure_has_name (structure, "video/x-raw-yuv")) {
+ gst_structure_set_name (modified_structure, "video/x-raw-yuv-strided");
+ gst_caps_append_structure (outcaps, modified_structure);
+ } else {
+ gst_structure_set_name (modified_structure, "video/x-raw-yuv");
+ gst_structure_remove_field (modified_structure, "rowstride");
+ gst_caps_append_structure (outcaps, modified_structure);
+ }
+ }
+ return outcaps;
+}
+
static gboolean
gst_ducati_viddec_query (GstDucatiVidDec * self, GstPad * pad,
GstQuery * query, gboolean * forward)
static gboolean
gst_ducati_viddec_query (GstDucatiVidDec * self, GstPad * pad,
GstQuery * query, gboolean * forward)
GST_DEBUG_FUNCPTR (gst_ducati_viddec_src_event));
gst_pad_set_query_function (self->srcpad,
GST_DEBUG_FUNCPTR (gst_ducati_viddec_src_query));
GST_DEBUG_FUNCPTR (gst_ducati_viddec_src_event));
gst_pad_set_query_function (self->srcpad,
GST_DEBUG_FUNCPTR (gst_ducati_viddec_src_query));
+ gst_pad_set_getcaps_function (self->srcpad,
+ GST_DEBUG_FUNCPTR (gst_ducati_viddec_src_getcaps));
gst_element_add_pad (GST_ELEMENT (self), self->sinkpad);
gst_element_add_pad (GST_ELEMENT (self), self->srcpad);
gst_element_add_pad (GST_ELEMENT (self), self->sinkpad);
gst_element_add_pad (GST_ELEMENT (self), self->srcpad);