[gst-cvs] gst-ffmpeg: ffdeinterlace: Set "interlaced=false" in the source pad's caps

Edward Hervey bilboed at kemper.freedesktop.org
Fri Jun 25 08:29:25 PDT 2010


Module: gst-ffmpeg
Branch: master
Commit: 7f12d83a3942afaf5da05df397f5620abdcdd268
URL:    http://cgit.freedesktop.org/gstreamer/gst-ffmpeg/commit/?id=7f12d83a3942afaf5da05df397f5620abdcdd268

Author: Andoni Morales Alastruey <amorales at flumotion.com>
Date:   Fri Jun 25 16:26:00 2010 +0200

ffdeinterlace: Set "interlaced=false" in the source pad's caps

https://bugzilla.gnome.org/show_bug.cgi?id=622736

---

 ext/ffmpeg/gstffmpegdeinterlace.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/ext/ffmpeg/gstffmpegdeinterlace.c b/ext/ffmpeg/gstffmpegdeinterlace.c
index caaf6ca..119d2f5 100644
--- a/ext/ffmpeg/gstffmpegdeinterlace.c
+++ b/ext/ffmpeg/gstffmpegdeinterlace.c
@@ -112,6 +112,9 @@ gst_ffmpegdeinterlace_sink_setcaps (GstPad * pad, GstCaps * caps)
       GST_FFMPEGDEINTERLACE (gst_pad_get_parent (pad));
   GstStructure *structure = gst_caps_get_structure (caps, 0);
   AVCodecContext *ctx;
+  GValue interlaced = { 0 };
+  GstCaps *srcCaps;
+  GstFlowReturn ret;
 
   if (!gst_structure_get_int (structure, "width", &deinterlace->width))
     return FALSE;
@@ -136,7 +139,15 @@ gst_ffmpegdeinterlace_sink_setcaps (GstPad * pad, GstCaps * caps)
       avpicture_get_size (deinterlace->pixfmt, deinterlace->width,
       deinterlace->height);
 
-  return gst_pad_set_caps (deinterlace->srcpad, caps);
+  srcCaps = gst_caps_copy (caps);
+  g_value_init (&interlaced, G_TYPE_BOOLEAN);
+  g_value_set_boolean (&interlaced, FALSE);
+  gst_caps_set_value (srcCaps, "interlaced", &interlaced);
+  g_value_unset (&interlaced);
+
+  ret = gst_pad_set_caps (deinterlace->srcpad, srcCaps);
+  gst_caps_unref (srcCaps);
+  return ret;
 }
 
 static void





More information about the Gstreamer-commits mailing list