summaryrefslogtreecommitdiff
path: root/src/ipa/rkisp1
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-10-07 22:31:59 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-10-13 20:37:51 +0300
commit343978af0b491002dd198b6465d2e3a5fae4e407 (patch)
tree400703ea4480dec45670150e1a9b9fa47bf77e2e /src/ipa/rkisp1
parent2fe723440a91ab9e086b90ffae912bf0f877daf2 (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/ipa/rkisp1')
-rw-r--r--src/ipa/rkisp1/rkisp1.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
index b0d23dd1..69ced840 100644
--- a/src/ipa/rkisp1/rkisp1.cpp
+++ b/src/ipa/rkisp1/rkisp1.cpp
@@ -49,6 +49,8 @@ private:
std::map<unsigned int, BufferMemory> bufferInfo_;
+ V4L2ControlInfoMap ctrls_;
+
/* Camera sensor controls. */
bool autoExposure_;
uint32_t exposure_;
@@ -65,16 +67,16 @@ void IPARkISP1::configure(const std::map<unsigned int, IPAStream> &streamConfig,
if (entityControls.empty())
return;
- const V4L2ControlInfoMap &ctrls = entityControls.at(0);
+ ctrls_ = entityControls.at(0);
- const auto itExp = ctrls.find(V4L2_CID_EXPOSURE);
- if (itExp == ctrls.end()) {
+ const auto itExp = ctrls_.find(V4L2_CID_EXPOSURE);
+ if (itExp == ctrls_.end()) {
LOG(IPARkISP1, Error) << "Can't find exposure control";
return;
}
- const auto itGain = ctrls.find(V4L2_CID_ANALOGUE_GAIN);
- if (itGain == ctrls.end()) {
+ const auto itGain = ctrls_.find(V4L2_CID_ANALOGUE_GAIN);
+ if (itGain == ctrls_.end()) {
LOG(IPARkISP1, Error) << "Can't find gain control";
return;
}
@@ -210,9 +212,9 @@ void IPARkISP1::setControls(unsigned int frame)
IPAOperationData op;
op.operation = RKISP1_IPA_ACTION_V4L2_SET;
- V4L2ControlList ctrls;
- ctrls.add(V4L2_CID_EXPOSURE, exposure_);
- ctrls.add(V4L2_CID_ANALOGUE_GAIN, gain_);
+ V4L2ControlList ctrls(ctrls_);
+ ctrls.set(V4L2_CID_EXPOSURE, static_cast<int32_t>(exposure_));
+ ctrls.set(V4L2_CID_ANALOGUE_GAIN, static_cast<int32_t>(gain_));
op.v4l2controls.push_back(ctrls);
queueFrameAction.emit(frame, op);