diff options
Diffstat (limited to 'v4l2++')
| -rw-r--r-- | v4l2++/inc/v4l2++/videodevice.h | 2 | ||||
| -rw-r--r-- | v4l2++/src/videodevice.cpp | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/v4l2++/inc/v4l2++/videodevice.h b/v4l2++/inc/v4l2++/videodevice.h index bdb290e..9016a7f 100644 --- a/v4l2++/inc/v4l2++/videodevice.h +++ b/v4l2++/inc/v4l2++/videodevice.h @@ -106,6 +106,8 @@ public: void stream_on(); void stream_off(); + int export_buffer(uint32_t index); + int fd() const { return m_fd; } protected: 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; +} |
