Commit 0bbdb9bb authored by Matthieu Bouron's avatar Matthieu Bouron Committed by Sebastian Dröge

deinterlace: support any video formats and any caps features if deinterlace mode allows it

https://bugzilla.gnome.org/show_bug.cgi?id=719636
parent 3f8b4235
......@@ -277,16 +277,19 @@ gst_deinterlace_locking_get_type (void)
#define DEINTERLACE_CAPS GST_VIDEO_CAPS_MAKE(DEINTERLACE_VIDEO_FORMATS)
#define DEINTERLACE_ALL_CAPS DEINTERLACE_CAPS ";" \
GST_VIDEO_CAPS_MAKE_WITH_FEATURES ("ANY", GST_VIDEO_FORMATS_ALL)
static GstStaticPadTemplate src_templ = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (DEINTERLACE_CAPS)
GST_STATIC_CAPS (DEINTERLACE_ALL_CAPS)
);
static GstStaticPadTemplate sink_templ = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (DEINTERLACE_CAPS)
GST_STATIC_CAPS (DEINTERLACE_ALL_CAPS)
);
static void gst_deinterlace_finalize (GObject * self);
......@@ -2126,6 +2129,7 @@ gst_deinterlace_getcaps (GstDeinterlace * self, GstPad * pad, GstCaps * filter)
GstCaps *ourcaps;
GstCaps *peercaps;
gboolean half;
GstVideoInterlaceMode interlacing_mode;
otherpad = (pad == self->srcpad) ? self->sinkpad : self->srcpad;
half = pad != self->srcpad;
......@@ -2133,6 +2137,14 @@ gst_deinterlace_getcaps (GstDeinterlace * self, GstPad * pad, GstCaps * filter)
ourcaps = gst_pad_get_pad_template_caps (pad);
peercaps = gst_pad_peer_query_caps (otherpad, NULL);
interlacing_mode = GST_VIDEO_INFO_INTERLACE_MODE (&self->vinfo);
if (self->mode == GST_DEINTERLACE_MODE_INTERLACED ||
(self->mode == GST_DEINTERLACE_MODE_AUTO &&
interlacing_mode != GST_VIDEO_INTERLACE_MODE_PROGRESSIVE)) {
gst_caps_unref (ourcaps);
ourcaps = gst_caps_from_string (DEINTERLACE_CAPS);
}
if (peercaps) {
GST_DEBUG_OBJECT (pad, "Peer has caps %" GST_PTR_FORMAT, peercaps);
ret = gst_caps_make_writable (gst_caps_intersect (ourcaps, peercaps));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment