@@ -39,16 +39,18 @@ private:
{
public:
Info()
- : updated(false)
+ : updated(false), sourceSequence(0)
{
}
- Info(const ControlValue &v, bool updated_ = true)
- : ControlValue(v), updated(updated_)
+ Info(const ControlValue &v, uint32_t sourceSeq, bool updated_ = true)
+ : ControlValue(v), updated(updated_), sourceSequence(sourceSeq)
{
}
bool updated;
+ /* The sequence id for which this value was requested */
+ uint32_t sourceSequence;
};
/* \todo Make the listSize configurable at instance creation time. */
@@ -147,7 +147,7 @@ void DelayedControls::reset(ControlList *controls)
* Do not mark this control value as updated, it does not need
* to be written to to device on startup.
*/
- values_[id][0] = Info(ctrl.second, false);
+ values_[id][0] = Info(ctrl.second, 0, false);
}
}
@@ -220,7 +220,7 @@ bool DelayedControls::push(const ControlList &controls)
Info &info = values_[id][queueIndex_];
- info = Info(control.second);
+ info = Info(control.second, 0);
LOG(DelayedControls, Debug)
<< "Queuing " << id->name()
This is necessary for the upcoming rework. It allows to track the sequence number from which a request stems. The use case where this is needed is as follows: Assume for frame 10 a manual ExposureTime=42 is queued because the user wants manual exposure. Now the agc gets the stats for frame 8 (where auto regulation is still active) and pushes a new ExposureTime for frame 9. Frame 9 was already sent out, so it gets delayed to frame 11 (assuming a delay of 2 on ExposureTime). This would revert the request from frame 10. Taking the sourceSequence into account, the delayed request from frame 9 will be discarded, which is correct. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> --- include/libcamera/internal/delayed_controls.h | 8 +++++--- src/libcamera/delayed_controls.cpp | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-)