videoparsers: Use the peer caps for restrictions instead of the srcpad allowed caps
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Mon, 17 Dec 2012 14:04:44 +0000 (15:04 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Mon, 17 Dec 2012 14:04:44 +0000 (15:04 +0100)
Otherwise we will intersect with the srcpad template caps and add all the caps fields
that the parser will ever set, no matter if downstream restricts this field or not.
This requires upstream to set this field on the caps to successfully negotiate.

https://bugzilla.gnome.org/show_bug.cgi?id=690184

gst/videoparsers/gstdiracparse.c
gst/videoparsers/gsth263parse.c
gst/videoparsers/gsth264parse.c
gst/videoparsers/gstmpeg4videoparse.c
gst/videoparsers/gstmpegvideoparse.c

index 84232c7..eac906d 100644 (file)
@@ -394,7 +394,7 @@ gst_dirac_parse_get_sink_caps (GstBaseParse * parse, GstCaps * filter)
   GstCaps *res;
 
   templ = gst_pad_get_pad_template_caps (GST_BASE_PARSE_SINK_PAD (parse));
-  peercaps = gst_pad_get_allowed_caps (GST_BASE_PARSE_SRC_PAD (parse));
+  peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), filter);
 
   if (peercaps) {
     guint i, n;
index a2aea54..4b0c29d 100644 (file)
@@ -356,7 +356,7 @@ gst_h263_parse_get_sink_caps (GstBaseParse * parse, GstCaps * filter)
   GstCaps *res;
 
   templ = gst_pad_get_pad_template_caps (GST_BASE_PARSE_SINK_PAD (parse));
-  peercaps = gst_pad_get_allowed_caps (GST_BASE_PARSE_SRC_PAD (parse));
+  peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), filter);
 
   if (peercaps) {
     guint i, n;
index fdf7d97..dd68446 100644 (file)
@@ -1876,7 +1876,7 @@ gst_h264_parse_get_caps (GstBaseParse * parse, GstCaps * filter)
   GstCaps *res;
 
   templ = gst_pad_get_pad_template_caps (GST_BASE_PARSE_SINK_PAD (parse));
-  peercaps = gst_pad_get_allowed_caps (GST_BASE_PARSE_SRC_PAD (parse));
+  peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), filter);
   if (peercaps) {
     guint i, n;
 
index ca38a37..9c370c0 100644 (file)
@@ -39,7 +39,7 @@ GST_DEBUG_CATEGORY (mpeg4v_parse_debug);
 #define GST_CAT_DEFAULT mpeg4v_parse_debug
 
 static GstStaticPadTemplate src_template =
-GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC,
+    GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC,
     GST_PAD_ALWAYS,
     GST_STATIC_CAPS ("video/mpeg, "
         "mpegversion = (int) 4, "
@@ -51,7 +51,7 @@ GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC,
     );
 
 static GstStaticPadTemplate sink_template =
-GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK,
+    GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK,
     GST_PAD_ALWAYS,
     GST_STATIC_CAPS ("video/mpeg, "
         "mpegversion = (int) 4, " "systemstream = (boolean) false; "
@@ -858,7 +858,7 @@ gst_mpeg4vparse_get_caps (GstBaseParse * parse, GstCaps * filter)
   GstCaps *res;
 
   templ = gst_pad_get_pad_template_caps (GST_BASE_PARSE_SINK_PAD (parse));
-  peercaps = gst_pad_get_allowed_caps (GST_BASE_PARSE_SRC_PAD (parse));
+  peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), filter);
 
   if (peercaps) {
     guint i, n;
index f8303a6..b3c188f 100644 (file)
@@ -859,7 +859,7 @@ gst_mpegv_parse_get_caps (GstBaseParse * parse, GstCaps * filter)
   GstCaps *res;
 
   templ = gst_pad_get_pad_template_caps (GST_BASE_PARSE_SINK_PAD (parse));
-  peercaps = gst_pad_get_allowed_caps (GST_BASE_PARSE_SRC_PAD (parse));
+  peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), filter);
   if (peercaps) {
     guint i, n;