summaryrefslogtreecommitdiff
path: root/src/libcamera/v4l2_videodevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcamera/v4l2_videodevice.cpp')
-rw-r--r--src/libcamera/v4l2_videodevice.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index 5580269f..95b9c38b 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -1600,6 +1600,14 @@ int V4L2VideoDevice::queueBuffer(FrameBuffer *buffer)
buf.length = planes[0].length;
}
+ /*
+ * Timestamps are to be supplied if the device is a mem-to-mem
+ * device. The drivers will have V4L2_BUF_FLAG_TIMESTAMP_COPY
+ * set hence these timestamps will be copied from the output
+ * buffers to capture buffers. If the device is not mem-to-mem,
+ * there is no harm in setting the timestamps as they will be
+ * ignored (and over-written).
+ */
buf.timestamp.tv_sec = metadata.timestamp / 1000000000;
buf.timestamp.tv_usec = (metadata.timestamp / 1000) % 1000000;
}