[{"id":1808,"web_url":"https://patchwork.libcamera.org/comment/1808/","msgid":"<20190610065245.GB4806@pendragon.ideasonboard.com>","date":"2019-06-10T06:52:45","subject":"Re: [libcamera-devel] [PATCH 12/17] libcamera: stream:\n\tStreamConfiguration: Add StreamFormats information","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nThank you for the patch.\n\nOn Mon, May 27, 2019 at 02:15:38AM +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   | 19 +++++++++++++++++++\n>  2 files changed, 23 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 a2931902fda2baa5..4452b6ff010cfbdf 100644\n> --- a/src/libcamera/stream.cpp\n> +++ b/src/libcamera/stream.cpp\n> @@ -260,6 +260,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> +}\n> +\n> +/**\n> + * \\brief Create with stream format description\n\n\"Construct a configuration with stream formats\" ?\n\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> @@ -300,6 +313,12 @@ SizeRange StreamFormats::range(unsigned int pixelformat) const\n>   * \\param[in] stream The stream\n>   */\n>  \n> +/**\n> + * \\fn StreamConfiguration::formats()\n> + * \\brief Retrieve the advisory stream formats description\n> + * \\return A stream formats description\n\nWe'll have to expand this a bit I think.\n\n> + */\n> +\n>  /**\n>   * \\brief Assemble and return a string describing the configuration\n>   *","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5E5FB63766\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 10 Jun 2019 08:53:09 +0200 (CEST)","from pendragon.ideasonboard.com (85-76-134-17-nat.elisa-mobile.fi\n\t[85.76.134.17])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D404E569;\n\tMon, 10 Jun 2019 08:53:07 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1560149589;\n\tbh=MLGsETGeISbDt0YB+HEOBwFq6Tgu2/UmaeQpNdSKkTI=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Os4LM+w3GmypSIb/yYsLsR5kYscGLARgp1+fWa5xezlGyQZXQOiYyM1Mghy/79/Jf\n\tGf7yOR7jEgQcMZJNIynCYcl4tVghUsqVsd1crihG0OzK1qGWUmppipf/KgHIqy1Pgq\n\t/3qwuOqygqDGWAOkPwrwMcMuBQxxQM+OSjshpUwY=","Date":"Mon, 10 Jun 2019 09:52:45 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190610065245.GB4806@pendragon.ideasonboard.com>","References":"<20190527001543.13593-1-niklas.soderlund@ragnatech.se>\n\t<20190527001543.13593-13-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190527001543.13593-13-niklas.soderlund@ragnatech.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 12/17] 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":"Mon, 10 Jun 2019 06:53:09 -0000"}}]