v4l2: set GST_BUFFER_FLAG_DELTA_UNIT when appropriate
authorMichael Olbrich <m.olbrich@pengutronix.de>
Thu, 12 Sep 2013 14:56:56 +0000 (16:56 +0200)
committerNicolas Dufresne <nicolas.dufresne@collabora.co.uk>
Fri, 17 Jan 2014 15:04:34 +0000 (10:04 -0500)
https://bugzilla.gnome.org/show_bug.cgi?id=722394

sys/v4l2/gstv4l2bufferpool.c

index 2e44864..c6fcb20 100644 (file)
@@ -974,6 +974,12 @@ gst_v4l2_buffer_pool_dqbuf (GstV4l2BufferPool * pool, GstBuffer ** buffer)
   if (vbuffer.field == V4L2_FIELD_INTERLACED_BT) {
     GST_BUFFER_FLAG_UNSET (outbuf, GST_VIDEO_BUFFER_FLAG_TFF);
   }
+  if (GST_VIDEO_INFO_FORMAT (&obj->info) == GST_VIDEO_FORMAT_ENCODED) {
+    if (vbuffer.flags & V4L2_BUF_FLAG_KEYFRAME)
+      GST_BUFFER_FLAG_UNSET (outbuf, GST_BUFFER_FLAG_DELTA_UNIT);
+    else
+      GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DELTA_UNIT);
+  }
 
   /* The size can change at every frame, esp. with jpeg. The GstMemory
    * inside the GstBuffer could have been changed by some other