pipeline: raspberrypi: delayed_controls: Add user cookie to DelayedControls

Allow the caller to provide a cookie value to DelayedControls::reset and
DelayedControls::push. This cookie value is returned from DelayedControls::get
for the frame that has the control values applied to it.

The cookie value is useful in tracking when a set of controls has been applied
to a frame. In a subsequent commit, it will be used by the Raspberry Pi IPA to
track the IPA context used when setting the control values.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Naushir Patuck
2022-11-15 09:07:51 +00:00
committed by Laurent Pinchart
parent c7524b10e0
commit 33abc2b31e
3 changed files with 16 additions and 12 deletions

View File

@@ -1066,7 +1066,7 @@ int PipelineHandlerRPi::start(Camera *camera, const ControlList *controls)
* Reset the delayed controls with the gain and exposure values set by
* the IPA.
*/
data->delayedCtrls_->reset();
data->delayedCtrls_->reset(0);
data->state_ = RPiCameraData::State::Idle;
@@ -1802,7 +1802,7 @@ void RPiCameraData::setIspControls(const ControlList &controls)
void RPiCameraData::setDelayedControls(const ControlList &controls)
{
if (!delayedCtrls_->push(controls))
if (!delayedCtrls_->push(controls, 0))
LOG(RPI, Error) << "V4L2 DelayedControl set failed";
handleState();
}
@@ -1875,7 +1875,7 @@ void RPiCameraData::unicamBufferDequeue(FrameBuffer *buffer)
* Lookup the sensor controls used for this frame sequence from
* DelayedControl and queue them along with the frame buffer.
*/
ControlList ctrl = delayedCtrls_->get(buffer->metadata().sequence);
auto [ctrl, cookie] = delayedCtrls_->get(buffer->metadata().sequence);
/*
* Add the frame timestamp to the ControlList for the IPA to use
* as it does not receive the FrameBuffer object.