summaryrefslogtreecommitdiff
path: root/v4l2++/src/videodevice.cpp
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2022-10-04 10:10:07 +0300
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2022-10-04 11:02:56 +0300
commit3e17a921680737c50a818bebf7eded511f4d6029 (patch)
tree53d55973d5b32f33881b8b7886ad04cc9872867f /v4l2++/src/videodevice.cpp
parentdfa9e526a43086a1b0936b74ec243f23396d5f69 (diff)
v4l2: Add VideoStreamer::export_buffer
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Diffstat (limited to 'v4l2++/src/videodevice.cpp')
-rw-r--r--v4l2++/src/videodevice.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/v4l2++/src/videodevice.cpp b/v4l2++/src/videodevice.cpp
index 858b82b..c25e9be 100644
--- a/v4l2++/src/videodevice.cpp
+++ b/v4l2++/src/videodevice.cpp
@@ -624,7 +624,18 @@ void VideoStreamer::stream_off()
FAIL_IF(r, "Failed to disable stream: %d", r);
}
+int VideoStreamer::export_buffer(uint32_t index)
+{
+ struct v4l2_exportbuffer expbuf;
+
+ memset(&expbuf, 0, sizeof(expbuf));
+ expbuf.type = get_buf_type(m_type);
+ expbuf.index = index;
+ int r = ioctl(m_fd, VIDIOC_EXPBUF, &expbuf);
+ FAIL_IF(r, "VIDIOC_EXPBUF failed: %d", r);
+ return expbuf.fd;
+}