summaryrefslogtreecommitdiff
path: root/src/libcamera/include
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2019-04-26 16:50:12 +0200
committerKieran Bingham <kieran.bingham@ideasonboard.com>2019-08-13 15:36:04 +0100
commit4f7625cca7ecb4ae5257e7e65ad86d046568db51 (patch)
tree15b97fac32612b8d237a5feeaf49a66ba656231e /src/libcamera/include
parent3a278eb460810e6774915fc058d420549cfb00d3 (diff)
libcamera: v4l2_videodevice: Support M2M devices
V4L2 M2M devices represent a V4L2Device with two queues: One output, and one capture on a single device node. Represent this by instantiating a V4L2VideoDevice for each queue type, and preparing each device for its queue. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/libcamera/include')
-rw-r--r--src/libcamera/include/v4l2_videodevice.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/libcamera/include/v4l2_videodevice.h b/src/libcamera/include/v4l2_videodevice.h
index f5c8da93..0fc2dcd8 100644
--- a/src/libcamera/include/v4l2_videodevice.h
+++ b/src/libcamera/include/v4l2_videodevice.h
@@ -71,6 +71,11 @@ struct V4L2Capability final : v4l2_capability {
V4L2_CAP_VIDEO_OUTPUT |
V4L2_CAP_VIDEO_OUTPUT_MPLANE);
}
+ bool isM2M() const
+ {
+ return device_caps() & (V4L2_CAP_VIDEO_M2M |
+ V4L2_CAP_VIDEO_M2M_MPLANE);
+ }
bool isMeta() const
{
return device_caps() & (V4L2_CAP_META_CAPTURE |
@@ -124,6 +129,7 @@ public:
V4L2VideoDevice &operator=(const V4L2VideoDevice &) = delete;
int open();
+ int open(int handle, enum v4l2_buf_type type);
void close();
const char *driverName() const { return caps_.driver(); }
@@ -182,6 +188,25 @@ private:
EventNotifier *fdEvent_;
};
+class V4L2M2MDevice
+{
+public:
+ V4L2M2MDevice(const std::string &deviceNode);
+ ~V4L2M2MDevice();
+
+ int open();
+ void close();
+
+ V4L2VideoDevice *output() { return output_; }
+ V4L2VideoDevice *capture() { return capture_; }
+
+private:
+ std::string deviceNode_;
+
+ V4L2VideoDevice *output_;
+ V4L2VideoDevice *capture_;
+};
+
} /* namespace libcamera */
#endif /* __LIBCAMERA_V4L2_VIDEODEVICE_H__ */