From 3978f6ae6c97e0ae77c4d44c9108f20afcfdb395 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Thu, 12 Sep 2013 16:56:56 +0200 Subject: [PATCH] v4l2: set GST_BUFFER_FLAG_DELTA_UNIT when appropriate https://bugzilla.gnome.org/show_bug.cgi?id=722394 --- sys/v4l2/gstv4l2bufferpool.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c index 2e44864b51..c6fcb206d2 100644 --- a/sys/v4l2/gstv4l2bufferpool.c +++ b/sys/v4l2/gstv4l2bufferpool.c @@ -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