summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurélien Zanelli <aurelien.zanelli@parrot.com>2014-12-09 14:01:50 +0100
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2014-12-09 14:39:05 -0500
commita4ce8ef320009ae0ad4acf95c8c8837053af5e81 (patch)
treed98e1c0c3e2a57fc81c0c30ece080dae86651b77
parent6609994540c86aae72e352b3e9368c9c5665f8fc (diff)
v4l2bufferpool: set buffer interlace flags when field is V4L2_FIELD_INTERLACED
If v4l2_buffer.field is V4L2_FIELD_INTERLACED, we set corresponding GstVideoBuffer flags depending on the video standard. According to V4L2 specification, M/NTSC transmits the bottom field first, all other standards the top field first. https://bugzilla.gnome.org/show_bug.cgi?id=737603
-rw-r--r--sys/v4l2/gstv4l2bufferpool.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c
index e4369a55c..b8d7bb141 100644
--- a/sys/v4l2/gstv4l2bufferpool.c
+++ b/sys/v4l2/gstv4l2bufferpool.c
@@ -1134,6 +1134,16 @@ gst_v4l2_buffer_pool_dqbuf (GstV4l2BufferPool * pool, GstBuffer ** buffer)
GST_BUFFER_FLAG_SET (outbuf, GST_VIDEO_BUFFER_FLAG_INTERLACED);
GST_BUFFER_FLAG_UNSET (outbuf, GST_VIDEO_BUFFER_FLAG_TFF);
break;
+ case V4L2_FIELD_INTERLACED:
+ GST_BUFFER_FLAG_SET (outbuf, GST_VIDEO_BUFFER_FLAG_INTERLACED);
+ if (obj->tv_norm == V4L2_STD_NTSC_M ||
+ obj->tv_norm == V4L2_STD_NTSC_M_JP ||
+ obj->tv_norm == V4L2_STD_NTSC_M_KR) {
+ GST_BUFFER_FLAG_UNSET (outbuf, GST_VIDEO_BUFFER_FLAG_TFF);
+ } else {
+ GST_BUFFER_FLAG_SET (outbuf, GST_VIDEO_BUFFER_FLAG_TFF);
+ }
+ break;
default:
GST_BUFFER_FLAG_UNSET (outbuf, GST_VIDEO_BUFFER_FLAG_INTERLACED);
GST_BUFFER_FLAG_UNSET (outbuf, GST_VIDEO_BUFFER_FLAG_TFF);