From 3d624b745b31383dbcd94d96246fab865820085f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Sun, 18 Oct 2020 03:47:23 +0200 Subject: libcamera: v4l2_device: Move start of frame detection to V4L2Device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The V4L2_EVENT_FRAME_SYNC event may occur on both V4L2 video-devices (V4L2VideoDevice) and sub-devices (V4L2Subdevice). Move the start of frame detection to the common base class of the two, V4L2Device. There is no functional change. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Reviewed-by: Jacopo Mondi --- include/libcamera/internal/v4l2_device.h | 12 ++++++++++++ include/libcamera/internal/v4l2_videodevice.h | 8 -------- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/libcamera/internal/v4l2_device.h b/include/libcamera/internal/v4l2_device.h index 722fb722..c56a950e 100644 --- a/include/libcamera/internal/v4l2_device.h +++ b/include/libcamera/internal/v4l2_device.h @@ -13,11 +13,15 @@ #include +#include + #include "libcamera/internal/log.h" #include "libcamera/internal/v4l2_controls.h" namespace libcamera { +class EventNotifier; + class V4L2Device : protected Loggable { public: @@ -34,6 +38,9 @@ public: const std::string &deviceNode() const { return deviceNode_; } std::string devicePath() const; + int setFrameStartEnabled(bool enable); + Signal frameStart; + protected: V4L2Device(const std::string &deviceNode); ~V4L2Device(); @@ -51,11 +58,16 @@ private: const struct v4l2_ext_control *v4l2Ctrls, unsigned int count); + void eventAvailable(EventNotifier *notifier); + std::map controlInfo_; std::vector> controlIds_; ControlInfoMap controls_; std::string deviceNode_; int fd_; + + EventNotifier *fdEventNotifier_; + bool frameStartEnabled_; }; } /* namespace libcamera */ diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h index dcb9654a..661503d1 100644 --- a/include/libcamera/internal/v4l2_videodevice.h +++ b/include/libcamera/internal/v4l2_videodevice.h @@ -207,9 +207,6 @@ public: int queueBuffer(FrameBuffer *buffer); Signal bufferReady; - int setFrameStartEnabled(bool enable); - Signal frameStart; - int streamOn(); int streamOff(); @@ -243,8 +240,6 @@ private: void bufferAvailable(EventNotifier *notifier); FrameBuffer *dequeueBuffer(); - void eventAvailable(EventNotifier *notifier); - V4L2Capability caps_; enum v4l2_buf_type bufferType_; @@ -254,9 +249,6 @@ private: std::map queuedBuffers_; EventNotifier *fdBufferNotifier_; - EventNotifier *fdEventNotifier_; - - bool frameStartEnabled_; }; class V4L2M2MDevice -- cgit v1.2.1