diff --git a/gst/videoparsers/gstdiracparse.c b/gst/videoparsers/gstdiracparse.c index 373d0d509d..e474aba489 100644 --- a/gst/videoparsers/gstdiracparse.c +++ b/gst/videoparsers/gstdiracparse.c @@ -407,7 +407,14 @@ 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_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), filter); + if (filter) { + GstCaps *fcopy = gst_caps_copy (filter); + /* Remove the fields we convert */ + remove_fields (fcopy); + peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), fcopy); + gst_caps_unref (fcopy); + } else + peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), NULL); if (peercaps) { /* Remove the parsed field */ diff --git a/gst/videoparsers/gsth263parse.c b/gst/videoparsers/gsth263parse.c index 46ab4fee94..63cfb95fc4 100644 --- a/gst/videoparsers/gsth263parse.c +++ b/gst/videoparsers/gsth263parse.c @@ -381,7 +381,14 @@ 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_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), filter); + if (filter) { + GstCaps *fcopy = gst_caps_copy (filter); + /* Remove the fields we convert */ + remove_fields (fcopy); + peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), fcopy); + gst_caps_unref (fcopy); + } else + peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), NULL); if (peercaps) { /* Remove parsed field */ diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c index 6e8b5dc23e..16cb923e60 100644 --- a/gst/videoparsers/gsth264parse.c +++ b/gst/videoparsers/gsth264parse.c @@ -1916,7 +1916,15 @@ 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_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), filter); + if (filter) { + GstCaps *fcopy = gst_caps_copy (filter); + /* Remove the fields we convert */ + remove_fields (fcopy); + peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), fcopy); + gst_caps_unref (fcopy); + } else + peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), NULL); + if (peercaps) { peercaps = gst_caps_make_writable (peercaps); remove_fields (peercaps); diff --git a/gst/videoparsers/gsth265parse.c b/gst/videoparsers/gsth265parse.c index bf03b5b064..2737b924d5 100644 --- a/gst/videoparsers/gsth265parse.c +++ b/gst/videoparsers/gsth265parse.c @@ -1854,7 +1854,15 @@ gst_h265_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_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), filter); + if (filter) { + GstCaps *fcopy = gst_caps_copy (filter); + /* Remove the fields we convert */ + remove_fields (fcopy); + peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), fcopy); + gst_caps_unref (fcopy); + } else + peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), NULL); + if (peercaps) { peercaps = gst_caps_make_writable (peercaps); remove_fields (peercaps); diff --git a/gst/videoparsers/gstmpeg4videoparse.c b/gst/videoparsers/gstmpeg4videoparse.c index 6cc75d0514..6b32720550 100644 --- a/gst/videoparsers/gstmpeg4videoparse.c +++ b/gst/videoparsers/gstmpeg4videoparse.c @@ -851,7 +851,14 @@ 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_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), filter); + if (filter) { + GstCaps *fcopy = gst_caps_copy (filter); + /* Remove the fields we convert */ + remove_fields (fcopy); + peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), fcopy); + gst_caps_unref (fcopy); + } else + peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), NULL); if (peercaps) { /* Remove the parsed field */ diff --git a/gst/videoparsers/gstmpegvideoparse.c b/gst/videoparsers/gstmpegvideoparse.c index a68b809b84..ef1f728062 100644 --- a/gst/videoparsers/gstmpegvideoparse.c +++ b/gst/videoparsers/gstmpegvideoparse.c @@ -1043,7 +1043,15 @@ 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_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), filter); + if (filter) { + GstCaps *fcopy = gst_caps_copy (filter); + /* Remove the fields we convert */ + remove_fields (fcopy); + peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), fcopy); + gst_caps_unref (fcopy); + } else + peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), NULL); + if (peercaps) { /* Remove the parsed field */ peercaps = gst_caps_make_writable (peercaps); diff --git a/gst/videoparsers/gstvc1parse.c b/gst/videoparsers/gstvc1parse.c index 5643d3da6a..c96858b93c 100644 --- a/gst/videoparsers/gstvc1parse.c +++ b/gst/videoparsers/gstvc1parse.c @@ -385,7 +385,15 @@ gst_vc1_parse_get_sink_caps (GstBaseParse * parse, GstCaps * filter) GstCaps *ret; templ = gst_pad_get_pad_template_caps (GST_BASE_PARSE_SINK_PAD (parse)); - peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), NULL); + if (filter) { + GstCaps *fcopy = gst_caps_copy (filter); + /* Remove the fields we convert */ + remove_fields (fcopy); + peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), fcopy); + gst_caps_unref (fcopy); + } else + peercaps = gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (parse), NULL); + if (peercaps) { /* Remove the stream-format and header-format fields * and add the generic ones again by intersecting