[{"id":27099,"web_url":"https://patchwork.libcamera.org/comment/27099/","msgid":"<168419218803.4131343.9139670079498224361@Monstersaurus>","date":"2023-05-15T23:09:48","subject":"Re: [libcamera-devel] [RFC PATCH v3 2/2] libcamera: Remove\n\t`StreamRoles` alias","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 via libcamera-devel (2023-05-10 00:15:43)\n> Now that `Camera::generateConfiguration()` takes a `libcamera::Span`\n> of `StreamRole`, remove the `StreamRoles` type, which was an alias\n> to `std::vector<libcamera::StreamRole>`.\n> \n> The removal has two reasons:\n>  - it is no longer strictly necessary,\n>  - its presence may suggest that that is the preferred (or correct)\n>    way to build/pass a list of `StreamRole`.\n> \n> Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n> ---\n>  include/libcamera/stream.h             | 2 --\n>  src/apps/cam/camera_session.cpp        | 2 +-\n>  src/apps/common/stream_options.cpp     | 4 ++--\n>  src/apps/common/stream_options.h       | 2 +-\n>  src/apps/qcam/main_window.cpp          | 2 +-\n>  src/gstreamer/gstlibcameraprovider.cpp | 5 +++--\n>  src/gstreamer/gstlibcamerasrc.cpp      | 2 +-\n>  src/libcamera/stream.cpp               | 5 -----\n>  8 files changed, 9 insertions(+), 15 deletions(-)\n> \n> diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\n> index 29235ddf..4e94187d 100644\n> --- a/include/libcamera/stream.h\n> +++ b/include/libcamera/stream.h\n> @@ -69,8 +69,6 @@ enum class StreamRole {\n>         Viewfinder,\n>  };\n>  \n> -using StreamRoles = std::vector<StreamRole>;\n> -\n\nI was curious how we might handle this moving forwards if we need to\nremove things. (I think removing this is the right thing to do, so this\nis just 'how' we remove it)\n\nI wonder if we should have an include/libcamera/deprecated.h to place\nthings like:\n\nusing StreamRoles [[deprecated(\"Use a span, array or vector directly\")]]\n        = std::vector<StreamRole>;\n\nPerhaps even with a reference to something that makes it clearer what to\ndo to migrate with the issue.\n\nStreamRoles has been in all the examples so far, so I think all apps\nthat use libcamera are probably already using this.\n\nI know we explicitly don't have ABI/API stability - but if we break\nthings perhaps it would be helpful to have a system that lets us inform\nthe user what they need to do next to fix it again.\n\nThis probably gets quite relevant to how we handle things with:\nhttps://patchwork.libcamera.org/project/libcamera/list/?series=3877 so\nany thoughts on that series are welcome!\n\n\n>  std::ostream &operator<<(std::ostream &out, StreamRole role);\n>  \n>  class Stream\n> diff --git a/src/apps/cam/camera_session.cpp b/src/apps/cam/camera_session.cpp\n> index 8fcec630..066e397b 100644\n> --- a/src/apps/cam/camera_session.cpp\n> +++ b/src/apps/cam/camera_session.cpp\n> @@ -55,7 +55,7 @@ CameraSession::CameraSession(CameraManager *cm,\n>                 return;\n>         }\n>  \n> -       StreamRoles roles = StreamKeyValueParser::roles(options_[OptStream]);\n> +       std::vector<StreamRole> roles = StreamKeyValueParser::roles(options_[OptStream]);\n>  \n>         std::unique_ptr<CameraConfiguration> config =\n>                 camera_->generateConfiguration(roles);\n> diff --git a/src/apps/common/stream_options.cpp b/src/apps/common/stream_options.cpp\n> index 19dfe051..663b979a 100644\n> --- a/src/apps/common/stream_options.cpp\n> +++ b/src/apps/common/stream_options.cpp\n> @@ -40,7 +40,7 @@ KeyValueParser::Options StreamKeyValueParser::parse(const char *arguments)\n>         return options;\n>  }\n>  \n> -StreamRoles StreamKeyValueParser::roles(const OptionValue &values)\n> +std::vector<StreamRole> StreamKeyValueParser::roles(const OptionValue &values)\n>  {\n>         /* If no configuration values to examine default to viewfinder. */\n>         if (values.empty())\n> @@ -48,7 +48,7 @@ StreamRoles StreamKeyValueParser::roles(const OptionValue &values)\n>  \n>         const std::vector<OptionValue> &streamParameters = values.toArray();\n>  \n> -       StreamRoles roles;\n> +       std::vector<StreamRole> roles;\n>         for (auto const &value : streamParameters) {\n>                 /* If a role is invalid default it to viewfinder. */\n>                 roles.push_back(parseRole(value.toKeyValues()).value_or(StreamRole::Viewfinder));\n> diff --git a/src/apps/common/stream_options.h b/src/apps/common/stream_options.h\n> index fe298c84..a5f3bde0 100644\n> --- a/src/apps/common/stream_options.h\n> +++ b/src/apps/common/stream_options.h\n> @@ -20,7 +20,7 @@ public:\n>  \n>         KeyValueParser::Options parse(const char *arguments) override;\n>  \n> -       static libcamera::StreamRoles roles(const OptionValue &values);\n> +       static std::vector<libcamera::StreamRole> roles(const OptionValue &values);\n>         static int updateConfiguration(libcamera::CameraConfiguration *config,\n>                                        const OptionValue &values);\n>  \n> diff --git a/src/apps/qcam/main_window.cpp b/src/apps/qcam/main_window.cpp\n> index 680668df..0f16c038 100644\n> --- a/src/apps/qcam/main_window.cpp\n> +++ b/src/apps/qcam/main_window.cpp\n> @@ -362,7 +362,7 @@ void MainWindow::toggleCapture(bool start)\n>   */\n>  int MainWindow::startCapture()\n>  {\n> -       StreamRoles roles = StreamKeyValueParser::roles(options_[OptStream]);\n> +       std::vector<StreamRole> roles = StreamKeyValueParser::roles(options_[OptStream]);\n>         int ret;\n>  \n>         /* Verify roles are supported. */\n> diff --git a/src/gstreamer/gstlibcameraprovider.cpp b/src/gstreamer/gstlibcameraprovider.cpp\n> index 6eb0a0eb..494f778b 100644\n> --- a/src/gstreamer/gstlibcameraprovider.cpp\n> +++ b/src/gstreamer/gstlibcameraprovider.cpp\n> @@ -6,6 +6,8 @@\n>   * gstlibcameraprovider.c - GStreamer Device Provider\n>   */\n>  \n> +#include <array>\n> +\n>  #include \"gstlibcameraprovider.h\"\n>  \n>  #include <libcamera/camera.h>\n> @@ -126,11 +128,10 @@ gst_libcamera_device_class_init(GstLibcameraDeviceClass *klass)\n>  static GstDevice *\n>  gst_libcamera_device_new(const std::shared_ptr<Camera> &camera)\n>  {\n> +       static const std::array roles { StreamRole::VideoRecording };\n>         g_autoptr(GstCaps) caps = gst_caps_new_empty();\n>         const gchar *name = camera->id().c_str();\n> -       StreamRoles roles;\n>  \n> -       roles.push_back(StreamRole::VideoRecording);\n>         std::unique_ptr<CameraConfiguration> config = camera->generateConfiguration(roles);\n>         if (!config || config->size() != roles.size()) {\n>                 GST_ERROR(\"Failed to generate a default configuration for %s\", name);\n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> index a10cbd4f..46a5400e 100644\n> --- a/src/gstreamer/gstlibcamerasrc.cpp\n> +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> @@ -468,7 +468,7 @@ gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread,\n>         GST_DEBUG_OBJECT(self, \"Streaming thread has started\");\n>  \n>         gint stream_id_num = 0;\n> -       StreamRoles roles;\n> +       std::vector<StreamRole> roles;\n>         for (GstPad *srcpad : state->srcpads_) {\n>                 /* Create stream-id and push stream-start. */\n>                 g_autofree gchar *stream_id_intermediate = g_strdup_printf(\"%i%i\", state->group_id_, stream_id_num++);\n> diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\n> index 67f30815..272222b7 100644\n> --- a/src/libcamera/stream.cpp\n> +++ b/src/libcamera/stream.cpp\n> @@ -436,11 +436,6 @@ std::ostream &operator<<(std::ostream &out, StreamRole role)\n>         return out;\n>  }\n>  \n> -/**\n> - * \\typedef StreamRoles\n> - * \\brief A vector of StreamRole\n> - */\n> -\n>  /**\n>   * \\class Stream\n>   * \\brief Video stream for a camera\n> -- \n> 2.40.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 F10EFBDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 15 May 2023 23:09:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 39CCD627DE;\n\tTue, 16 May 2023 01:09:53 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9985460493\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 May 2023 01:09:51 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 839148D;\n\tTue, 16 May 2023 01:09:40 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1684192193;\n\tbh=7RUrZtxECKV6BHuwRqzXhhAvRpGBtiQsp1Bgek0Wjug=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=X0q7PPfVB++Xd72OBMzyRl89HshG2mP8EWtsKLs6BidMDhfUyYVkmwYhtrgMEbORv\n\th/azwF129cSAYfFEe3AIzECNFswge4D6WO0KcK1LJ3sWrM1RevsH2eu2QqEr2Gcps6\n\tBxl4zxMmLYgGoGbJaWOcvuOAkmOwWXJeAOjG4xVmAg27sh8xmXu3u52YWLWBpUCZ84\n\t7OHftAcSmpDFOBIsA9CSoazfXul61AHlDM5x+/CE/+mYSCH4RaFk9tsXBuadl/h1cZ\n\t+tm2TXlTKMLFahS5IKLbKB+t9sSMNqOfFRTeXe9V7ekV4iOZPo1gSVfBaJ/24fzrI9\n\tWCDfk0qaLuMbQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1684192180;\n\tbh=7RUrZtxECKV6BHuwRqzXhhAvRpGBtiQsp1Bgek0Wjug=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=m1wA85g/xl5iDK6ttRdxo0WXAm+ZUHclqTKNk/g/RMIjJRRf2JFnFpUxt7A18jLSS\n\tyFoSKoJueoaOIGoMAZGohEPbr53Cicm3BRVCS2TQ0+uglgiBX0Cfhcv51faC1Hzr3v\n\tI60g6DXKZaknHXgsk26mQZittRPumfmSUhJBK7wo="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"m1wA85g/\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20230509231542.1123025-1-pobrn@protonmail.com>","References":"<20230509231542.1123025-1-pobrn@protonmail.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 16 May 2023 00:09:48 +0100","Message-ID":"<168419218803.4131343.9139670079498224361@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [RFC PATCH v3 2/2] libcamera: Remove\n\t`StreamRoles` alias","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27114,"web_url":"https://patchwork.libcamera.org/comment/27114/","msgid":"<Ip8P7KyS6LE0xzpmAiQhNOIZiQ1pEqU4Sx1HJo8rZjBkYOPS4qjowZRX1opmgVH3gaXHfm1xe0IIC7u7aHk4FwGG0ffE6akQ7OXqQr1wbmM=@protonmail.com>","date":"2023-05-18T15:29:10","subject":"Re: [libcamera-devel] [RFC PATCH v3 2/2] libcamera: Remove\n\t`StreamRoles` alias","submitter":{"id":133,"url":"https://patchwork.libcamera.org/api/people/133/","name":"Pőcze Barnabás","email":"pobrn@protonmail.com"},"content":"Hi\n\n\n2023. május 16., kedd 1:09 keltezéssel, Kieran Bingham <kieran.bingham@ideasonboard.com> írta:\n\n> Quoting Barnabás Pőcze via libcamera-devel (2023-05-10 00:15:43)\n> > Now that `Camera::generateConfiguration()` takes a `libcamera::Span`\n> > of `StreamRole`, remove the `StreamRoles` type, which was an alias\n> > to `std::vector<libcamera::StreamRole>`.\n> >\n> > The removal has two reasons:\n> >  - it is no longer strictly necessary,\n> >  - its presence may suggest that that is the preferred (or correct)\n> >    way to build/pass a list of `StreamRole`.\n> >\n> > Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n> > ---\n> >  include/libcamera/stream.h             | 2 --\n> >  src/apps/cam/camera_session.cpp        | 2 +-\n> >  src/apps/common/stream_options.cpp     | 4 ++--\n> >  src/apps/common/stream_options.h       | 2 +-\n> >  src/apps/qcam/main_window.cpp          | 2 +-\n> >  src/gstreamer/gstlibcameraprovider.cpp | 5 +++--\n> >  src/gstreamer/gstlibcamerasrc.cpp      | 2 +-\n> >  src/libcamera/stream.cpp               | 5 -----\n> >  8 files changed, 9 insertions(+), 15 deletions(-)\n> >\n> > diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\n> > index 29235ddf..4e94187d 100644\n> > --- a/include/libcamera/stream.h\n> > +++ b/include/libcamera/stream.h\n> > @@ -69,8 +69,6 @@ enum class StreamRole {\n> >         Viewfinder,\n> >  };\n> >\n> > -using StreamRoles = std::vector<StreamRole>;\n> > -\n> \n> I was curious how we might handle this moving forwards if we need to\n> remove things. (I think removing this is the right thing to do, so this\n> is just 'how' we remove it)\n> \n> I wonder if we should have an include/libcamera/deprecated.h to place\n> things like:\n> \n> using StreamRoles [[deprecated(\"Use a span, array or vector directly\")]]\n>         = std::vector<StreamRole>;\n> \n> Perhaps even with a reference to something that makes it clearer what to\n> do to migrate with the issue.\n> \n> StreamRoles has been in all the examples so far, so I think all apps\n> that use libcamera are probably already using this.\n> \n> I know we explicitly don't have ABI/API stability - but if we break\n> things perhaps it would be helpful to have a system that lets us inform\n> the user what they need to do next to fix it again.\n> \n> This probably gets quite relevant to how we handle things with:\n> https://patchwork.libcamera.org/project/libcamera/list/?series=3877 so\n> any thoughts on that series are welcome!\n\nMaybe it could be kept in the same header file? Otherwise users will still\nencounter a compiler error and have to investigate what happened, no?\n\n\n> [...]\n\n\nRegards,\nBarnabás Pőcze","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 24B8ABDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 18 May 2023 15:29:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9C8ED6285F;\n\tThu, 18 May 2023 17:29:16 +0200 (CEST)","from mail-40131.protonmail.ch (mail-40131.protonmail.ch\n\t[185.70.40.131])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 60568627D4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 18 May 2023 17:29:15 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1684423756;\n\tbh=cXC44smc2JvjSpg8oAY9bbGu2yzfPQgUMGu8A10qPNI=;\n\th=Date:To:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=PAskwieup42Glku87ZGcytMJVaq4a/4xi8rQMfgSzYbikWurOdvVzTk4H2hU+F+Lz\n\tizyUR6GZ1n0+QBT/mmfmpOn1B+Ov2siIHJv43X8rBSX0E3tt6//gcWI3St0Bp26lp5\n\tNLBLvcR0o1BnraFljnDAf3HEuyX8rk9oAUj2+bIU+VipTPrBZ66MBsTbPXwtkjqnzP\n\t2tl5k7xJRkWMJ/5/+5cPqLg1iPmszWxa+HrkLhBlFSGknruX2JWkOrVsg28zVnIb1d\n\tsurMUbRF3Vv4L4SWsX6lnm9hp+X0g4vXCqfO+t8esoVYj324J1kpXUltowHLGzLQcC\n\tQ7Mn3AJCxnc3A==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;\n\ts=protonmail3; t=1684423754; x=1684682954;\n\tbh=UxpC1Kh0r9lHhH4ceQLiV0BAkneI432HKjbaMJJWJ20=;\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;\n\tb=StITewtZUmzhlnbmFy16NpwmnWvwokKduzyA4nNG56gBt9JV8w6QxBO+45GPjytMh\n\tp89/V18XlvsyZS1z0vLOcYNIHydqUJFLTmVRwe3loXmR6d4IlBaRxMJUsZh7RdrRuS\n\tINBdjkBo1HJPZW95A5X1Sf2P2LdEJ1Z5DiRPOVH526C5w152cczBG+epYmlFAR4u1y\n\tvG9vYj+HSo/rHIL3UkTWJznihaCeJ+w7MGGtmcBV8t8AIastIg9qiFs+YRvNQu1CA7\n\th/j1h4vuDfriRb4EujFjsdtFHPePXpnqbIXXHg3FpyUVq4cs1j4WOB3NpmgQAQrORx\n\tfpo3qgog8iXxg=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=protonmail.com\n\theader.i=@protonmail.com\n\theader.b=\"StITewtZ\"; dkim-atps=neutral","Date":"Thu, 18 May 2023 15:29:10 +0000","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<Ip8P7KyS6LE0xzpmAiQhNOIZiQ1pEqU4Sx1HJo8rZjBkYOPS4qjowZRX1opmgVH3gaXHfm1xe0IIC7u7aHk4FwGG0ffE6akQ7OXqQr1wbmM=@protonmail.com>","In-Reply-To":"<168419218803.4131343.9139670079498224361@Monstersaurus>","References":"<20230509231542.1123025-1-pobrn@protonmail.com>\n\t<168419218803.4131343.9139670079498224361@Monstersaurus>","Feedback-ID":"20568564:user:proton","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","Subject":"Re: [libcamera-devel] [RFC PATCH v3 2/2] libcamera: Remove\n\t`StreamRoles` alias","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>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze_via_libcamera-devel?=\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27115,"web_url":"https://patchwork.libcamera.org/comment/27115/","msgid":"<168442640988.2429330.7309604616953797269@Monstersaurus>","date":"2023-05-18T16:13:29","subject":"Re: [libcamera-devel] [RFC PATCH v3 2/2] libcamera: Remove\n\t`StreamRoles` alias","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 (2023-05-18 16:29:10)\n> Hi\n> \n> \n> 2023. május 16., kedd 1:09 keltezéssel, Kieran Bingham <kieran.bingham@ideasonboard.com> írta:\n> \n> > Quoting Barnabás Pőcze via libcamera-devel (2023-05-10 00:15:43)\n> > > Now that `Camera::generateConfiguration()` takes a `libcamera::Span`\n> > > of `StreamRole`, remove the `StreamRoles` type, which was an alias\n> > > to `std::vector<libcamera::StreamRole>`.\n> > >\n> > > The removal has two reasons:\n> > >  - it is no longer strictly necessary,\n> > >  - its presence may suggest that that is the preferred (or correct)\n> > >    way to build/pass a list of `StreamRole`.\n> > >\n> > > Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n> > > ---\n> > >  include/libcamera/stream.h             | 2 --\n> > >  src/apps/cam/camera_session.cpp        | 2 +-\n> > >  src/apps/common/stream_options.cpp     | 4 ++--\n> > >  src/apps/common/stream_options.h       | 2 +-\n> > >  src/apps/qcam/main_window.cpp          | 2 +-\n> > >  src/gstreamer/gstlibcameraprovider.cpp | 5 +++--\n> > >  src/gstreamer/gstlibcamerasrc.cpp      | 2 +-\n> > >  src/libcamera/stream.cpp               | 5 -----\n> > >  8 files changed, 9 insertions(+), 15 deletions(-)\n> > >\n> > > diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\n> > > index 29235ddf..4e94187d 100644\n> > > --- a/include/libcamera/stream.h\n> > > +++ b/include/libcamera/stream.h\n> > > @@ -69,8 +69,6 @@ enum class StreamRole {\n> > >         Viewfinder,\n> > >  };\n> > >\n> > > -using StreamRoles = std::vector<StreamRole>;\n> > > -\n> > \n> > I was curious how we might handle this moving forwards if we need to\n> > remove things. (I think removing this is the right thing to do, so this\n> > is just 'how' we remove it)\n> > \n> > I wonder if we should have an include/libcamera/deprecated.h to place\n> > things like:\n> > \n> > using StreamRoles [[deprecated(\"Use a span, array or vector directly\")]]\n> >         = std::vector<StreamRole>;\n> > \n> > Perhaps even with a reference to something that makes it clearer what to\n> > do to migrate with the issue.\n> > \n> > StreamRoles has been in all the examples so far, so I think all apps\n> > that use libcamera are probably already using this.\n> > \n> > I know we explicitly don't have ABI/API stability - but if we break\n> > things perhaps it would be helpful to have a system that lets us inform\n> > the user what they need to do next to fix it again.\n> > \n> > This probably gets quite relevant to how we handle things with:\n> > https://patchwork.libcamera.org/project/libcamera/list/?series=3877 so\n> > any thoughts on that series are welcome!\n> \n> Maybe it could be kept in the same header file? Otherwise users will still\n> encounter a compiler error and have to investigate what happened, no?\n\nIf we go down the 'deprecated' route then I would have a new\ndeprecated.h which is included by the main libcamera.h header so the\ndefinitions would be available to applications without them changing -\nexcept they would now get the deprecated warning (or error).\n\nBut by moving it - it would be easier to locate to remove old\ndeprecations at each release point.\n\n Developer makes breaking change\n  - Warning/update moved to deprecated.h to inform applciations\n\n Release n+1 made with that in deprecated.h\n\n .... more commits .... / time ....\n\n change removed from deprecated.h\n\n Release n+2 made. No longer carried in deprecated.h\n\n\n--\nKieran\n\n\n\n> \n> \n> > [...]\n> \n> \n> Regards,\n> Barnabás Pőcze","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 DBC68C3284\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 18 May 2023 16:13:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4B3ED627D4;\n\tThu, 18 May 2023 18:13:34 +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 C6643627D4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 18 May 2023 18:13:32 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E04046D6;\n\tThu, 18 May 2023 18:13:19 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1684426414;\n\tbh=qqFe7r2MsibopQt0Iq+ulK36CJklTb1N6T+tN9MZ870=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=NSmToYfrAESO67cSOCbU64qyy0nvMgtZaqQGmrUzG6gWYgZl7YyS4MXBEyiwbnKYT\n\tQ8e1PrgdCzpLM7Mhitw7xSaNxO65dtAfnimIraA1rwI9YtZvOaamDaIqXC5yABqT99\n\t7tGxCCQaplBha8Wn/wtAn1h6CZqldDpwnApiZoy+XF9LJmSP8y8ZpWbaghSDcpNzzP\n\thFYkTt12rMnHpTIu4nVBxhgu55pzRZedPt7caUWK/Kw2vZvd3tcrlhDFMptukjPK4q\n\t7Hwfl0cXDdYvxDudm88Tl6EwLdkTPqBra3LlhvWCc8N9Uh4syYKFHqMyvb3xqHd4Ry\n\tHAE8aRpMkTN5w==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1684426400;\n\tbh=qqFe7r2MsibopQt0Iq+ulK36CJklTb1N6T+tN9MZ870=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=v3/X5gSEKAzdIUyF7f4bQMbK2K3BT69RBIVCTlEcbU+64fmcOqQ/YGta/Z3iV7AI1\n\t1tAV5b1RGWJVHUwSBPqlI9yTsARKB8qVC00TfteMpXN0LFYKljPSPKdoMM+tGv7Qhu\n\tW5RmOfdQKVyAQr0+D07NElYe6PsnTrns0/LQ1TfU="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"v3/X5gSE\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<Ip8P7KyS6LE0xzpmAiQhNOIZiQ1pEqU4Sx1HJo8rZjBkYOPS4qjowZRX1opmgVH3gaXHfm1xe0IIC7u7aHk4FwGG0ffE6akQ7OXqQr1wbmM=@protonmail.com>","References":"<20230509231542.1123025-1-pobrn@protonmail.com>\n\t<168419218803.4131343.9139670079498224361@Monstersaurus>\n\t<Ip8P7KyS6LE0xzpmAiQhNOIZiQ1pEqU4Sx1HJo8rZjBkYOPS4qjowZRX1opmgVH3gaXHfm1xe0IIC7u7aHk4FwGG0ffE6akQ7OXqQr1wbmM=@protonmail.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","Date":"Thu, 18 May 2023 17:13:29 +0100","Message-ID":"<168442640988.2429330.7309604616953797269@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [RFC PATCH v3 2/2] libcamera: Remove\n\t`StreamRoles` alias","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27141,"web_url":"https://patchwork.libcamera.org/comment/27141/","msgid":"<QPdmhja_Rn8Pf9IktMo_fWXJmbjfOF-_eZiqsIXix3Z4odWU0FHHT2aNRfN1JHOCM3s3UulPvCArCZNeit0o70p3yADqrhn9ZLc9uynuUcw=@protonmail.com>","date":"2023-05-25T22:09:37","subject":"Re: [libcamera-devel] [RFC PATCH v3 2/2] libcamera: Remove\n\t`StreamRoles` alias","submitter":{"id":133,"url":"https://patchwork.libcamera.org/api/people/133/","name":"Pőcze Barnabás","email":"pobrn@protonmail.com"},"content":"Hi\n\n\n2023. május 18., csütörtök 18:13 keltezéssel, Kieran Bingham <kieran.bingham@ideasonboard.com> írta:\n\n> Quoting Barnabás Pőcze (2023-05-18 16:29:10)\n> > Hi\n> >\n> >\n> > 2023. május 16., kedd 1:09 keltezéssel, Kieran Bingham <kieran.bingham@ideasonboard.com> írta:\n> >\n> > > Quoting Barnabás Pőcze via libcamera-devel (2023-05-10 00:15:43)\n> > > > Now that `Camera::generateConfiguration()` takes a `libcamera::Span`\n> > > > of `StreamRole`, remove the `StreamRoles` type, which was an alias\n> > > > to `std::vector<libcamera::StreamRole>`.\n> > > >\n> > > > The removal has two reasons:\n> > > >  - it is no longer strictly necessary,\n> > > >  - its presence may suggest that that is the preferred (or correct)\n> > > >    way to build/pass a list of `StreamRole`.\n> > > >\n> > > > Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n> > > > ---\n> > > >  include/libcamera/stream.h             | 2 --\n> > > >  src/apps/cam/camera_session.cpp        | 2 +-\n> > > >  src/apps/common/stream_options.cpp     | 4 ++--\n> > > >  src/apps/common/stream_options.h       | 2 +-\n> > > >  src/apps/qcam/main_window.cpp          | 2 +-\n> > > >  src/gstreamer/gstlibcameraprovider.cpp | 5 +++--\n> > > >  src/gstreamer/gstlibcamerasrc.cpp      | 2 +-\n> > > >  src/libcamera/stream.cpp               | 5 -----\n> > > >  8 files changed, 9 insertions(+), 15 deletions(-)\n> > > >\n> > > > diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\n> > > > index 29235ddf..4e94187d 100644\n> > > > --- a/include/libcamera/stream.h\n> > > > +++ b/include/libcamera/stream.h\n> > > > @@ -69,8 +69,6 @@ enum class StreamRole {\n> > > >         Viewfinder,\n> > > >  };\n> > > >\n> > > > -using StreamRoles = std::vector<StreamRole>;\n> > > > -\n> > >\n> > > I was curious how we might handle this moving forwards if we need to\n> > > remove things. (I think removing this is the right thing to do, so this\n> > > is just 'how' we remove it)\n> > >\n> > > I wonder if we should have an include/libcamera/deprecated.h to place\n> > > things like:\n> > >\n> > > using StreamRoles [[deprecated(\"Use a span, array or vector directly\")]]\n> > >         = std::vector<StreamRole>;\n> > >\n> > > Perhaps even with a reference to something that makes it clearer what to\n> > > do to migrate with the issue.\n> > >\n> > > StreamRoles has been in all the examples so far, so I think all apps\n> > > that use libcamera are probably already using this.\n> > >\n> > > I know we explicitly don't have ABI/API stability - but if we break\n> > > things perhaps it would be helpful to have a system that lets us inform\n> > > the user what they need to do next to fix it again.\n> > >\n> > > This probably gets quite relevant to how we handle things with:\n> > > https://patchwork.libcamera.org/project/libcamera/list/?series=3877 so\n> > > any thoughts on that series are welcome!\n> >\n> > Maybe it could be kept in the same header file? Otherwise users will still\n> > encounter a compiler error and have to investigate what happened, no?\n> \n> If we go down the 'deprecated' route then I would have a new\n> deprecated.h which is included by the main libcamera.h header so the\n> definitions would be available to applications without them changing -\n> except they would now get the deprecated warning (or error).\n\nIn that case wouldn't you have to force applications to (only?) include\nlibcamera/libcamera.h like gtk, glib, libdbus, etc. do it?\n\n\n> \n> But by moving it - it would be easier to locate to remove old\n> deprecations at each release point.\n\nFair point, although in my mind `git grep` is pretty close to handling that.\n\n\n> \n>  Developer makes breaking change\n>   - Warning/update moved to deprecated.h to inform applciations\n> \n>  Release n+1 made with that in deprecated.h\n> \n>  .... more commits .... / time ....\n> \n>  change removed from deprecated.h\n> \n>  Release n+2 made. No longer carried in deprecated.h\n> \n> \n> --\n> Kieran\n> \n\n\nRegards,\nBarnabás Pőcze","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 AA159C3284\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 25 May 2023 22:09:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E99FE626FA;\n\tFri, 26 May 2023 00:09:55 +0200 (CEST)","from mail-40134.protonmail.ch (mail-40134.protonmail.ch\n\t[185.70.40.134])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AB9256039D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 May 2023 00:09:53 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1685052596;\n\tbh=D9Je38iG7+midnkhrOwpK0KddBY7f8vxslQeFp+FYDc=;\n\th=Date:To:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=Z50nk71v5jci6py5qhzUUYafiucTiy5po63YgKULltZ+hW8PX1MV3y9PdvEIymIP8\n\tqTOd+SFO/BNKI0KAj8vp611KyU5ApKZPtr2qkkBwJwLEUhPnR/S4zXVLGsUJhlFsQW\n\theHMazS9tteZRRstLan2u+H4WWPyVVoejrZHqi4Yjjrq7O2pajhqBHzKlUjJQdZrAS\n\t/Qd5YEvNFPO18g2ARFe/DMT/8WfQ+2fORXiCV1K77SZsIsQ95hh/GKlxxcNhN4c+Ax\n\tw5sQ2DQnZmGGaXChjBoIC9FfhnQOPfVnO7ItsyQsoJj2vMuKrrK/E1ZP2eh67lbeSm\n\tq4nL+wyapA3EQ==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;\n\ts=protonmail3; t=1685052592; x=1685311792;\n\tbh=dzf+1DWt2TLjCtmAF87x6BmUuRLM4x+prXOXEIJFAvM=;\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;\n\tb=oVByoC5GvWQ5bA1mDdKPlyJ50X00jY2RXl0ZnEqOhYLSDTxoLxm5dWEvMof30BXjG\n\tiObZvTz0Fym64pmTo/Ih+965pH+DzoFYqUEMV5VAN7zge1FI2HZZh3iOKtFl1+5y4h\n\t1aCOgzmVhpvSe8mT9msPDhl8ztM5byqLIDvVZoOwLNtUUqEx712XykHcejuvH1hzy3\n\tDANEAEtKKTxH5g2hHTjdzwFJ/33ofAw7m0oIlbdaLiHhJQ9vW+kRp5RTG1snSxpfAY\n\tw/gzn9FBx8Ln/CdP7dcFm0J0qnDfLV4kBKgBSRr+5UzF66PrbdZKA2bsG5IFx/uPD/\n\tXPGbdwLri+ltw=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=protonmail.com\n\theader.i=@protonmail.com\n\theader.b=\"oVByoC5G\"; dkim-atps=neutral","Date":"Thu, 25 May 2023 22:09:37 +0000","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<QPdmhja_Rn8Pf9IktMo_fWXJmbjfOF-_eZiqsIXix3Z4odWU0FHHT2aNRfN1JHOCM3s3UulPvCArCZNeit0o70p3yADqrhn9ZLc9uynuUcw=@protonmail.com>","In-Reply-To":"<168442640988.2429330.7309604616953797269@Monstersaurus>","References":"<20230509231542.1123025-1-pobrn@protonmail.com>\n\t<168419218803.4131343.9139670079498224361@Monstersaurus>\n\t<Ip8P7KyS6LE0xzpmAiQhNOIZiQ1pEqU4Sx1HJo8rZjBkYOPS4qjowZRX1opmgVH3gaXHfm1xe0IIC7u7aHk4FwGG0ffE6akQ7OXqQr1wbmM=@protonmail.com>\n\t<168442640988.2429330.7309604616953797269@Monstersaurus>","Feedback-ID":"20568564:user:proton","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","Subject":"Re: [libcamera-devel] [RFC PATCH v3 2/2] libcamera: Remove\n\t`StreamRoles` alias","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>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze_via_libcamera-devel?=\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27142,"web_url":"https://patchwork.libcamera.org/comment/27142/","msgid":"<168505333981.130277.10898414396806751678@Monstersaurus>","date":"2023-05-25T22:22:19","subject":"Re: [libcamera-devel] [RFC PATCH v3 2/2] libcamera: Remove\n\t`StreamRoles` alias","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 (2023-05-25 23:09:37)\n> Hi\n> \n> \n> 2023. május 18., csütörtök 18:13 keltezéssel, Kieran Bingham <kieran.bingham@ideasonboard.com> írta:\n> \n> > Quoting Barnabás Pőcze (2023-05-18 16:29:10)\n> > > Hi\n> > >\n> > >\n> > > 2023. május 16., kedd 1:09 keltezéssel, Kieran Bingham <kieran.bingham@ideasonboard.com> írta:\n> > >\n> > > > Quoting Barnabás Pőcze via libcamera-devel (2023-05-10 00:15:43)\n> > > > > Now that `Camera::generateConfiguration()` takes a `libcamera::Span`\n> > > > > of `StreamRole`, remove the `StreamRoles` type, which was an alias\n> > > > > to `std::vector<libcamera::StreamRole>`.\n> > > > >\n> > > > > The removal has two reasons:\n> > > > >  - it is no longer strictly necessary,\n> > > > >  - its presence may suggest that that is the preferred (or correct)\n> > > > >    way to build/pass a list of `StreamRole`.\n> > > > >\n> > > > > Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n> > > > > ---\n> > > > >  include/libcamera/stream.h             | 2 --\n> > > > >  src/apps/cam/camera_session.cpp        | 2 +-\n> > > > >  src/apps/common/stream_options.cpp     | 4 ++--\n> > > > >  src/apps/common/stream_options.h       | 2 +-\n> > > > >  src/apps/qcam/main_window.cpp          | 2 +-\n> > > > >  src/gstreamer/gstlibcameraprovider.cpp | 5 +++--\n> > > > >  src/gstreamer/gstlibcamerasrc.cpp      | 2 +-\n> > > > >  src/libcamera/stream.cpp               | 5 -----\n> > > > >  8 files changed, 9 insertions(+), 15 deletions(-)\n> > > > >\n> > > > > diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\n> > > > > index 29235ddf..4e94187d 100644\n> > > > > --- a/include/libcamera/stream.h\n> > > > > +++ b/include/libcamera/stream.h\n> > > > > @@ -69,8 +69,6 @@ enum class StreamRole {\n> > > > >         Viewfinder,\n> > > > >  };\n> > > > >\n> > > > > -using StreamRoles = std::vector<StreamRole>;\n> > > > > -\n> > > >\n> > > > I was curious how we might handle this moving forwards if we need to\n> > > > remove things. (I think removing this is the right thing to do, so this\n> > > > is just 'how' we remove it)\n> > > >\n> > > > I wonder if we should have an include/libcamera/deprecated.h to place\n> > > > things like:\n> > > >\n> > > > using StreamRoles [[deprecated(\"Use a span, array or vector directly\")]]\n> > > >         = std::vector<StreamRole>;\n> > > >\n> > > > Perhaps even with a reference to something that makes it clearer what to\n> > > > do to migrate with the issue.\n> > > >\n> > > > StreamRoles has been in all the examples so far, so I think all apps\n> > > > that use libcamera are probably already using this.\n> > > >\n> > > > I know we explicitly don't have ABI/API stability - but if we break\n> > > > things perhaps it would be helpful to have a system that lets us inform\n> > > > the user what they need to do next to fix it again.\n> > > >\n> > > > This probably gets quite relevant to how we handle things with:\n> > > > https://patchwork.libcamera.org/project/libcamera/list/?series=3877 so\n> > > > any thoughts on that series are welcome!\n> > >\n> > > Maybe it could be kept in the same header file? Otherwise users will still\n> > > encounter a compiler error and have to investigate what happened, no?\n> > \n> > If we go down the 'deprecated' route then I would have a new\n> > deprecated.h which is included by the main libcamera.h header so the\n> > definitions would be available to applications without them changing -\n> > except they would now get the deprecated warning (or error).\n> \n> In that case wouldn't you have to force applications to (only?) include\n> libcamera/libcamera.h like gtk, glib, libdbus, etc. do it?\n\nI thought libcamera/libcamera.h would be the preferred choice for\napplications. But if they choose to include files directly, then indeed\nthey would miss out on any 'deprecated.h' and get compile breakage on an\nABI/API change. But that's no different there than without it (the\ndeprecation helpers) though! It just means they won't have the extra\nlevel of support ..\n\nSo no, I don't think we would have to 'force' applications to only use\nit. They 'can' use it ... or they might not.\n\n> > But by moving it - it would be easier to locate to remove old\n> > deprecations at each release point.\n> \n> Fair point, although in my mind `git grep` is pretty close to handling that.\n\nMaybe indeed. Just means looking in multiple places to clean up before a\nrelease rather than taking the previous section from a single file. I\ndon't think any of this would be 'high churn' anyway so I don't think\nit's a big deal either way.\n\n\n\n> >  Developer makes breaking change\n> >   - Warning/update moved to deprecated.h to inform applciations\n> > \n> >  Release n+1 made with that in deprecated.h\n> > \n> >  .... more commits .... / time ....\n> > \n> >  change removed from deprecated.h\n> > \n> >  Release n+2 made. No longer carried in deprecated.h\n> > \n> > \n> > --\n> > Kieran\n> > \n> \n> \n> Regards,\n> Barnabás Pőcze","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 5F3F1C31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 25 May 2023 22:22:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BD797626FA;\n\tFri, 26 May 2023 00:22:24 +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 CE5866039D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 May 2023 00:22:22 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 185E6BC1;\n\tFri, 26 May 2023 00:22:05 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1685053344;\n\tbh=xOop1o5Pg61dH45YY0yq3sjgmu4HITwPkd2s6a62mjg=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=a0ny/YY/T1kUeDCcHAuy2QmdDK9HjmhiFBO9QtwIzbHgNWNHqh9VNwZ/jkjHxGh7c\n\typFr6ocIWZ4+tuwOio5wvImo4lPR4W77GyLiyaGNFnzXBe5rPa1QOcmY/WQPhzQBog\n\tlYc6X0j2jgvQ4e0j5z0zcRKVh5Dz9GuBMP2rKnqEEmlkCYi9c8OoyoKu8KHn+iLR2v\n\t6ekZNmtWB17AR46CSTehZ/A2+GMVLJwnww9E0H0zOVGlX6E6WiISAGN6gDtv8zYJgv\n\tCksMu6G0+e+96yOzGZUdVok5em/+brltNraXZMvQSUh4hVMs2HIjFo/nQOGNuKqu1d\n\t95rsDm0k7E2WQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1685053325;\n\tbh=xOop1o5Pg61dH45YY0yq3sjgmu4HITwPkd2s6a62mjg=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=VVLp8D0bYnDqSep96gpDr0Aj2YgPSFmosM+Dtl/PXZTZKKWLg6zwwVjEm9JyGPtyb\n\tc0dEg1F9uqbOdsOLRWfZLI8ZIQPgtUqeQ9WeGTAC6YdGLouJoN794aThPUkuJHPp5I\n\t/+59YMnX/Oy1rV4vRQr0ZocGXLXoWSVcjL09XQ+g="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"VVLp8D0b\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<QPdmhja_Rn8Pf9IktMo_fWXJmbjfOF-_eZiqsIXix3Z4odWU0FHHT2aNRfN1JHOCM3s3UulPvCArCZNeit0o70p3yADqrhn9ZLc9uynuUcw=@protonmail.com>","References":"<20230509231542.1123025-1-pobrn@protonmail.com>\n\t<168419218803.4131343.9139670079498224361@Monstersaurus>\n\t<Ip8P7KyS6LE0xzpmAiQhNOIZiQ1pEqU4Sx1HJo8rZjBkYOPS4qjowZRX1opmgVH3gaXHfm1xe0IIC7u7aHk4FwGG0ffE6akQ7OXqQr1wbmM=@protonmail.com>\n\t<168442640988.2429330.7309604616953797269@Monstersaurus>\n\t<QPdmhja_Rn8Pf9IktMo_fWXJmbjfOF-_eZiqsIXix3Z4odWU0FHHT2aNRfN1JHOCM3s3UulPvCArCZNeit0o70p3yADqrhn9ZLc9uynuUcw=@protonmail.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","Date":"Thu, 25 May 2023 23:22:19 +0100","Message-ID":"<168505333981.130277.10898414396806751678@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [RFC PATCH v3 2/2] libcamera: Remove\n\t`StreamRoles` alias","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27186,"web_url":"https://patchwork.libcamera.org/comment/27186/","msgid":"<20230530173349.GG22516@pendragon.ideasonboard.com>","date":"2023-05-30T17:33:49","subject":"Re: [libcamera-devel] [RFC PATCH v3 2/2] libcamera: Remove\n\t`StreamRoles` alias","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 Tue, May 09, 2023 at 11:15:43PM +0000, Barnabás Pőcze via libcamera-devel wrote:\n> Now that `Camera::generateConfiguration()` takes a `libcamera::Span`\n> of `StreamRole`, remove the `StreamRoles` type, which was an alias\n> to `std::vector<libcamera::StreamRole>`.\n> \n> The removal has two reasons:\n>  - it is no longer strictly necessary,\n>  - its presence may suggest that that is the preferred (or correct)\n>    way to build/pass a list of `StreamRole`.\n> \n> Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  include/libcamera/stream.h             | 2 --\n>  src/apps/cam/camera_session.cpp        | 2 +-\n>  src/apps/common/stream_options.cpp     | 4 ++--\n>  src/apps/common/stream_options.h       | 2 +-\n>  src/apps/qcam/main_window.cpp          | 2 +-\n>  src/gstreamer/gstlibcameraprovider.cpp | 5 +++--\n>  src/gstreamer/gstlibcamerasrc.cpp      | 2 +-\n>  src/libcamera/stream.cpp               | 5 -----\n>  8 files changed, 9 insertions(+), 15 deletions(-)\n> \n> diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\n> index 29235ddf..4e94187d 100644\n> --- a/include/libcamera/stream.h\n> +++ b/include/libcamera/stream.h\n> @@ -69,8 +69,6 @@ enum class StreamRole {\n>  \tViewfinder,\n>  };\n>  \n> -using StreamRoles = std::vector<StreamRole>;\n> -\n>  std::ostream &operator<<(std::ostream &out, StreamRole role);\n>  \n>  class Stream\n> diff --git a/src/apps/cam/camera_session.cpp b/src/apps/cam/camera_session.cpp\n> index 8fcec630..066e397b 100644\n> --- a/src/apps/cam/camera_session.cpp\n> +++ b/src/apps/cam/camera_session.cpp\n> @@ -55,7 +55,7 @@ CameraSession::CameraSession(CameraManager *cm,\n>  \t\treturn;\n>  \t}\n>  \n> -\tStreamRoles roles = StreamKeyValueParser::roles(options_[OptStream]);\n> +\tstd::vector<StreamRole> roles = StreamKeyValueParser::roles(options_[OptStream]);\n>  \n>  \tstd::unique_ptr<CameraConfiguration> config =\n>  \t\tcamera_->generateConfiguration(roles);\n> diff --git a/src/apps/common/stream_options.cpp b/src/apps/common/stream_options.cpp\n> index 19dfe051..663b979a 100644\n> --- a/src/apps/common/stream_options.cpp\n> +++ b/src/apps/common/stream_options.cpp\n> @@ -40,7 +40,7 @@ KeyValueParser::Options StreamKeyValueParser::parse(const char *arguments)\n>  \treturn options;\n>  }\n>  \n> -StreamRoles StreamKeyValueParser::roles(const OptionValue &values)\n> +std::vector<StreamRole> StreamKeyValueParser::roles(const OptionValue &values)\n>  {\n>  \t/* If no configuration values to examine default to viewfinder. */\n>  \tif (values.empty())\n> @@ -48,7 +48,7 @@ StreamRoles StreamKeyValueParser::roles(const OptionValue &values)\n>  \n>  \tconst std::vector<OptionValue> &streamParameters = values.toArray();\n>  \n> -\tStreamRoles roles;\n> +\tstd::vector<StreamRole> roles;\n>  \tfor (auto const &value : streamParameters) {\n>  \t\t/* If a role is invalid default it to viewfinder. */\n>  \t\troles.push_back(parseRole(value.toKeyValues()).value_or(StreamRole::Viewfinder));\n> diff --git a/src/apps/common/stream_options.h b/src/apps/common/stream_options.h\n> index fe298c84..a5f3bde0 100644\n> --- a/src/apps/common/stream_options.h\n> +++ b/src/apps/common/stream_options.h\n> @@ -20,7 +20,7 @@ public:\n>  \n>  \tKeyValueParser::Options parse(const char *arguments) override;\n>  \n> -\tstatic libcamera::StreamRoles roles(const OptionValue &values);\n> +\tstatic std::vector<libcamera::StreamRole> roles(const OptionValue &values);\n>  \tstatic int updateConfiguration(libcamera::CameraConfiguration *config,\n>  \t\t\t\t       const OptionValue &values);\n>  \n> diff --git a/src/apps/qcam/main_window.cpp b/src/apps/qcam/main_window.cpp\n> index 680668df..0f16c038 100644\n> --- a/src/apps/qcam/main_window.cpp\n> +++ b/src/apps/qcam/main_window.cpp\n> @@ -362,7 +362,7 @@ void MainWindow::toggleCapture(bool start)\n>   */\n>  int MainWindow::startCapture()\n>  {\n> -\tStreamRoles roles = StreamKeyValueParser::roles(options_[OptStream]);\n> +\tstd::vector<StreamRole> roles = StreamKeyValueParser::roles(options_[OptStream]);\n>  \tint ret;\n>  \n>  \t/* Verify roles are supported. */\n> diff --git a/src/gstreamer/gstlibcameraprovider.cpp b/src/gstreamer/gstlibcameraprovider.cpp\n> index 6eb0a0eb..494f778b 100644\n> --- a/src/gstreamer/gstlibcameraprovider.cpp\n> +++ b/src/gstreamer/gstlibcameraprovider.cpp\n> @@ -6,6 +6,8 @@\n>   * gstlibcameraprovider.c - GStreamer Device Provider\n>   */\n>  \n> +#include <array>\n> +\n>  #include \"gstlibcameraprovider.h\"\n>  \n>  #include <libcamera/camera.h>\n> @@ -126,11 +128,10 @@ gst_libcamera_device_class_init(GstLibcameraDeviceClass *klass)\n>  static GstDevice *\n>  gst_libcamera_device_new(const std::shared_ptr<Camera> &camera)\n>  {\n> +\tstatic const std::array roles { StreamRole::VideoRecording };\n>  \tg_autoptr(GstCaps) caps = gst_caps_new_empty();\n>  \tconst gchar *name = camera->id().c_str();\n> -\tStreamRoles roles;\n>  \n> -\troles.push_back(StreamRole::VideoRecording);\n>  \tstd::unique_ptr<CameraConfiguration> config = camera->generateConfiguration(roles);\n>  \tif (!config || config->size() != roles.size()) {\n>  \t\tGST_ERROR(\"Failed to generate a default configuration for %s\", name);\n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> index a10cbd4f..46a5400e 100644\n> --- a/src/gstreamer/gstlibcamerasrc.cpp\n> +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> @@ -468,7 +468,7 @@ gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread,\n>  \tGST_DEBUG_OBJECT(self, \"Streaming thread has started\");\n>  \n>  \tgint stream_id_num = 0;\n> -\tStreamRoles roles;\n> +\tstd::vector<StreamRole> roles;\n>  \tfor (GstPad *srcpad : state->srcpads_) {\n>  \t\t/* Create stream-id and push stream-start. */\n>  \t\tg_autofree gchar *stream_id_intermediate = g_strdup_printf(\"%i%i\", state->group_id_, stream_id_num++);\n> diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\n> index 67f30815..272222b7 100644\n> --- a/src/libcamera/stream.cpp\n> +++ b/src/libcamera/stream.cpp\n> @@ -436,11 +436,6 @@ std::ostream &operator<<(std::ostream &out, StreamRole role)\n>  \treturn out;\n>  }\n>  \n> -/**\n> - * \\typedef StreamRoles\n> - * \\brief A vector of StreamRole\n> - */\n> -\n>  /**\n>   * \\class Stream\n>   * \\brief Video stream for a camera","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 CD634C3213\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 May 2023 17:33:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 38A8F626F8;\n\tTue, 30 May 2023 19:33:51 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 665A360595\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 May 2023 19:33:49 +0200 (CEST)","from pendragon.ideasonboard.com (om126205198071.34.openmobile.ne.jp\n\t[126.205.198.71])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B2FBC4A9;\n\tTue, 30 May 2023 19:33:27 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1685468031;\n\tbh=i2SmGLdxSc049IQvmunsIDZNP4fxUzM3eIYMG4AWJcA=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=UiJdYiOTz/BT4BhDdDEXj7QZj8haFOY/zPo8anjyZCTAFvEc4lAmtNZ4wLNcwsRCl\n\tyvRdWFjJl+jWICTI8IJ1DYOauoX/bdaToav4l5pHGsvEGhitfOlGAqReO5K4Du3yt1\n\tDG56KHg5C2YbZ46zrXU6Dc5R1tDrQrj2eRwuGIVn+cxoK5Vd27saUr8SE3jzmUgVyN\n\tfIcZCiaBHQb6KWAQB2gt2XabyMBK+aKybQ8ZkN6C+L1rMQ0THYHqw/e3pfpc9EQKk+\n\ttwpja9yn1mz5vAYxAv4JB0y1kBDpN7OVs0MdT+iGuFcfwMhea2E4G2akRtZUACi+oB\n\to0thMzrKdbLqQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1685468008;\n\tbh=i2SmGLdxSc049IQvmunsIDZNP4fxUzM3eIYMG4AWJcA=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=etjmTgOfi5B8IKfnuR5nVfacBbY39yWcrKpyQreT4yTcS8xYgsN6CGbE/14glb7b3\n\thor7b9G2EF9okDW+xEBlRnQzNT8+7mJcya/IdmS/0y0CjtD07B684CEAfLjVn8PTuN\n\tI2OQtJPM5JtzCU2wrpii3IZNDLz0paZDnYSmZRMs="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"etjmTgOf\"; dkim-atps=neutral","Date":"Tue, 30 May 2023 20:33:49 +0300","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","Message-ID":"<20230530173349.GG22516@pendragon.ideasonboard.com>","References":"<20230509231542.1123025-1-pobrn@protonmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20230509231542.1123025-1-pobrn@protonmail.com>","Subject":"Re: [libcamera-devel] [RFC PATCH v3 2/2] libcamera: Remove\n\t`StreamRoles` alias","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27473,"web_url":"https://patchwork.libcamera.org/comment/27473/","msgid":"<168850681987.3298873.16223009027598588411@Monstersaurus>","date":"2023-07-04T21:40:19","subject":"Re: [libcamera-devel] [RFC PATCH v3 2/2] libcamera: Remove\n\t`StreamRoles` alias","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 via libcamera-devel (2023-05-10 00:15:43)\n> Now that `Camera::generateConfiguration()` takes a `libcamera::Span`\n> of `StreamRole`, remove the `StreamRoles` type, which was an alias\n> to `std::vector<libcamera::StreamRole>`.\n> \n> The removal has two reasons:\n>  - it is no longer strictly necessary,\n>  - its presence may suggest that that is the preferred (or correct)\n>    way to build/pass a list of `StreamRole`.\n> \n\nIt seems my idea for a deprecated.h wasn't deemed necessary and I don't\nwant to block this patch, which is fine on it's own anyway.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\n\n> Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n> ---\n>  include/libcamera/stream.h             | 2 --\n>  src/apps/cam/camera_session.cpp        | 2 +-\n>  src/apps/common/stream_options.cpp     | 4 ++--\n>  src/apps/common/stream_options.h       | 2 +-\n>  src/apps/qcam/main_window.cpp          | 2 +-\n>  src/gstreamer/gstlibcameraprovider.cpp | 5 +++--\n>  src/gstreamer/gstlibcamerasrc.cpp      | 2 +-\n>  src/libcamera/stream.cpp               | 5 -----\n>  8 files changed, 9 insertions(+), 15 deletions(-)\n> \n> diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\n> index 29235ddf..4e94187d 100644\n> --- a/include/libcamera/stream.h\n> +++ b/include/libcamera/stream.h\n> @@ -69,8 +69,6 @@ enum class StreamRole {\n>         Viewfinder,\n>  };\n>  \n> -using StreamRoles = std::vector<StreamRole>;\n> -\n>  std::ostream &operator<<(std::ostream &out, StreamRole role);\n>  \n>  class Stream\n> diff --git a/src/apps/cam/camera_session.cpp b/src/apps/cam/camera_session.cpp\n> index 8fcec630..066e397b 100644\n> --- a/src/apps/cam/camera_session.cpp\n> +++ b/src/apps/cam/camera_session.cpp\n> @@ -55,7 +55,7 @@ CameraSession::CameraSession(CameraManager *cm,\n>                 return;\n>         }\n>  \n> -       StreamRoles roles = StreamKeyValueParser::roles(options_[OptStream]);\n> +       std::vector<StreamRole> roles = StreamKeyValueParser::roles(options_[OptStream]);\n>  \n>         std::unique_ptr<CameraConfiguration> config =\n>                 camera_->generateConfiguration(roles);\n> diff --git a/src/apps/common/stream_options.cpp b/src/apps/common/stream_options.cpp\n> index 19dfe051..663b979a 100644\n> --- a/src/apps/common/stream_options.cpp\n> +++ b/src/apps/common/stream_options.cpp\n> @@ -40,7 +40,7 @@ KeyValueParser::Options StreamKeyValueParser::parse(const char *arguments)\n>         return options;\n>  }\n>  \n> -StreamRoles StreamKeyValueParser::roles(const OptionValue &values)\n> +std::vector<StreamRole> StreamKeyValueParser::roles(const OptionValue &values)\n>  {\n>         /* If no configuration values to examine default to viewfinder. */\n>         if (values.empty())\n> @@ -48,7 +48,7 @@ StreamRoles StreamKeyValueParser::roles(const OptionValue &values)\n>  \n>         const std::vector<OptionValue> &streamParameters = values.toArray();\n>  \n> -       StreamRoles roles;\n> +       std::vector<StreamRole> roles;\n>         for (auto const &value : streamParameters) {\n>                 /* If a role is invalid default it to viewfinder. */\n>                 roles.push_back(parseRole(value.toKeyValues()).value_or(StreamRole::Viewfinder));\n> diff --git a/src/apps/common/stream_options.h b/src/apps/common/stream_options.h\n> index fe298c84..a5f3bde0 100644\n> --- a/src/apps/common/stream_options.h\n> +++ b/src/apps/common/stream_options.h\n> @@ -20,7 +20,7 @@ public:\n>  \n>         KeyValueParser::Options parse(const char *arguments) override;\n>  \n> -       static libcamera::StreamRoles roles(const OptionValue &values);\n> +       static std::vector<libcamera::StreamRole> roles(const OptionValue &values);\n>         static int updateConfiguration(libcamera::CameraConfiguration *config,\n>                                        const OptionValue &values);\n>  \n> diff --git a/src/apps/qcam/main_window.cpp b/src/apps/qcam/main_window.cpp\n> index 680668df..0f16c038 100644\n> --- a/src/apps/qcam/main_window.cpp\n> +++ b/src/apps/qcam/main_window.cpp\n> @@ -362,7 +362,7 @@ void MainWindow::toggleCapture(bool start)\n>   */\n>  int MainWindow::startCapture()\n>  {\n> -       StreamRoles roles = StreamKeyValueParser::roles(options_[OptStream]);\n> +       std::vector<StreamRole> roles = StreamKeyValueParser::roles(options_[OptStream]);\n>         int ret;\n>  \n>         /* Verify roles are supported. */\n> diff --git a/src/gstreamer/gstlibcameraprovider.cpp b/src/gstreamer/gstlibcameraprovider.cpp\n> index 6eb0a0eb..494f778b 100644\n> --- a/src/gstreamer/gstlibcameraprovider.cpp\n> +++ b/src/gstreamer/gstlibcameraprovider.cpp\n> @@ -6,6 +6,8 @@\n>   * gstlibcameraprovider.c - GStreamer Device Provider\n>   */\n>  \n> +#include <array>\n> +\n>  #include \"gstlibcameraprovider.h\"\n>  \n>  #include <libcamera/camera.h>\n> @@ -126,11 +128,10 @@ gst_libcamera_device_class_init(GstLibcameraDeviceClass *klass)\n>  static GstDevice *\n>  gst_libcamera_device_new(const std::shared_ptr<Camera> &camera)\n>  {\n> +       static const std::array roles { StreamRole::VideoRecording };\n>         g_autoptr(GstCaps) caps = gst_caps_new_empty();\n>         const gchar *name = camera->id().c_str();\n> -       StreamRoles roles;\n>  \n> -       roles.push_back(StreamRole::VideoRecording);\n>         std::unique_ptr<CameraConfiguration> config = camera->generateConfiguration(roles);\n>         if (!config || config->size() != roles.size()) {\n>                 GST_ERROR(\"Failed to generate a default configuration for %s\", name);\n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> index a10cbd4f..46a5400e 100644\n> --- a/src/gstreamer/gstlibcamerasrc.cpp\n> +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> @@ -468,7 +468,7 @@ gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread,\n>         GST_DEBUG_OBJECT(self, \"Streaming thread has started\");\n>  \n>         gint stream_id_num = 0;\n> -       StreamRoles roles;\n> +       std::vector<StreamRole> roles;\n>         for (GstPad *srcpad : state->srcpads_) {\n>                 /* Create stream-id and push stream-start. */\n>                 g_autofree gchar *stream_id_intermediate = g_strdup_printf(\"%i%i\", state->group_id_, stream_id_num++);\n> diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\n> index 67f30815..272222b7 100644\n> --- a/src/libcamera/stream.cpp\n> +++ b/src/libcamera/stream.cpp\n> @@ -436,11 +436,6 @@ std::ostream &operator<<(std::ostream &out, StreamRole role)\n>         return out;\n>  }\n>  \n> -/**\n> - * \\typedef StreamRoles\n> - * \\brief A vector of StreamRole\n> - */\n> -\n>  /**\n>   * \\class Stream\n>   * \\brief Video stream for a camera\n> -- \n> 2.40.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 50955BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  4 Jul 2023 21:40:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 96C36628C0;\n\tTue,  4 Jul 2023 23:40:24 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 26F3D60384\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  4 Jul 2023 23:40:23 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9F14E8C1;\n\tTue,  4 Jul 2023 23:39:38 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1688506824;\n\tbh=6QVmc9quzJn4ZP4iqoCHCjlxmfdoxMEZKWZ+myHn5ps=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=SflHOGN350Nyjc/TQagUE43bwow/cpKo2MQOXVc1uVWPx/UyXX02uklKPuV03+8//\n\tm9HmdaFvwK/p0rG7Ii/TeYfPqScUuxsY6eMxu5DRIRAfwzl6+clQXp8rJAmifx4WTd\n\t507BgUXZouVG15nTz397lxouRuJDclCPJ8mGBW95rl0VhP4eVGzTgxt5BdxVW9VAcA\n\tLjtnaVwI3f0COu20EQyZIrykL8YMUKJmsnkaHA9UprxBwygFGzbrGpq4ActjvohZFa\n\t3qRBMYmL9Bmj40Mc+f32BnHUf8rEEPLzcKjFio79O5x1/WXFSYHwSsG9rMmdZiDPfo\n\trolIuqhWqKrOA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1688506778;\n\tbh=6QVmc9quzJn4ZP4iqoCHCjlxmfdoxMEZKWZ+myHn5ps=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=VIMt9kR6YCRDbFcFHWy8nkYvDIc3K5W64QIf3IVl+iinEbnGSpVxU4BVlYolQMej0\n\tStCsSz9XYFFIXp4U47SE15qMBwddidHOeZQIahhHkUK+gQH4sNSfyJ9qmbm0lajK7C\n\tmaIQ+sMZM6T1K3b7g7FudUtBoGvUigYON8s1vbLs="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"VIMt9kR6\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20230509231542.1123025-1-pobrn@protonmail.com>","References":"<20230509231542.1123025-1-pobrn@protonmail.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 04 Jul 2023 22:40:19 +0100","Message-ID":"<168850681987.3298873.16223009027598588411@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [RFC PATCH v3 2/2] libcamera: Remove\n\t`StreamRoles` alias","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]