summaryrefslogtreecommitdiff
path: root/gst/videoparsers/gsth263parse.c
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2012-06-05 09:30:00 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2012-06-05 09:30:00 +0200
commit7c6093357b5904c2e5dc7f3c9140748c85575349 (patch)
tree44e03a8142da42b255032734926fab0388baebe5 /gst/videoparsers/gsth263parse.c
parent9f7e70f754aa6cd62045f61e98b1fe0ff59e08a4 (diff)
downloadgstreamer-plugins-bad-7c6093357b5904c2e5dc7f3c9140748c85575349.tar.gz
videoparsers: Fix GstBaseParse::get_sink_caps() implementations
They should take the filter caps into account and always return the template caps appended to the actual caps. Otherwise the parsers stop to accept unparsed streams where upstream does not know about width, height, etc. Fixes bug #677401.
Diffstat (limited to 'gst/videoparsers/gsth263parse.c')
-rw-r--r--gst/videoparsers/gsth263parse.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/gst/videoparsers/gsth263parse.c b/gst/videoparsers/gsth263parse.c
index 4d75da87e..1d1324a30 100644
--- a/gst/videoparsers/gsth263parse.c
+++ b/gst/videoparsers/gsth263parse.c
@@ -352,10 +352,12 @@ more:
static GstCaps *
gst_h263_parse_get_sink_caps (GstBaseParse * parse, GstCaps * filter)
{
- GstCaps *peercaps;
+ GstCaps *peercaps, *templ;
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));
+
if (peercaps) {
guint i, n;
@@ -367,15 +369,25 @@ gst_h263_parse_get_sink_caps (GstBaseParse * parse, GstCaps * filter)
gst_structure_remove_field (s, "parsed");
}
- res =
- gst_caps_intersect_full (peercaps,
- gst_pad_get_pad_template_caps (GST_BASE_PARSE_SINK_PAD (parse)),
- GST_CAPS_INTERSECT_FIRST);
+ res = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST);
gst_caps_unref (peercaps);
+
+ /* Append the template caps because we still want to accept
+ * caps without any fields in the case upstream does not
+ * know anything.
+ */
+ gst_caps_append (res, templ);
} else {
- res =
- gst_caps_copy (gst_pad_get_pad_template_caps (GST_BASE_PARSE_SINK_PAD
- (parse)));
+ res = templ;
+ }
+
+ if (filter) {
+ GstCaps *intersection;
+
+ intersection =
+ gst_caps_intersect_full (filter, res, GST_CAPS_INTERSECT_FIRST);
+ gst_caps_unref (res);
+ res = intersection;
}
return res;