summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@gnome.org>2014-11-21 11:54:18 +0100
committerSebastian Dröge <sebastian@centricular.com>2014-12-16 15:11:53 +0100
commitd322432491adb1c056f9cdb09a1a6a442a994f3a (patch)
tree4cc3dd62dd0a6b1f6d89f5296bf07a1a8ab8f160
parentf5139c2b7b7d29e7544c9bb138f3dfafd76b8730 (diff)
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
-rw-r--r--gst/deinterlace/gstdeinterlace.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/gst/deinterlace/gstdeinterlace.c b/gst/deinterlace/gstdeinterlace.c
index d81605c3a..2029137c1 100644
--- a/gst/deinterlace/gstdeinterlace.c
+++ b/gst/deinterlace/gstdeinterlace.c
@@ -2138,6 +2138,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;
@@ -2145,9 +2147,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);
}