From 26040ee38cb9e7c42f3d9a0282b3e5cace7ca42d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 17 Dec 2012 15:01:02 +0100 Subject: [PATCH] audioparsers: Use the peer caps for restrictions instead of the srcpad allowed caps 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 | 2 +- gst/audioparsers/gstac3parse.c | 2 +- gst/audioparsers/gstamrparse.c | 2 +- gst/audioparsers/gstdcaparse.c | 2 +- gst/audioparsers/gstflacparse.c | 2 +- gst/audioparsers/gstmpegaudioparse.c | 2 +- gst/audioparsers/gstwavpackparse.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gst/audioparsers/gstaacparse.c b/gst/audioparsers/gstaacparse.c index 6fbcf00de0..322e94a631 100644 --- a/gst/audioparsers/gstaacparse.c +++ b/gst/audioparsers/gstaacparse.c @@ -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; diff --git a/gst/audioparsers/gstac3parse.c b/gst/audioparsers/gstac3parse.c index e645cb7d23..b9bc96e4d9 100644 --- a/gst/audioparsers/gstac3parse.c +++ b/gst/audioparsers/gstac3parse.c @@ -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; diff --git a/gst/audioparsers/gstamrparse.c b/gst/audioparsers/gstamrparse.c index b46a355b17..39b68e00a2 100644 --- a/gst/audioparsers/gstamrparse.c +++ b/gst/audioparsers/gstamrparse.c @@ -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; diff --git a/gst/audioparsers/gstdcaparse.c b/gst/audioparsers/gstdcaparse.c index 51988215b9..1ae0c03d7d 100644 --- a/gst/audioparsers/gstdcaparse.c +++ b/gst/audioparsers/gstdcaparse.c @@ -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; diff --git a/gst/audioparsers/gstflacparse.c b/gst/audioparsers/gstflacparse.c index c80444ba69..154b749abd 100644 --- a/gst/audioparsers/gstflacparse.c +++ b/gst/audioparsers/gstflacparse.c @@ -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; diff --git a/gst/audioparsers/gstmpegaudioparse.c b/gst/audioparsers/gstmpegaudioparse.c index 5457e1a28e..bbdf1993df 100644 --- a/gst/audioparsers/gstmpegaudioparse.c +++ b/gst/audioparsers/gstmpegaudioparse.c @@ -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; diff --git a/gst/audioparsers/gstwavpackparse.c b/gst/audioparsers/gstwavpackparse.c index c70b878cdd..f0c0340f5d 100644 --- a/gst/audioparsers/gstwavpackparse.c +++ b/gst/audioparsers/gstwavpackparse.c @@ -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;