diff options
author | Jacopo Mondi <jacopo.mondi@ideasonboard.com> | 2024-07-26 11:48:53 +0200 |
---|---|---|
committer | Jacopo Mondi <jacopo.mondi@ideasonboard.com> | 2024-07-31 15:43:55 +0200 |
commit | 5bcd5bb6ca6a0101d767192d53d1bfb62b82df49 (patch) | |
tree | e9afdb1d4a9cd59ada89971570f018beb21b6cf8 /src | |
parent | 4565f34764585254b24eb7eb03d717a9000c7a03 (diff) |
libcamera: v4l2: Add bind context
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/v4l2_videodevice.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index 03ce5df0..a1d9f0ce 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -796,6 +796,18 @@ std::string V4L2VideoDevice::logPrefix() const (V4L2_TYPE_IS_OUTPUT(bufferType_) ? ":out]" : ":cap]"); } +int V4L2VideoDevice::bindContext(unsigned int context) +{ + struct v4l2_context c = {}; + + c.context_fd = context; + int ret = ioctl(VIDIOC_BIND_CONTEXT, &c); + if (ret) + LOG(V4L2, Error) << "Unable to bind context: " << strerror(-ret); + + return ret; +} + /** * \brief Retrieve the image format set on the V4L2 video device * \param[out] format The image format applied on the video device |