[{"id":33504,"web_url":"https://patchwork.libcamera.org/comment/33504/","msgid":"<174069196302.31628.3130724487044039888@ping.linuxembedded.co.uk>","date":"2025-02-27T21:32:43","subject":"Re: [PATCH v2 2/2] libcamera: pipeline: uvcvideo: Fix\n\t`ExposureTimeMode` control setting","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Barnabás Pőcze (2025-02-17 18:53:39)\n> The mapping in `UVCCameraData::processControl()` is not entirely correct\n> because the control value is retrieved as a `bool` instead of `int32_t`.\n> Additionally, the available modes are not taken into account.\n> \n> To fix this, retrieve the control with the proper type - `int32_t` -,\n> and use the available modes stored in `UVCCameraData` to determine\n> which value to use for the V4L2 control.\n> \n> Fixes: bad8d591f8acfa (\"libcamera: uvcvideo: Register ExposureTimeMode control\")\n> Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n> ---\n>  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 38 +++++++++++++++-----\n>  1 file changed, 29 insertions(+), 9 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> index 1f604b91e..adab6aa18 100644\n> --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> @@ -103,8 +103,8 @@ public:\n>         bool match(DeviceEnumerator *enumerator) override;\n>  \n>  private:\n> -       int processControl(ControlList *controls, unsigned int id,\n> -                          const ControlValue &value);\n> +       int processControl(UVCCameraData *data, ControlList *controls,\n> +                          unsigned int id, const ControlValue &value);\n>         int processControls(UVCCameraData *data, Request *request);\n>  \n>         bool acquireDevice(Camera *camera) override;\n> @@ -297,8 +297,8 @@ void PipelineHandlerUVC::stopDevice(Camera *camera)\n>         data->video_->releaseBuffers();\n>  }\n>  \n> -int PipelineHandlerUVC::processControl(ControlList *controls, unsigned int id,\n> -                                      const ControlValue &value)\n> +int PipelineHandlerUVC::processControl(UVCCameraData *data, ControlList *controls,\n> +                                      unsigned int id, const ControlValue &value)\n>  {\n>         uint32_t cid;\n>  \n> @@ -342,10 +342,30 @@ int PipelineHandlerUVC::processControl(ControlList *controls, unsigned int id,\n>         }\n>  \n>         case V4L2_CID_EXPOSURE_AUTO: {\n> -               int32_t ivalue = value.get<bool>()\n> -                              ? V4L2_EXPOSURE_APERTURE_PRIORITY\n> -                              : V4L2_EXPOSURE_MANUAL;\n> -               controls->set(V4L2_CID_EXPOSURE_AUTO, ivalue);\n> +               v4l2_exposure_auto_type exposureMode = {};\n> +\n> +               switch (value.get<int32_t>()) {\n> +               case controls::ExposureTimeModeAuto:\n> +                       if (data->availableExposureModes_[V4L2_EXPOSURE_AUTO])\n> +                               exposureMode = V4L2_EXPOSURE_AUTO;\n> +                       else if (data->availableExposureModes_[V4L2_EXPOSURE_APERTURE_PRIORITY])\n> +                               exposureMode = V4L2_EXPOSURE_APERTURE_PRIORITY;\n> +                       else\n\nIs this really an impossible to reach code path ? Or can a rogue\napplication 'decide' to try to set an unsupported mode just to see what\nwould happen ?\n\n> +                               ASSERT(false);\n> +                       break;\n> +               case controls::ExposureTimeModeManual:\n> +                       if (data->availableExposureModes_[V4L2_EXPOSURE_MANUAL])\n> +                               exposureMode = V4L2_EXPOSURE_MANUAL;\n> +                       else if (data->availableExposureModes_[V4L2_EXPOSURE_SHUTTER_PRIORITY])\n> +                               exposureMode = V4L2_EXPOSURE_SHUTTER_PRIORITY;\n> +                       else\n> +                               ASSERT(false);\n> +                       break;\n> +               default:\n> +                       return -EINVAL;\n> +               }\n> +\n> +               controls->set(V4L2_CID_EXPOSURE_AUTO, exposureMode);\n>                 break;\n>         }\n>  \n> @@ -383,7 +403,7 @@ int PipelineHandlerUVC::processControls(UVCCameraData *data, Request *request)\n>         ControlList controls(data->video_->controls());\n>  \n>         for (const auto &[id, value] : request->controls())\n> -               processControl(&controls, id, value);\n> +               processControl(data, &controls, id, value);\n>  \n>         for (const auto &ctrl : controls)\n>                 LOG(UVC, Debug)\n> -- \n> 2.48.1\n> \n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id B243FBE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 27 Feb 2025 21:32:47 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5471C68764;\n\tThu, 27 Feb 2025 22:32:47 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D8F0C60322\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 Feb 2025 22:32:45 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2CF52982;\n\tThu, 27 Feb 2025 22:31:17 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"kmLTgf62\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1740691877;\n\tbh=urOUtIcM5zYvmDszwv3eqHL+JYY9jfjy18Fzr10pmu4=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=kmLTgf62GEPCJ/H4LwDkcoDzbMQ6xLuHBVhkcyut8i5s2cydGo3CLMqh5yi7YcKgV\n\tEanvJRv3ur+1PkdysIqI+xeDvQIFlz/hqXpH39OoZfNR6EmwdvhCCWipC1JCivyQHF\n\tTThJOUkHkz1xb5wIpesaRAvy4R/vitWeWBXCDaj0=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250217185327.306509-3-pobrn@protonmail.com>","References":"<20250217185327.306509-1-pobrn@protonmail.com>\n\t<20250217185327.306509-3-pobrn@protonmail.com>","Subject":"Re: [PATCH v2 2/2] libcamera: pipeline: uvcvideo: Fix\n\t`ExposureTimeMode` control setting","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 27 Feb 2025 21:32:43 +0000","Message-ID":"<174069196302.31628.3130724487044039888@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":33509,"web_url":"https://patchwork.libcamera.org/comment/33509/","msgid":"<8oMkcOsXp2M56DWcxMlX8LZRMmpRAGPSmJ8e-9YgjMqjusLqE2rZ8F_7kH-YijgUVsgknFtxRFypcewYAtU_uGWquI5u7joWPjotN4OgK6A=@protonmail.com>","date":"2025-02-28T08:41:44","subject":"Re: [PATCH v2 2/2] libcamera: pipeline: uvcvideo: Fix\n\t`ExposureTimeMode` control setting","submitter":{"id":133,"url":"https://patchwork.libcamera.org/api/people/133/","name":"Pőcze Barnabás","email":"pobrn@protonmail.com"},"content":"Hi\n\n\n2025. február 27., csütörtök 22:32 keltezéssel, Kieran Bingham <kieran.bingham@ideasonboard.com> írta:\n\n> Quoting Barnabás Pőcze (2025-02-17 18:53:39)\n> > The mapping in `UVCCameraData::processControl()` is not entirely correct\n> > because the control value is retrieved as a `bool` instead of `int32_t`.\n> > Additionally, the available modes are not taken into account.\n> >\n> > To fix this, retrieve the control with the proper type - `int32_t` -,\n> > and use the available modes stored in `UVCCameraData` to determine\n> > which value to use for the V4L2 control.\n> >\n> > Fixes: bad8d591f8acfa (\"libcamera: uvcvideo: Register ExposureTimeMode control\")\n> > Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n> > ---\n> >  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 38 +++++++++++++++-----\n> >  1 file changed, 29 insertions(+), 9 deletions(-)\n> >\n> > diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > index 1f604b91e..adab6aa18 100644\n> > --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > @@ -103,8 +103,8 @@ public:\n> >         bool match(DeviceEnumerator *enumerator) override;\n> >\n> >  private:\n> > -       int processControl(ControlList *controls, unsigned int id,\n> > -                          const ControlValue &value);\n> > +       int processControl(UVCCameraData *data, ControlList *controls,\n> > +                          unsigned int id, const ControlValue &value);\n> >         int processControls(UVCCameraData *data, Request *request);\n> >\n> >         bool acquireDevice(Camera *camera) override;\n> > @@ -297,8 +297,8 @@ void PipelineHandlerUVC::stopDevice(Camera *camera)\n> >         data->video_->releaseBuffers();\n> >  }\n> >\n> > -int PipelineHandlerUVC::processControl(ControlList *controls, unsigned int id,\n> > -                                      const ControlValue &value)\n> > +int PipelineHandlerUVC::processControl(UVCCameraData *data, ControlList *controls,\n> > +                                      unsigned int id, const ControlValue &value)\n> >  {\n> >         uint32_t cid;\n> >\n> > @@ -342,10 +342,30 @@ int PipelineHandlerUVC::processControl(ControlList *controls, unsigned int id,\n> >         }\n> >\n> >         case V4L2_CID_EXPOSURE_AUTO: {\n> > -               int32_t ivalue = value.get<bool>()\n> > -                              ? V4L2_EXPOSURE_APERTURE_PRIORITY\n> > -                              : V4L2_EXPOSURE_MANUAL;\n> > -               controls->set(V4L2_CID_EXPOSURE_AUTO, ivalue);\n> > +               v4l2_exposure_auto_type exposureMode = {};\n> > +\n> > +               switch (value.get<int32_t>()) {\n> > +               case controls::ExposureTimeModeAuto:\n> > +                       if (data->availableExposureModes_[V4L2_EXPOSURE_AUTO])\n> > +                               exposureMode = V4L2_EXPOSURE_AUTO;\n> > +                       else if (data->availableExposureModes_[V4L2_EXPOSURE_APERTURE_PRIORITY])\n> > +                               exposureMode = V4L2_EXPOSURE_APERTURE_PRIORITY;\n> > +                       else\n> \n> Is this really an impossible to reach code path ? Or can a rogue\n> application 'decide' to try to set an unsupported mode just to see what\n> would happen ?\n\nI suppose you're right. I'm not sure why I thought it should be impossible to reach.\nI'll change it to return -EINVAL.\n\n\nRegards,\nBarnabás Pőcze\n\n> \n> > +                               ASSERT(false);\n> > +                       break;\n> > +               case controls::ExposureTimeModeManual:\n> > +                       if (data->availableExposureModes_[V4L2_EXPOSURE_MANUAL])\n> > +                               exposureMode = V4L2_EXPOSURE_MANUAL;\n> > +                       else if (data->availableExposureModes_[V4L2_EXPOSURE_SHUTTER_PRIORITY])\n> > +                               exposureMode = V4L2_EXPOSURE_SHUTTER_PRIORITY;\n> > +                       else\n> > +                               ASSERT(false);\n> > +                       break;\n> > +               default:\n> > +                       return -EINVAL;\n> > +               }\n> > +\n> > +               controls->set(V4L2_CID_EXPOSURE_AUTO, exposureMode);\n> >                 break;\n> >         }\n> >\n> > @@ -383,7 +403,7 @@ int PipelineHandlerUVC::processControls(UVCCameraData *data, Request *request)\n> >         ControlList controls(data->video_->controls());\n> >\n> >         for (const auto &[id, value] : request->controls())\n> > -               processControl(&controls, id, value);\n> > +               processControl(data, &controls, id, value);\n> >\n> >         for (const auto &ctrl : controls)\n> >                 LOG(UVC, Debug)\n> > --\n> > 2.48.1\n> >\n> >\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 92694BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 28 Feb 2025 08:41:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8CCE26876C;\n\tFri, 28 Feb 2025 09:41:52 +0100 (CET)","from mail-10629.protonmail.ch (mail-10629.protonmail.ch\n\t[79.135.106.29])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 416B768766\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 28 Feb 2025 09:41:50 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=protonmail.com header.i=@protonmail.com\n\theader.b=\"G0Kacb91\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;\n\ts=protonmail3; t=1740732109; x=1740991309;\n\tbh=hssWdGa72aQLxmKHYFC1dR57NgHscyldOroZ8axh97w=;\n\th=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References:\n\tFeedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID:\n\tMessage-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post;\n\tb=G0Kacb91hPNXYjJjz9baohrY4Ivb5xBQvX6QTBb2R81+FMTruVDlG9iaJaOgEEHU3\n\t9L8j9Z7k8D5xdHDrZuhvSF4MzgN31SQmq27ETcaPi4KkxXzBh7xkSCEL/NmIIRN1Pa\n\taZOcqlWbcw5zNZM58j6qan4QakYZf/XWUKQbCqf8hBywXlsEicSfOKVB7KtnNDoIy0\n\tyt2zU5W9QCAg5qHuaOg2gJRKDblVesREebx+wdG2MrLCDNlGUEoJX3aMXLZiAzheOu\n\tPekpLrWZvfLlNdnJYLKRW1d+8HtfCTybFZFxOYG1ztNM87GAOvacYk4HjDQJsrKDI3\n\tYuugpEuzf4f5Q==","Date":"Fri, 28 Feb 2025 08:41:44 +0000","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v2 2/2] libcamera: pipeline: uvcvideo: Fix\n\t`ExposureTimeMode` control setting","Message-ID":"<8oMkcOsXp2M56DWcxMlX8LZRMmpRAGPSmJ8e-9YgjMqjusLqE2rZ8F_7kH-YijgUVsgknFtxRFypcewYAtU_uGWquI5u7joWPjotN4OgK6A=@protonmail.com>","In-Reply-To":"<174069196302.31628.3130724487044039888@ping.linuxembedded.co.uk>","References":"<20250217185327.306509-1-pobrn@protonmail.com>\n\t<20250217185327.306509-3-pobrn@protonmail.com>\n\t<174069196302.31628.3130724487044039888@ping.linuxembedded.co.uk>","Feedback-ID":"20568564:user:proton","X-Pm-Message-ID":"26adc5cce6c24a7530f9f6eba23258d990bff6f8","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":33511,"web_url":"https://patchwork.libcamera.org/comment/33511/","msgid":"<c65fen6irtagpqfr32ew37aeepiktogylqw7efij2foab6rfo4@cd44j43r5rzn>","date":"2025-02-28T11:19:24","subject":"Re: [PATCH v2 2/2] libcamera: pipeline: uvcvideo: Fix\n\t`ExposureTimeMode` control setting","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Barnabás\n\n nice fix\n\nOn Mon, Feb 17, 2025 at 06:53:39PM +0000, Barnabás Pőcze wrote:\n> The mapping in `UVCCameraData::processControl()` is not entirely correct\n> because the control value is retrieved as a `bool` instead of `int32_t`.\n> Additionally, the available modes are not taken into account.\n>\n> To fix this, retrieve the control with the proper type - `int32_t` -,\n> and use the available modes stored in `UVCCameraData` to determine\n> which value to use for the V4L2 control.\n\nWith the assertion removal as suggested by Kieran\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\n(I actually wonder if it is possible to receive a\ncontrols::ExposureTimeModeAuto\n!data->availableExposureModes_[V4L2_EXPOSURE_AUTO] &&\n!data->availableExposureModes_[V4L2_EXPOSURE_APERTURE_PRIORITY])\n\nas the Camera shouldn't register  controls::ExposureTimeModeAuto in\nthe ::controls() ControlInfoMap...\n\nHowever, checking for this surely doesn't hurt.\n\n>\n> Fixes: bad8d591f8acfa (\"libcamera: uvcvideo: Register ExposureTimeMode control\")\n> Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n> ---\n>  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 38 +++++++++++++++-----\n>  1 file changed, 29 insertions(+), 9 deletions(-)\n>\n> diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> index 1f604b91e..adab6aa18 100644\n> --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> @@ -103,8 +103,8 @@ public:\n>  \tbool match(DeviceEnumerator *enumerator) override;\n>\n>  private:\n> -\tint processControl(ControlList *controls, unsigned int id,\n> -\t\t\t   const ControlValue &value);\n> +\tint processControl(UVCCameraData *data, ControlList *controls,\n> +\t\t\t   unsigned int id, const ControlValue &value);\n>  \tint processControls(UVCCameraData *data, Request *request);\n>\n>  \tbool acquireDevice(Camera *camera) override;\n> @@ -297,8 +297,8 @@ void PipelineHandlerUVC::stopDevice(Camera *camera)\n>  \tdata->video_->releaseBuffers();\n>  }\n>\n> -int PipelineHandlerUVC::processControl(ControlList *controls, unsigned int id,\n> -\t\t\t\t       const ControlValue &value)\n> +int PipelineHandlerUVC::processControl(UVCCameraData *data, ControlList *controls,\n> +\t\t\t\t       unsigned int id, const ControlValue &value)\n>  {\n>  \tuint32_t cid;\n>\n> @@ -342,10 +342,30 @@ int PipelineHandlerUVC::processControl(ControlList *controls, unsigned int id,\n>  \t}\n>\n>  \tcase V4L2_CID_EXPOSURE_AUTO: {\n> -\t\tint32_t ivalue = value.get<bool>()\n> -\t\t\t       ? V4L2_EXPOSURE_APERTURE_PRIORITY\n> -\t\t\t       : V4L2_EXPOSURE_MANUAL;\n> -\t\tcontrols->set(V4L2_CID_EXPOSURE_AUTO, ivalue);\n> +\t\tv4l2_exposure_auto_type exposureMode = {};\n> +\n> +\t\tswitch (value.get<int32_t>()) {\n> +\t\tcase controls::ExposureTimeModeAuto:\n> +\t\t\tif (data->availableExposureModes_[V4L2_EXPOSURE_AUTO])\n> +\t\t\t\texposureMode = V4L2_EXPOSURE_AUTO;\n> +\t\t\telse if (data->availableExposureModes_[V4L2_EXPOSURE_APERTURE_PRIORITY])\n> +\t\t\t\texposureMode = V4L2_EXPOSURE_APERTURE_PRIORITY;\n> +\t\t\telse\n> +\t\t\t\tASSERT(false);\n> +\t\t\tbreak;\n> +\t\tcase controls::ExposureTimeModeManual:\n> +\t\t\tif (data->availableExposureModes_[V4L2_EXPOSURE_MANUAL])\n> +\t\t\t\texposureMode = V4L2_EXPOSURE_MANUAL;\n> +\t\t\telse if (data->availableExposureModes_[V4L2_EXPOSURE_SHUTTER_PRIORITY])\n> +\t\t\t\texposureMode = V4L2_EXPOSURE_SHUTTER_PRIORITY;\n> +\t\t\telse\n> +\t\t\t\tASSERT(false);\n> +\t\t\tbreak;\n> +\t\tdefault:\n> +\t\t\treturn -EINVAL;\n> +\t\t}\n> +\n> +\t\tcontrols->set(V4L2_CID_EXPOSURE_AUTO, exposureMode);\n>  \t\tbreak;\n>  \t}\n>\n> @@ -383,7 +403,7 @@ int PipelineHandlerUVC::processControls(UVCCameraData *data, Request *request)\n>  \tControlList controls(data->video_->controls());\n>\n>  \tfor (const auto &[id, value] : request->controls())\n> -\t\tprocessControl(&controls, id, value);\n> +\t\tprocessControl(data, &controls, id, value);\n>\n>  \tfor (const auto &ctrl : controls)\n>  \t\tLOG(UVC, Debug)\n> --\n> 2.48.1\n>\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 00363BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 28 Feb 2025 11:19:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 11A326876A;\n\tFri, 28 Feb 2025 12:19:30 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 677F561853\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 28 Feb 2025 12:19:28 +0100 (CET)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 28300250;\n\tFri, 28 Feb 2025 12:17:59 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"sy89OhuR\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1740741479;\n\tbh=98/34itKHhhjirDgEsSkfyo6xPFO8TMP4f33FVrxnNM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=sy89OhuRCBs/jeojKaSkEUm85tsFmrsXtWcmSDUe0ZB4LcH9Q5awirFYX+2YQTojk\n\tr98LAeunnc4JeTYVRl4MRC8+h9p+b0J1GyDP/E3EdpDMCQ8w/0UkD5UHsJHOHYgg3b\n\tnktojWIJq8KfYtwR4LL5AA1H+Ex3Bqo4poWfK6c4=","Date":"Fri, 28 Feb 2025 12:19:24 +0100","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v2 2/2] libcamera: pipeline: uvcvideo: Fix\n\t`ExposureTimeMode` control setting","Message-ID":"<c65fen6irtagpqfr32ew37aeepiktogylqw7efij2foab6rfo4@cd44j43r5rzn>","References":"<20250217185327.306509-1-pobrn@protonmail.com>\n\t<20250217185327.306509-3-pobrn@protonmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20250217185327.306509-3-pobrn@protonmail.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]