[{"id":707,"web_url":"https://patchwork.libcamera.org/comment/707/","msgid":"<20190130225818.GB5358@pendragon.ideasonboard.com>","date":"2019-01-30T22:58:18","subject":"Re: [libcamera-devel] [PATCH v5 1/6] libcamera: stream: add initial\n\tStream 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 Wed, Jan 30, 2019 at 12:56:10PM +0100, Niklas Söderlund wrote:\n> Add an initial Stream implementation. The idea is that once capability\n> support is added to the library each stream will describe its\n> capabilities using this class. An application will then select one or\n> more streams based on these capabilities and use them to configure the\n> camera and capture.\n> \n> At this stage the Stream class is empty as capabilities are yet to be\n> added. The class is still useful as it will be used to communicate how\n> many streams a Camera object provides.\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  include/libcamera/libcamera.h |  1 +\n>  include/libcamera/meson.build |  1 +\n>  include/libcamera/stream.h    | 18 +++++++++++++\n>  src/libcamera/meson.build     |  1 +\n>  src/libcamera/stream.cpp      | 51 +++++++++++++++++++++++++++++++++++\n>  5 files changed, 72 insertions(+)\n>  create mode 100644 include/libcamera/stream.h\n>  create mode 100644 src/libcamera/stream.cpp\n> \n> diff --git a/include/libcamera/libcamera.h b/include/libcamera/libcamera.h\n> index 6619e556ebbd20e4..8167e8099ac061d2 100644\n> --- a/include/libcamera/libcamera.h\n> +++ b/include/libcamera/libcamera.h\n> @@ -13,6 +13,7 @@\n>  #include <libcamera/event_dispatcher.h>\n>  #include <libcamera/event_notifier.h>\n>  #include <libcamera/signal.h>\n> +#include <libcamera/stream.h>\n>  #include <libcamera/timer.h>\n>  \n>  #endif /* __LIBCAMERA_LIBCAMERA_H__ */\n> diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build\n> index 8fcbbf7892ea9280..8c14423bc444ef51 100644\n> --- a/include/libcamera/meson.build\n> +++ b/include/libcamera/meson.build\n> @@ -6,6 +6,7 @@ libcamera_api = files([\n>      'event_notifier.h',\n>      'libcamera.h',\n>      'signal.h',\n> +    'stream.h',\n>      'timer.h',\n>  ])\n>  \n> diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\n> new file mode 100644\n> index 0000000000000000..4f47d85ed6382b36\n> --- /dev/null\n> +++ b/include/libcamera/stream.h\n> @@ -0,0 +1,18 @@\n> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> +/*\n> + * Copyright (C) 2019, Google Inc.\n> + *\n> + * stream.h - Video stream for a Camera\n> + */\n> +#ifndef __LIBCAMERA_STREAM_H__\n> +#define __LIBCAMERA_STREAM_H__\n> +\n> +namespace libcamera {\n> +\n> +class Stream final\n> +{\n> +};\n> +\n> +} /* namespace libcamera */\n> +\n> +#endif /* __LIBCAMERA_STREAM_H__ */\n> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> index b5b25965fd123350..a4e9cc8f936c47a7 100644\n> --- a/src/libcamera/meson.build\n> +++ b/src/libcamera/meson.build\n> @@ -11,6 +11,7 @@ libcamera_sources = files([\n>      'media_object.cpp',\n>      'pipeline_handler.cpp',\n>      'signal.cpp',\n> +    'stream.cpp',\n>      'timer.cpp',\n>      'v4l2_device.cpp',\n>  ])\n> diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\n> new file mode 100644\n> index 0000000000000000..f82b05a2bcfa14e9\n> --- /dev/null\n> +++ b/src/libcamera/stream.cpp\n> @@ -0,0 +1,51 @@\n> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> +/*\n> + * Copyright (C) 2019, Google Inc.\n> + *\n> + * stream.cpp - Video stream for a Camera\n> + */\n> +\n> +#include <libcamera/stream.h>\n> +\n> +/**\n> + * \\file stream.h\n> + * \\brief Video stream for a Camera\n> + *\n> + * A camera device can provide frames in different resolutions and formats\n> + * concurrently from a single image source. The Stream class represents\n> + * one of the multiple concurrent streams.\n> + *\n> + * All streams exposed by a camera device share the same image source and are\n> + * thus not fully independent. Parameters related to the image source, such as\n> + * the exposure time or flash control, are common to all streams. Other\n> + * parameters, such as format or resolution, may be specified per-stream,\n> + * depending on the capabilities of the camera device.\n> + *\n> + * Camera devices expose at least one stream, and may expose additional streams\n> + * based on the device capabilities. This can be used, for instance, to\n> + * implement concurrent viewfinder and video capture, or concurrent viewfinder,\n> + * video capture and still image capture.\n> + */\n> +\n> +namespace libcamera {\n> +\n> +/**\n> + * \\class Stream\n> + * \\brief Video stream for a camera\n> + *\n> + * The Stream class models of all static information which are associated\n\ns/models of/models/\n\n> + * with a single video stream. Streams are exposed by the Camera object they\n> + * belong to.\n> + *\n> + * Cameras are capable of supplying more then one stream from the same video\n\ns/Cameras are capable of supplying/Cameras may supply/\n\n(as not all cameras are capable of supplying multiple streams)\n\ns/then/than/\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> + * source. In such cases an application can inspect all available streams and\n> + * select the ones that best fit its use case.\n> + *\n> + * \\todo Add capabilities to the stream API. Without this the Stream class only\n> + * serves to reveal how many streams of unknown capabilities a camera supports.\n> + * This in itself is productive as it allows applications to configure and\n> + * capture from one or more streams even if they won't be able to select the\n> + * optimal stream for the task.\n> + */\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 4093960C78\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 30 Jan 2019 23:58:20 +0100 (CET)","from pendragon.ideasonboard.com (85-76-34-136-nat.elisa-mobile.fi\n\t[85.76.34.136])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1F39E41;\n\tWed, 30 Jan 2019 23:58:18 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1548889099;\n\tbh=0J+7+WcIOMzF9dk5adDWekn6LzUmOUx3yTvZT/e20Xw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=lFMfzLV5WpKXUB7ZJiI8Jus4giPHK7VmCTDrWPd/ZrAMXMSd8/albZKZAx6UPFcFk\n\t7V7PPztkkEevPK74JLo/9N4YEaIKI3fh1Gi+NNyaic7GvSkbS8JTbUgEZopDiMqrnE\n\tljbVt6yvcNCAKiVF2jwKS377ID4fAAvpUkaS8gu0=","Date":"Thu, 31 Jan 2019 00:58:18 +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":"<20190130225818.GB5358@pendragon.ideasonboard.com>","References":"<20190130115615.17362-1-niklas.soderlund@ragnatech.se>\n\t<20190130115615.17362-2-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":"<20190130115615.17362-2-niklas.soderlund@ragnatech.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v5 1/6] libcamera: stream: add initial\n\tStream 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":"Wed, 30 Jan 2019 22:58:20 -0000"}}]