v4l2videodec: Prevent renegotiation
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 9 Jan 2015 21:59:53 +0000 (16:59 -0500)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 9 Jan 2015 21:59:53 +0000 (16:59 -0500)
Renegotiation isn't supported, simply prevent it the way we do in
v4l2src.

sys/v4l2/gstv4l2videodec.c

index cd27776..dd91808 100644 (file)
@@ -283,6 +283,13 @@ gst_v4l2_video_dec_flush (GstVideoDecoder * decoder)
 static gboolean
 gst_v4l2_video_dec_negotiate (GstVideoDecoder * decoder)
 {
+  GstV4l2VideoDec *self = GST_V4L2_VIDEO_DEC (decoder);
+
+  /* We don't allow renegotiation without carefull disabling the pool */
+  if (self->v4l2capture->pool &&
+      gst_buffer_pool_is_active (GST_BUFFER_POOL (self->v4l2capture->pool)))
+    return TRUE;
+
   return GST_VIDEO_DECODER_CLASS (parent_class)->negotiate (decoder);
 }