[{"id":33760,"web_url":"https://patchwork.libcamera.org/comment/33760/","msgid":"<20250328173349.GB23459@pendragon.ideasonboard.com>","date":"2025-03-28T17:33:49","subject":"Re: [PATCH v1] gstreamer: Use `Control<>` objects when setting\n\tcontrols","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Barnabás,\n\nThank you for the patch.\n\nOn Fri, Mar 28, 2025 at 05:07:36PM +0100, Barnabás Pőcze wrote:\n> `g_value_get_boolean()` returns `gboolean`, which is actually `int`. Thus\n> \n>   // ControlValue x;\n>   auto val = g_value_get_boolean(...);\n>   x.set(val);\n> \n> will cause `ControlValue::set<int, ...>(const int&)` to be called, which\n> will save the value as `ControlTypeInteger32`, not `ControlTypeBoolean`.\n\nOops... good catch !\n\n> Then, if something tries to retrieve the boolean value, it will run into an\n> assertion failure:\n> \n>   Assertion `type_ == details::control_type<std::remove_cv_t<T>>::value' failed.\n> \n> in `ControlValue::set()`.\n> \n> Fix this by using the appropriately typed `Control<>` object when setting\n> the value in the `ControlList` as this ensures that the value will be\n> converted to the actual type of the control.\n> \n> Bug: https://bugs.libcamera.org/show_bug.cgi?id=261\n> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> ---\n> There is a simpler fix to this issue as well:\n> \n> \tdiff --git a/src/gstreamer/gstlibcamera-controls.cpp.in b/src/gstreamer/gstlibcamera-controls.cpp.in\n> \tindex d937b19e6..8378b5fd0 100644\n> \t--- a/src/gstreamer/gstlibcamera-controls.cpp.in\n> \t+++ b/src/gstreamer/gstlibcamera-controls.cpp.in\n> \t@@ -271,7 +271,7 @@ bool GstCameraControls::setProperty(guint propId, const GValue *value,\n> \t\t\t}\n> \t\t\tRectangle val = value_get_rectangle(value);\n> \t{%- else %}\n> \t-               auto val = g_value_get_{{ ctrl.gtype }}(value);\n> \t+               {{ ctrl.element_type }} val = g_value_get_{{ ctrl.gtype }}(value);\n\nI knew auto was bad :-D\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nYou fixed the bug even before I had a chance to look at the bug report.\nKudos !\n\n> \t{%- endif %}\n> \t\t\tcontrol.set(val);\n> \t{%- endif %}\n> \n> ---\n>  src/gstreamer/gstlibcamera-controls.cpp.in | 13 ++++---------\n>  1 file changed, 4 insertions(+), 9 deletions(-)\n> \n> diff --git a/src/gstreamer/gstlibcamera-controls.cpp.in b/src/gstreamer/gstlibcamera-controls.cpp.in\n> index d937b19e6..89c530da0 100644\n> --- a/src/gstreamer/gstlibcamera-controls.cpp.in\n> +++ b/src/gstreamer/gstlibcamera-controls.cpp.in\n> @@ -223,7 +223,6 @@ bool GstCameraControls::setProperty(guint propId, const GValue *value,\n>  {%- for ctrl in ctrls %}\n> \n>  \tcase controls::{{ ctrl.namespace }}{{ ctrl.name|snake_case|upper }}: {\n> -\t\tControlValue control;\n>  {%- if ctrl.is_array %}\n>  \t\tsize_t size = gst_value_array_get_size(value);\n>  {%- if ctrl.size != 0 %}\n> @@ -254,12 +253,9 @@ bool GstCameraControls::setProperty(guint propId, const GValue *value,\n>  \t\t}\n> \n>  {%- if ctrl.size == 0 %}\n> -\t\tcontrol.set(Span<const {{ ctrl.element_type }}>(values.data(),\n> -\t\t\t\t\t\t\t\tsize));\n> +\t\tSpan<const {{ ctrl.element_type }}> val(values.data(), size);\n>  {%- else %}\n> -\t\tcontrol.set(Span<const {{ ctrl.element_type }},\n> -\t\t\t         {{ ctrl.size }}>(values.data(),\n> -\t\t\t\t\t\t  {{ ctrl.size }}));\n> +\t\tSpan<const {{ ctrl.element_type }}, {{ ctrl.size }}> val(values.data(), size);\n>  {%- endif %}\n>  {%- else %}\n>  {%- if ctrl.is_rectangle %}\n> @@ -273,10 +269,9 @@ bool GstCameraControls::setProperty(guint propId, const GValue *value,\n>  {%- else %}\n>  \t\tauto val = g_value_get_{{ ctrl.gtype }}(value);\n>  {%- endif %}\n> -\t\tcontrol.set(val);\n>  {%- endif %}\n> -\t\tcontrols_.set(propId, control);\n> -\t\tcontrols_acc_.set(propId, control);\n> +\t\tcontrols_.set(controls::{{ ctrl.namespace }}{{ ctrl.name }}, val);\n> +\t\tcontrols_acc_.set(controls::{{ ctrl.namespace }}{{ ctrl.name }}, val);\n>  \t\treturn true;\n>  \t}\n>  {%- endfor %}","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 74939C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 28 Mar 2025 17:34:16 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 650AF6897A;\n\tFri, 28 Mar 2025 18:34:15 +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 CE587614E8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 28 Mar 2025 18:34:13 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 23668844;\n\tFri, 28 Mar 2025 18:32:24 +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=\"n5MCT9Gj\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1743183144;\n\tbh=6HXctG171V2++WwBGZHEU6zM7CmhyPJtsAGn5qvjcWo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=n5MCT9GjowIqL4D68NbrkcoexjdluWlerNK3RRC1/PRIdbsEMuvrCUlnJ4w01+4Zg\n\tuOc5gd1Con0g6IK5945skA2RV49OqCmWeTGaNSQ7jslZ/AvKr2zY5xK0IWtghWq+NT\n\thgkJtGDzY8p+gm3wIWz3K7aay411icO4NTlvwN7s=","Date":"Fri, 28 Mar 2025 19:33:49 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v1] gstreamer: Use `Control<>` objects when setting\n\tcontrols","Message-ID":"<20250328173349.GB23459@pendragon.ideasonboard.com>","References":"<20250328160736.94529-1-barnabas.pocze@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20250328160736.94529-1-barnabas.pocze@ideasonboard.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>"}},{"id":33857,"web_url":"https://patchwork.libcamera.org/comment/33857/","msgid":"<174352664478.494853.9985076452697531805@ping.linuxembedded.co.uk>","date":"2025-04-01T16:57:24","subject":"Re: [PATCH v1] gstreamer: Use `Control<>` objects when setting\n\tcontrols","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2025-03-28 17:33:49)\n> Hi Barnabás,\n> \n> Thank you for the patch.\n> \n> On Fri, Mar 28, 2025 at 05:07:36PM +0100, Barnabás Pőcze wrote:\n> > `g_value_get_boolean()` returns `gboolean`, which is actually `int`. Thus\n> > \n> >   // ControlValue x;\n> >   auto val = g_value_get_boolean(...);\n> >   x.set(val);\n> > \n> > will cause `ControlValue::set<int, ...>(const int&)` to be called, which\n> > will save the value as `ControlTypeInteger32`, not `ControlTypeBoolean`.\n> \n> Oops... good catch !\n> \n> > Then, if something tries to retrieve the boolean value, it will run into an\n> > assertion failure:\n> > \n> >   Assertion `type_ == details::control_type<std::remove_cv_t<T>>::value' failed.\n> > \n> > in `ControlValue::set()`.\n> > \n> > Fix this by using the appropriately typed `Control<>` object when setting\n> > the value in the `ControlList` as this ensures that the value will be\n> > converted to the actual type of the control.\n> > \n> > Bug: https://bugs.libcamera.org/show_bug.cgi?id=261\n> > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> > ---\n> > There is a simpler fix to this issue as well:\n> > \n> >       diff --git a/src/gstreamer/gstlibcamera-controls.cpp.in b/src/gstreamer/gstlibcamera-controls.cpp.in\n> >       index d937b19e6..8378b5fd0 100644\n> >       --- a/src/gstreamer/gstlibcamera-controls.cpp.in\n> >       +++ b/src/gstreamer/gstlibcamera-controls.cpp.in\n> >       @@ -271,7 +271,7 @@ bool GstCameraControls::setProperty(guint propId, const GValue *value,\n> >                       }\n> >                       Rectangle val = value_get_rectangle(value);\n> >       {%- else %}\n> >       -               auto val = g_value_get_{{ ctrl.gtype }}(value);\n> >       +               {{ ctrl.element_type }} val = g_value_get_{{ ctrl.gtype }}(value);\n> \n> I knew auto was bad :-D\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nIs this reviewing the simple fix, or the fix below?\n\nIf there's a simpler fix - what's the rationale for the longer fix\nbelow?\n\n\nI don't mind which one is merged, they both have lots of templating\nmagic which makes this hard to review, but fixing the bug is nice ;-)\n\nFor which ever of these approaches is desired/appropriate:\n\nAcked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n--\nKieran\n\n> \n> You fixed the bug even before I had a chance to look at the bug report.\n> Kudos !\n> \n> >       {%- endif %}\n> >                       control.set(val);\n> >       {%- endif %}\n> > \n> > ---\n> >  src/gstreamer/gstlibcamera-controls.cpp.in | 13 ++++---------\n> >  1 file changed, 4 insertions(+), 9 deletions(-)\n> > \n> > diff --git a/src/gstreamer/gstlibcamera-controls.cpp.in b/src/gstreamer/gstlibcamera-controls.cpp.in\n> > index d937b19e6..89c530da0 100644\n> > --- a/src/gstreamer/gstlibcamera-controls.cpp.in\n> > +++ b/src/gstreamer/gstlibcamera-controls.cpp.in\n> > @@ -223,7 +223,6 @@ bool GstCameraControls::setProperty(guint propId, const GValue *value,\n> >  {%- for ctrl in ctrls %}\n> > \n> >       case controls::{{ ctrl.namespace }}{{ ctrl.name|snake_case|upper }}: {\n> > -             ControlValue control;\n> >  {%- if ctrl.is_array %}\n> >               size_t size = gst_value_array_get_size(value);\n> >  {%- if ctrl.size != 0 %}\n> > @@ -254,12 +253,9 @@ bool GstCameraControls::setProperty(guint propId, const GValue *value,\n> >               }\n> > \n> >  {%- if ctrl.size == 0 %}\n> > -             control.set(Span<const {{ ctrl.element_type }}>(values.data(),\n> > -                                                             size));\n> > +             Span<const {{ ctrl.element_type }}> val(values.data(), size);\n> >  {%- else %}\n> > -             control.set(Span<const {{ ctrl.element_type }},\n> > -                              {{ ctrl.size }}>(values.data(),\n> > -                                               {{ ctrl.size }}));\n> > +             Span<const {{ ctrl.element_type }}, {{ ctrl.size }}> val(values.data(), size);\n> >  {%- endif %}\n> >  {%- else %}\n> >  {%- if ctrl.is_rectangle %}\n> > @@ -273,10 +269,9 @@ bool GstCameraControls::setProperty(guint propId, const GValue *value,\n> >  {%- else %}\n> >               auto val = g_value_get_{{ ctrl.gtype }}(value);\n> >  {%- endif %}\n> > -             control.set(val);\n> >  {%- endif %}\n> > -             controls_.set(propId, control);\n> > -             controls_acc_.set(propId, control);\n> > +             controls_.set(controls::{{ ctrl.namespace }}{{ ctrl.name }}, val);\n> > +             controls_acc_.set(controls::{{ ctrl.namespace }}{{ ctrl.name }}, val);\n> >               return true;\n> >       }\n> >  {%- endfor %}\n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","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 DD3ADC3213\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  1 Apr 2025 16:57:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 461E96894F;\n\tTue,  1 Apr 2025 18:57:30 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 169FB68947\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  1 Apr 2025 18:57:28 +0200 (CEST)","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 946476F9;\n\tTue,  1 Apr 2025 18:55:35 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"FXcJUjxj\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1743526535;\n\tbh=j4Vh9l6LsUv+uXTjBnep/dno0J50gAqS0HWJrG+Q6f8=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=FXcJUjxj5f0sqnDB71LgbyEcgkn0nVyY5nZPA44tPCFsFq95W5J/Pup+ReTDGI0pE\n\teFt9xZot92RQtXZ2AmUSILIbBG4dYz7s91+kjaoAci/QWcd4OyUNVITF9ThwNakvNE\n\tGOrBxT88K6aZUUSqebUiE0WSOjTnyBXXzeVo9q88=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250328173349.GB23459@pendragon.ideasonboard.com>","References":"<20250328160736.94529-1-barnabas.pocze@ideasonboard.com>\n\t<20250328173349.GB23459@pendragon.ideasonboard.com>","Subject":"Re: [PATCH v1] gstreamer: Use `Control<>` objects when setting\n\tcontrols","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Tue, 01 Apr 2025 17:57:24 +0100","Message-ID":"<174352664478.494853.9985076452697531805@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":33860,"web_url":"https://patchwork.libcamera.org/comment/33860/","msgid":"<20250401182507.GC3494@pendragon.ideasonboard.com>","date":"2025-04-01T18:25:07","subject":"Re: [PATCH v1] gstreamer: Use `Control<>` objects when setting\n\tcontrols","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Tue, Apr 01, 2025 at 05:57:24PM +0100, Kieran Bingham wrote:\n> Quoting Laurent Pinchart (2025-03-28 17:33:49)\n> > Hi Barnabás,\n> > \n> > Thank you for the patch.\n> > \n> > On Fri, Mar 28, 2025 at 05:07:36PM +0100, Barnabás Pőcze wrote:\n> > > `g_value_get_boolean()` returns `gboolean`, which is actually `int`. Thus\n> > > \n> > >   // ControlValue x;\n> > >   auto val = g_value_get_boolean(...);\n> > >   x.set(val);\n> > > \n> > > will cause `ControlValue::set<int, ...>(const int&)` to be called, which\n> > > will save the value as `ControlTypeInteger32`, not `ControlTypeBoolean`.\n> > \n> > Oops... good catch !\n> > \n> > > Then, if something tries to retrieve the boolean value, it will run into an\n> > > assertion failure:\n> > > \n> > >   Assertion `type_ == details::control_type<std::remove_cv_t<T>>::value' failed.\n> > > \n> > > in `ControlValue::set()`.\n> > > \n> > > Fix this by using the appropriately typed `Control<>` object when setting\n> > > the value in the `ControlList` as this ensures that the value will be\n> > > converted to the actual type of the control.\n> > > \n> > > Bug: https://bugs.libcamera.org/show_bug.cgi?id=261\n> > > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> > > ---\n> > > There is a simpler fix to this issue as well:\n> > > \n> > >       diff --git a/src/gstreamer/gstlibcamera-controls.cpp.in b/src/gstreamer/gstlibcamera-controls.cpp.in\n> > >       index d937b19e6..8378b5fd0 100644\n> > >       --- a/src/gstreamer/gstlibcamera-controls.cpp.in\n> > >       +++ b/src/gstreamer/gstlibcamera-controls.cpp.in\n> > >       @@ -271,7 +271,7 @@ bool GstCameraControls::setProperty(guint propId, const GValue *value,\n> > >                       }\n> > >                       Rectangle val = value_get_rectangle(value);\n> > >       {%- else %}\n> > >       -               auto val = g_value_get_{{ ctrl.gtype }}(value);\n> > >       +               {{ ctrl.element_type }} val = g_value_get_{{ ctrl.gtype }}(value);\n> > \n> > I knew auto was bad :-D\n> > \n> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> Is this reviewing the simple fix, or the fix below?\n> \n> If there's a simpler fix - what's the rationale for the longer fix\n> below?\n\nThe fix below, I should have been more explicit.\n\n> I don't mind which one is merged, they both have lots of templating\n> magic which makes this hard to review, but fixing the bug is nice ;-)\n> \n> For which ever of these approaches is desired/appropriate:\n> \n> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> > You fixed the bug even before I had a chance to look at the bug report.\n> > Kudos !\n> > \n> > >       {%- endif %}\n> > >                       control.set(val);\n> > >       {%- endif %}\n> > > \n> > > ---\n> > >  src/gstreamer/gstlibcamera-controls.cpp.in | 13 ++++---------\n> > >  1 file changed, 4 insertions(+), 9 deletions(-)\n> > > \n> > > diff --git a/src/gstreamer/gstlibcamera-controls.cpp.in b/src/gstreamer/gstlibcamera-controls.cpp.in\n> > > index d937b19e6..89c530da0 100644\n> > > --- a/src/gstreamer/gstlibcamera-controls.cpp.in\n> > > +++ b/src/gstreamer/gstlibcamera-controls.cpp.in\n> > > @@ -223,7 +223,6 @@ bool GstCameraControls::setProperty(guint propId, const GValue *value,\n> > >  {%- for ctrl in ctrls %}\n> > > \n> > >       case controls::{{ ctrl.namespace }}{{ ctrl.name|snake_case|upper }}: {\n> > > -             ControlValue control;\n> > >  {%- if ctrl.is_array %}\n> > >               size_t size = gst_value_array_get_size(value);\n> > >  {%- if ctrl.size != 0 %}\n> > > @@ -254,12 +253,9 @@ bool GstCameraControls::setProperty(guint propId, const GValue *value,\n> > >               }\n> > > \n> > >  {%- if ctrl.size == 0 %}\n> > > -             control.set(Span<const {{ ctrl.element_type }}>(values.data(),\n> > > -                                                             size));\n> > > +             Span<const {{ ctrl.element_type }}> val(values.data(), size);\n> > >  {%- else %}\n> > > -             control.set(Span<const {{ ctrl.element_type }},\n> > > -                              {{ ctrl.size }}>(values.data(),\n> > > -                                               {{ ctrl.size }}));\n> > > +             Span<const {{ ctrl.element_type }}, {{ ctrl.size }}> val(values.data(), size);\n> > >  {%- endif %}\n> > >  {%- else %}\n> > >  {%- if ctrl.is_rectangle %}\n> > > @@ -273,10 +269,9 @@ bool GstCameraControls::setProperty(guint propId, const GValue *value,\n> > >  {%- else %}\n> > >               auto val = g_value_get_{{ ctrl.gtype }}(value);\n> > >  {%- endif %}\n> > > -             control.set(val);\n> > >  {%- endif %}\n> > > -             controls_.set(propId, control);\n> > > -             controls_acc_.set(propId, control);\n> > > +             controls_.set(controls::{{ ctrl.namespace }}{{ ctrl.name }}, val);\n> > > +             controls_acc_.set(controls::{{ ctrl.namespace }}{{ ctrl.name }}, val);\n> > >               return true;\n> > >       }\n> > >  {%- endfor %}","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 2611EC3213\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  1 Apr 2025 18:25:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A256B68985;\n\tTue,  1 Apr 2025 20:25:33 +0200 (CEST)","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 554A768947\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  1 Apr 2025 20:25:32 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E25316F9;\n\tTue,  1 Apr 2025 20:23:39 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"v1UJWurB\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1743531820;\n\tbh=VcO0L9ncOHykyuEotj7/7VBekM41s4/ptAS9KcPqyAI=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=v1UJWurBH5hU5AoAIqpySMEUJgGn4HExjPshiAy3uTEmirQEWh8edLfVYwtbZUnyO\n\tyIG5WeAIdeovpRGSaNOmWxNLO4AdoEvP4CODDg5AmyhyGFAh86UHjA6yqis3lL5JUj\n\t0pjKHmm05Om5K3lpog3qlPBGXOjAjGj6abUQrLgM=","Date":"Tue, 1 Apr 2025 21:25:07 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v1] gstreamer: Use `Control<>` objects when setting\n\tcontrols","Message-ID":"<20250401182507.GC3494@pendragon.ideasonboard.com>","References":"<20250328160736.94529-1-barnabas.pocze@ideasonboard.com>\n\t<20250328173349.GB23459@pendragon.ideasonboard.com>\n\t<174352664478.494853.9985076452697531805@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<174352664478.494853.9985076452697531805@ping.linuxembedded.co.uk>","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>"}}]