[{"id":1894,"web_url":"https://patchwork.libcamera.org/comment/1894/","msgid":"<20190613165847.wqajtgkr32zu6etj@uno.localdomain>","date":"2019-06-13T16:58:47","subject":"Re: [libcamera-devel] [PATCH v2 11/16] libcamera: stream:\n\tStreamConfiguration: Add StreamFormats information","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Niklas,\n\nOn Wed, Jun 12, 2019 at 02:43:54AM +0200, Niklas Söderlund wrote:\n> Allow StreamFormats to be associated to a StreamConfiguration. The\n> intention is that pipeline handlers should associate formats to a\n> StreamConfiguration when it's created in generateConfiguration().\n>\n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> ---\n>  include/libcamera/stream.h |  8 ++++----\n>  src/libcamera/stream.cpp   | 25 +++++++++++++++++++++++++\n>  2 files changed, 29 insertions(+), 4 deletions(-)\n>\n> diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\n> index 48daf5ac23f55d85..5b4fea324ce449b1 100644\n> --- a/include/libcamera/stream.h\n> +++ b/include/libcamera/stream.h\n> @@ -35,10 +35,8 @@ private:\n>  };\n>\n>  struct StreamConfiguration {\n> -\tStreamConfiguration()\n> -\t\t: stream_(nullptr)\n> -\t{\n> -\t}\n> +\tStreamConfiguration();\n> +\tStreamConfiguration(const StreamFormats &formats);\n>\n>  \tunsigned int pixelFormat;\n>  \tSize size;\n> @@ -47,11 +45,13 @@ struct StreamConfiguration {\n>\n>  \tStream *stream() const { return stream_; }\n>  \tvoid setStream(Stream *stream) { stream_ = stream; }\n> +\tconst StreamFormats &formats() const { return formats_; }\n>\n>  \tstd::string toString() const;\n>\n>  private:\n>  \tStream *stream_;\n> +\tStreamFormats formats_;\n>  };\n>\n>  enum StreamRole {\n> diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\n> index 52340c2644aac8d8..254a5e10db24287d 100644\n> --- a/src/libcamera/stream.cpp\n> +++ b/src/libcamera/stream.cpp\n> @@ -268,6 +268,19 @@ SizeRange StreamFormats::range(unsigned int pixelformat) const\n>   * configured for a single video stream.\n>   */\n>\n> +StreamConfiguration::StreamConfiguration()\n> +\t: stream_(nullptr)\n> +{\n\nNo need to \"formats_ = {};\", right?\n> +}\n> +\n> +/**\n> + * \\brief Construct a configuration with stream formats\n> + */\n> +StreamConfiguration::StreamConfiguration(const StreamFormats &formats)\n> +\t: stream_(nullptr), formats_(formats)\n> +{\n> +}\n> +\n>  /**\n>   * \\var StreamConfiguration::size\n>   * \\brief Stream size in pixels\n> @@ -308,6 +321,18 @@ SizeRange StreamFormats::range(unsigned int pixelformat) const\n>   * \\param[in] stream The stream\n>   */\n>\n> +/**\n> + * \\fn StreamConfiguration::formats()\n> + * \\brief Retrieve advisory stream format information\n> + *\n> + * Retrieve information about pixel formats and sizes for possible stream\n> + * configuration. The size information is advisory and not guaranteed to\n> + * be fully satisfied by the hardware, users should always inspect the actual\n\nfully satisfied/supported/\n\n> + * size used by the device after a camera have been configured.\n\nhave been/has been/\ns/used by/applied on/\n\n> + *\n> + * \\return Stream formats information\n> + */\n> +\n\nI'm just not sure about the use of the term 'advisory', to me has a\ndifferent meaning, but as I'm not a native speaker you should not\ntrust me. Kieran ?\n\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n  j\n>  /**\n>   * \\brief Assemble and return a string describing the configuration\n>   *\n> --\n> 2.21.0\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay11.mail.gandi.net (relay11.mail.gandi.net\n\t[217.70.178.231])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 79344638BD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 13 Jun 2019 18:57:38 +0200 (CEST)","from uno.localdomain (2-224-242-101.ip172.fastwebnet.it\n\t[2.224.242.101]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay11.mail.gandi.net (Postfix) with ESMTPSA id 6134510000A;\n\tThu, 13 Jun 2019 16:57:33 +0000 (UTC)"],"Date":"Thu, 13 Jun 2019 18:58:47 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190613165847.wqajtgkr32zu6etj@uno.localdomain>","References":"<20190612004359.15772-1-niklas.soderlund@ragnatech.se>\n\t<20190612004359.15772-12-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"k4lyydr7j4bgfyxb\"","Content-Disposition":"inline","In-Reply-To":"<20190612004359.15772-12-niklas.soderlund@ragnatech.se>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH v2 11/16] libcamera: stream:\n\tStreamConfiguration: Add StreamFormats information","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Thu, 13 Jun 2019 16:57:38 -0000"}}]