diff options
author | Thibault Saunier <tsaunier@gnome.org> | 2014-11-21 11:54:18 +0100 |
---|---|---|
committer | Thibault Saunier <tsaunier@gnome.org> | 2014-12-14 12:41:16 +0100 |
commit | 76944350c0cf515c622bb875300cd1f030fc4d71 (patch) | |
tree | 87e01f9d9ed92854814902e077281ab65038b0be /gst/deinterlace | |
parent | 6b69ef24a1e13f0ad7980fe25d954d37133ba746 (diff) | |
download | gstreamer-plugins-good-76944350c0cf515c622bb875300cd1f030fc4d71.tar.gz |
Deinterlace: in query_caps return only supported formats if filter is interlaced
In some cases the currently set GstVideoInfo is not interlaced, but
upstream caps are interlaced and the info is passed in the filter,
we should take that info into account and make sure that we do not
consider that case as a "pass through" case.
https://bugzilla.gnome.org/show_bug.cgi?id=741407
Diffstat (limited to 'gst/deinterlace')
-rw-r--r-- | gst/deinterlace/gstdeinterlace.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/gst/deinterlace/gstdeinterlace.c b/gst/deinterlace/gstdeinterlace.c index 943549d51..9a89f5c4d 100644 --- a/gst/deinterlace/gstdeinterlace.c +++ b/gst/deinterlace/gstdeinterlace.c @@ -2137,6 +2137,8 @@ gst_deinterlace_getcaps (GstDeinterlace * self, GstPad * pad, GstCaps * filter) gboolean half; GstVideoInterlaceMode interlacing_mode; + gboolean filter_interlaced = FALSE; + otherpad = (pad == self->srcpad) ? self->sinkpad : self->srcpad; half = pad != self->srcpad; @@ -2144,9 +2146,27 @@ gst_deinterlace_getcaps (GstDeinterlace * self, GstPad * pad, GstCaps * filter) peercaps = gst_pad_peer_query_caps (otherpad, NULL); interlacing_mode = GST_VIDEO_INFO_INTERLACE_MODE (&self->vinfo); + if (interlacing_mode == GST_VIDEO_INTERLACE_MODE_PROGRESSIVE && filter) { + guint i, caps_size; + + filter_interlaced = TRUE; + caps_size = gst_caps_get_size (filter); + for (i = 0; i < caps_size; i++) { + const gchar *interlace_mode; + GstStructure *structure = gst_caps_get_structure (filter, i); + + interlace_mode = gst_structure_get_string (structure, "interlace-mode"); + + if (!interlace_mode || g_strcmp0 (interlace_mode, "progressive") == 0) { + filter_interlaced = FALSE; + } + } + } + if (self->mode == GST_DEINTERLACE_MODE_INTERLACED || (self->mode == GST_DEINTERLACE_MODE_AUTO && - interlacing_mode != GST_VIDEO_INTERLACE_MODE_PROGRESSIVE)) { + (interlacing_mode != GST_VIDEO_INTERLACE_MODE_PROGRESSIVE || + filter_interlaced))) { gst_caps_unref (ourcaps); ourcaps = gst_caps_from_string (DEINTERLACE_CAPS); } |