diff options
author | Naushir Patuck <naush@raspberrypi.com> | 2020-02-04 11:24:44 +0000 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-02-13 22:19:07 +0200 |
commit | ea3a00bc33f950c794e8b6d8cf0201a24c0c3d0d (patch) | |
tree | ccff8ec458a47a46af89302b57164440182a8f87 /src/libcamera/include | |
parent | 5dc5fb2ac57ec7123215c82d10992cfbcddf34e9 (diff) |
libcamera: v4l2_videodevice: Add crop/selection control
Add control for cropping/selection on a V4L2 video device through
the VIDIOC_S_SELECTION ioctl. This is similar to the existing cropping
control available on V4L2 sub-devices.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/libcamera/include')
-rw-r--r-- | src/libcamera/include/v4l2_videodevice.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libcamera/include/v4l2_videodevice.h b/src/libcamera/include/v4l2_videodevice.h index e4d35ab3..fcf07264 100644 --- a/src/libcamera/include/v4l2_videodevice.h +++ b/src/libcamera/include/v4l2_videodevice.h @@ -182,6 +182,9 @@ public: int setFormat(V4L2DeviceFormat *format); ImageFormats formats(); + int setCrop(Rectangle *rect); + int setCompose(Rectangle *rect); + int exportBuffers(unsigned int count, std::vector<std::unique_ptr<FrameBuffer>> *buffers); int importBuffers(unsigned int count); @@ -216,6 +219,8 @@ private: std::vector<unsigned int> enumPixelformats(); std::vector<SizeRange> enumSizes(unsigned int pixelFormat); + int setSelection(unsigned int target, Rectangle *rect); + int requestBuffers(unsigned int count); std::unique_ptr<FrameBuffer> createBuffer(const struct v4l2_buffer &buf); FileDescriptor exportDmabufFd(unsigned int index, unsigned int plane); |