[{"id":645,"web_url":"https://patchwork.libcamera.org/comment/645/","msgid":"<20190127223128.GB5154@pendragon.ideasonboard.com>","date":"2019-01-27T22:31:28","subject":"Re: [libcamera-devel] [PATCH v3 2/6] libcamera: stream: add initial\n\tStreamConfiguration class","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 Sun, Jan 27, 2019 at 01:22:04AM +0100, Niklas Söderlund wrote:\n> Add an initial StreamConfiguration implementation to hold configuration\n> data for a single stream of a Camera. In its current form not many\n> configuration parameters are supported but it's expected the number of\n> options will grow over time.\n> \n> At this stage the pixel format is represented as an unsigned int to\n> allow for easy mapping to the V4L2 API. This might be subject to change\n> in the future as we finalize how libcamera shall represent pixel\n> formats.\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> ---\n>  include/libcamera/stream.h | 10 ++++++++++\n>  src/libcamera/stream.cpp   | 31 +++++++++++++++++++++++++++++++\n>  2 files changed, 41 insertions(+)\n> \n> diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\n> index 580f2cc8d3a3ad59..e7597dd5a9492c2a 100644\n> --- a/include/libcamera/stream.h\n> +++ b/include/libcamera/stream.h\n> @@ -20,6 +20,16 @@ private:\n>  \tunsigned int id_;\n>  };\n>  \n> +class StreamConfiguration final\n\nI might have made this a struct as everything is public, and I'm not\nsure if we need to make the class final. What do you think ? We can also\nupdate this later as needed.\n\n> +{\n> +public:\n> +\tStreamConfiguration();\n> +\n> +\tunsigned int width;\n> +\tunsigned int height;\n> +\tunsigned int pixelFormat;\n> +};\n> +\n>  } /* namespace libcamera */\n>  \n>  #endif /* __LIBCAMERA_STREAM_H__ */\n> diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\n> index 307de3710d0ac6b1..530668a478a79c94 100644\n> --- a/src/libcamera/stream.cpp\n> +++ b/src/libcamera/stream.cpp\n> @@ -64,4 +64,35 @@ Stream::Stream(unsigned int id)\n>   * \\return The stream ID\n>   */\n>  \n> +/**\n> + * \\class StreamConfiguration\n> + * \\brief Configuration parameters for a stream\n> + *\n> + * The StreamConfiguration class is a model of all information which can be\n\ns/is a model of/models/\n\n> + * configured for a single video stream.\n> + */\n> +\n> +StreamConfiguration::StreamConfiguration()\n> +\t: width(0), height(0), pixelFormat(0)\n> +{\n> +}\n> +\n> +/**\n> + * \\var StreamConfiguration::width\n> + * \\brief Stream width in pixels\n> + */\n> +\n> +/**\n> + * \\var StreamConfiguration::height\n> + * \\brief Stream height in pixels\n> + */\n> +\n> +/**\n> + * \\var StreamConfiguration::pixelFormat\n> + * \\brief Stream pixel format or type of compression\n\nIs \"type of compression\" not a pixel format ?\n\n> + *\n> + * This is a little endian four character code representation of the pixel\n> + * format described in V4L2 using the V4L2_PIX_FMT_* definitions.\n> + */\n\nI think we'll need more documentation, but that's not a blocker for now.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  } /* namespace libcamera */","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 ADD9660C78\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 27 Jan 2019 23:31:36 +0100 (CET)","from pendragon.ideasonboard.com (85-76-73-155-nat.elisa-mobile.fi\n\t[85.76.73.155])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1F24D85;\n\tSun, 27 Jan 2019 23:31:34 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1548628296;\n\tbh=2WThfEIQB5iLWPykOmuw4RUHt4WsJsNbk35npfPbyUk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=gSMtPN03YE1YivzApLihqPjIMEun/wtrvG+C4IO2pU46M32uAFyb9Rbx4dQYwfHB/\n\tfOQ0vZiONna/+wQbSsZWWTUA7667MZUojKWxL7r00jNH/vP7JTyklBKmT5ZGjupbVU\n\tGeGROrQtv2vQw7/KLS6RBjzIIESEvj3/N8xGxwN4=","Date":"Mon, 28 Jan 2019 00:31:28 +0200","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":"<20190127223128.GB5154@pendragon.ideasonboard.com>","References":"<20190127002208.18913-1-niklas.soderlund@ragnatech.se>\n\t<20190127002208.18913-3-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":"<20190127002208.18913-3-niklas.soderlund@ragnatech.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v3 2/6] libcamera: stream: add initial\n\tStreamConfiguration class","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":"Sun, 27 Jan 2019 22:31:36 -0000"}}]