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:
parent
522f470883
commit
8f30fca636
@ -65,9 +65,15 @@ gst_mpeg4vparse_set_new_caps (GstMpeg4VParse * parse,
|
|||||||
gint aspect_ratio_width, gint aspect_ratio_height, gint width, gint height)
|
gint aspect_ratio_width, gint aspect_ratio_height, gint width, gint height)
|
||||||
{
|
{
|
||||||
gboolean res;
|
gboolean res;
|
||||||
GstCaps *out_caps = gst_caps_new_simple ("video/mpeg",
|
GstCaps *out_caps;
|
||||||
"mpegversion", G_TYPE_INT, 4,
|
|
||||||
"systemstream", G_TYPE_BOOLEAN, FALSE,
|
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);
|
"parsed", G_TYPE_BOOLEAN, TRUE, NULL);
|
||||||
|
|
||||||
if (parse->profile != 0) {
|
if (parse->profile != 0) {
|
||||||
@ -710,6 +716,7 @@ gst_mpeg4vparse_sink_setcaps (GstPad * pad, GstCaps * caps)
|
|||||||
const GValue *value;
|
const GValue *value;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (parse, "setcaps called with %" GST_PTR_FORMAT, caps);
|
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);
|
s = gst_caps_get_structure (caps, 0);
|
||||||
|
|
||||||
@ -860,6 +867,10 @@ gst_mpeg4vparse_src_query (GstPad * pad, GstQuery * query)
|
|||||||
static void
|
static void
|
||||||
gst_mpeg4vparse_cleanup (GstMpeg4VParse * parse)
|
gst_mpeg4vparse_cleanup (GstMpeg4VParse * parse)
|
||||||
{
|
{
|
||||||
|
if (parse->sink_caps) {
|
||||||
|
gst_caps_unref (parse->sink_caps);
|
||||||
|
parse->sink_caps = NULL;
|
||||||
|
}
|
||||||
if (parse->adapter) {
|
if (parse->adapter) {
|
||||||
gst_adapter_clear (parse->adapter);
|
gst_adapter_clear (parse->adapter);
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,8 @@ struct _GstMpeg4VParse {
|
|||||||
GstPad * sinkpad;
|
GstPad * sinkpad;
|
||||||
GstPad * srcpad;
|
GstPad * srcpad;
|
||||||
|
|
||||||
|
GstCaps *sink_caps;
|
||||||
|
|
||||||
guint interval;
|
guint interval;
|
||||||
GstClockTime last_report;
|
GstClockTime last_report;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user