<div dir="ltr"><div dir="ltr">Hi Laurent,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 25, 2021 at 6:50 PM Laurent Pinchart <<a href="mailto:laurent.pinchart@ideasonboard.com">laurent.pinchart@ideasonboard.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Hiro,<br>
<br>
Thank you for the patch.<br>
<br>
On Tue, May 25, 2021 at 02:33:41PM +0900, Hirokazu Honda wrote:<br>
> The commit (34bee5e8) of removing the controls order assumption<br>
> doesn't change the update ControlValue type in<br>
> V4L2Device::updateControls(). However, this is wrong because the<br>
> ControlValue is set to a placeholder ControlValue in<br>
> V4L2Device::getControls(), so the type is ControlTypeNone.<br>
> We should rather look up the type in V4L2Device::controls_ with a<br>
> specified id.<br>
<br>
As we've merged a revert to quickly fix the master branch, could you<br>
repost this squashed with the original patch ?<br>
<br></blockquote><div><br></div><div>Thanks. I will do and test with your submit patch.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> Fixes: 34bee5e8 (libcamera: V4L2Device: Remove the controls order assumption in updateControls())<br>
> Signed-off-by: Hirokazu Honda <<a href="mailto:hiroh@chromium.org" target="_blank">hiroh@chromium.org</a>><br>
> ---<br>
> src/libcamera/v4l2_device.cpp | 6 +++++-<br>
> 1 file changed, 5 insertions(+), 1 deletion(-)<br>
> <br>
> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp<br>
> index 7f7e5b8f..cc4f52bf 100644<br>
> --- a/src/libcamera/v4l2_device.cpp<br>
> +++ b/src/libcamera/v4l2_device.cpp<br>
> @@ -621,7 +621,11 @@ void V4L2Device::updateControls(ControlList *ctrls,<br>
> const unsigned int id = v4l2Ctrl.id;<br>
> <br>
> ControlValue value = ctrls->get(id);<br>
> - switch (value.type()) {<br>
> +<br>
> + auto iter = controls_.find(id);<br>
<br>
Maybe const auto ?<br>
<br>
> + ASSERT(iter != controls_.end());<br>
> + const ControlType type = iter->first->type();<br>
> + switch (type) {<br>
> case ControlTypeInteger64:<br>
> value.set<int64_t>(v4l2Ctrl.value64);<br>
> break;<br>
<br>
-- <br>
Regards,<br>
<br>
Laurent Pinchart<br>
</blockquote></div></div>