summaryrefslogtreecommitdiff
path: root/src/libcamera
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcamera')
-rw-r--r--src/libcamera/pipeline/simple/simple.cpp18
-rw-r--r--src/libcamera/software_isp/TODO29
2 files changed, 15 insertions, 32 deletions
diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
index 61157fe6..1e13bd74 100644
--- a/src/libcamera/pipeline/simple/simple.cpp
+++ b/src/libcamera/pipeline/simple/simple.cpp
@@ -32,6 +32,7 @@
#include "libcamera/internal/camera.h"
#include "libcamera/internal/camera_sensor.h"
#include "libcamera/internal/converter.h"
+#include "libcamera/internal/delayed_controls.h"
#include "libcamera/internal/device_enumerator.h"
#include "libcamera/internal/media_device.h"
#include "libcamera/internal/pipeline_handler.h"
@@ -278,6 +279,8 @@ public:
std::vector<Configuration> configs_;
std::map<PixelFormat, std::vector<const Configuration *>> formats_;
+ std::unique_ptr<DelayedControls> delayedCtrls_;
+
std::vector<std::unique_ptr<FrameBuffer>> conversionBuffers_;
std::queue<std::map<const Stream *, FrameBuffer *>> conversionQueue_;
bool useConversion_;
@@ -896,14 +899,13 @@ void SimpleCameraData::conversionOutputDone(FrameBuffer *buffer)
void SimpleCameraData::ispStatsReady(uint32_t frame, uint32_t bufferId)
{
- /* \todo Use the DelayedControls class */
swIsp_->processStats(frame, bufferId,
- sensor_->getControls({ V4L2_CID_ANALOGUE_GAIN,
- V4L2_CID_EXPOSURE }));
+ delayedCtrls_->get(frame));
}
void SimpleCameraData::setSensorControls(const ControlList &sensorControls)
{
+ delayedCtrls_->push(sensorControls);
ControlList ctrls(sensorControls);
sensor_->setControls(&ctrls);
}
@@ -1284,6 +1286,16 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)
if (outputCfgs.empty())
return 0;
+ std::unordered_map<uint32_t, DelayedControls::ControlParams> params = {
+ { V4L2_CID_ANALOGUE_GAIN, { 2, false } },
+ { V4L2_CID_EXPOSURE, { 2, false } },
+ };
+ data->delayedCtrls_ =
+ std::make_unique<DelayedControls>(data->sensor_->device(),
+ params);
+ data->video_->frameStart.connect(data->delayedCtrls_.get(),
+ &DelayedControls::applyControls);
+
StreamConfiguration inputCfg;
inputCfg.pixelFormat = pipeConfig->captureFormat;
inputCfg.size = pipeConfig->captureSize;
diff --git a/src/libcamera/software_isp/TODO b/src/libcamera/software_isp/TODO
index 9978afc0..8eeede46 100644
--- a/src/libcamera/software_isp/TODO
+++ b/src/libcamera/software_isp/TODO
@@ -209,35 +209,6 @@ At some point, yes.
---
-11. Improve handling the sensor controls which take effect with a delay
-
-> void IPASoftSimple::processStats(const ControlList &sensorControls)
-> {
-> ...
-> /*
-> * AE / AGC, use 2 frames delay to make sure that the exposure and
-> * the gain set have applied to the camera sensor.
-> */
-> if (ignore_updates_ > 0) {
-> --ignore_updates_;
-> return;
-> }
-
-This could be handled better with DelayedControls.
-
----
-
-12. Use DelayedControls class in ispStatsReady()
-
-> void SimpleCameraData::ispStatsReady()
-> {
-> swIsp_->processStats(sensor_->getControls({ V4L2_CID_ANALOGUE_GAIN,
-> V4L2_CID_EXPOSURE }));
-
-You should use the DelayedControls class.
-
----
-
13. Improve black level and colour gains application
I think the black level should eventually be moved before debayering, and