diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-10-07 22:31:59 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-10-13 20:37:51 +0300 |
commit | 343978af0b491002dd198b6465d2e3a5fae4e407 (patch) | |
tree | 400703ea4480dec45670150e1a9b9fa47bf77e2e /src/libcamera/pipeline/ipu3/ipu3.cpp | |
parent | 2fe723440a91ab9e086b90ffae912bf0f877daf2 (diff) |
libcamera: v4l2_device: Replace V4L2ControlList with ControlList
The V4L2Device class uses V4L2ControlList as a controls container for
the getControls() and setControls() operations. Having a distinct
container from ControlList will makes the IPA API more complex, as it
needs to explicitly transport both types of lists. This will become even
more painful when implementing serialisation and deserialisation.
To simplify the IPA API and ease the implementation of serialisation and
deserialisation, replace usage of V4L2ControlList with ControlList in
the V4L2Device (and thus CameraSensor) API. The V4L2ControlList class
becomes a thin wrapper around ControlList that slightly simplifies the
creation of control lists for V4L2 controls, and may be removed in the
future.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/libcamera/pipeline/ipu3/ipu3.cpp')
-rw-r--r-- | src/libcamera/pipeline/ipu3/ipu3.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 827906d5..9776b36b 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -199,6 +199,7 @@ class PipelineHandlerIPU3 : public PipelineHandler { public: static constexpr unsigned int V4L2_CID_IPU3_PIPE_MODE = 0x009819c1; + enum IPU3PipeModes { IPU3PipeModeVideo = 0, IPU3PipeModeStillCapture = 1, @@ -603,10 +604,10 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c) return ret; /* Apply the "pipe_mode" control to the ImgU subdevice. */ - V4L2ControlList ctrls; - ctrls.add(V4L2_CID_IPU3_PIPE_MODE, vfStream->active_ ? - IPU3PipeModeVideo : - IPU3PipeModeStillCapture); + V4L2ControlList ctrls(imgu->imgu_->controls()); + ctrls.set(V4L2_CID_IPU3_PIPE_MODE, + static_cast<int32_t>(vfStream->active_ ? IPU3PipeModeVideo : + IPU3PipeModeStillCapture)); ret = imgu->imgu_->setControls(&ctrls); if (ret) { LOG(IPU3, Error) << "Unable to set pipe_mode control"; |