audioparsers: 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:01:02 +0000 (15:01 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Mon, 17 Dec 2012 14:01:02 +0000 (15:01 +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/audioparsers/gstaacparse.c
gst/audioparsers/gstac3parse.c
gst/audioparsers/gstamrparse.c
gst/audioparsers/gstdcaparse.c
gst/audioparsers/gstflacparse.c
gst/audioparsers/gstmpegaudioparse.c
gst/audioparsers/gstwavpackparse.c

index 6fbcf00..322e94a 100644 (file)
@@ -1100,7 +1100,7 @@ gst_aac_parse_sink_getcaps (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 e645cb7..b9bc96e 100644 (file)
@@ -697,7 +697,7 @@ gst_ac3_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 b46a355..39b68e0 100644 (file)
@@ -370,7 +370,7 @@ gst_amr_parse_sink_getcaps (GstBaseParse * parse, GstCaps * filter)
 
 
   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 5198821..1ae0c03 100644 (file)
@@ -447,7 +447,7 @@ gst_dca_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 c80444b..154b749 100644 (file)
@@ -1741,7 +1741,7 @@ gst_flac_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 5457e1a..bbdf199 100644 (file)
@@ -1405,7 +1405,7 @@ gst_mpeg_audio_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 c70b878..f0c0340 100644 (file)
@@ -615,7 +615,7 @@ gst_wavpack_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;