mpeg4videoparse: Use sinkpad caps as base for srcpad caps

This way, we don't lose additional fields that come from upstream (like
profile/level for now).

https://bugzilla.gnome.org/show_bug.cgi?id=635202
This commit is contained in:
Arun Raghavan 2010-11-18 23:29:51 +05:30 committed by Edward Hervey
parent 522f470883
commit 8f30fca636
2 changed files with 16 additions and 3 deletions

View file

@ -65,9 +65,15 @@ gst_mpeg4vparse_set_new_caps (GstMpeg4VParse * parse,
gint aspect_ratio_width, gint aspect_ratio_height, gint width, gint height)
{
gboolean res;
GstCaps *out_caps = gst_caps_new_simple ("video/mpeg",
"mpegversion", G_TYPE_INT, 4,
"systemstream", G_TYPE_BOOLEAN, FALSE,
GstCaps *out_caps;
if (parse->sink_caps) {
out_caps = gst_caps_copy (parse->sink_caps);
} else {
out_caps = gst_caps_new_simple ("video/mpeg",
"mpegversion", G_TYPE_INT, 4, NULL);
}
gst_caps_set_simple (out_caps, "systemstream", G_TYPE_BOOLEAN, FALSE,
"parsed", G_TYPE_BOOLEAN, TRUE, NULL);
if (parse->profile != 0) {
@ -710,6 +716,7 @@ gst_mpeg4vparse_sink_setcaps (GstPad * pad, GstCaps * caps)
const GValue *value;
GST_DEBUG_OBJECT (parse, "setcaps called with %" GST_PTR_FORMAT, caps);
parse->sink_caps = gst_caps_ref (caps);
s = gst_caps_get_structure (caps, 0);
@ -860,6 +867,10 @@ gst_mpeg4vparse_src_query (GstPad * pad, GstQuery * query)
static void
gst_mpeg4vparse_cleanup (GstMpeg4VParse * parse)
{
if (parse->sink_caps) {
gst_caps_unref (parse->sink_caps);
parse->sink_caps = NULL;
}
if (parse->adapter) {
gst_adapter_clear (parse->adapter);
}

View file

@ -54,6 +54,8 @@ struct _GstMpeg4VParse {
GstPad * sinkpad;
GstPad * srcpad;
GstCaps *sink_caps;
guint interval;
GstClockTime last_report;