{"id":380,"url":"https://patchwork.libcamera.org/api/1.1/patches/380/?format=json","web_url":"https://patchwork.libcamera.org/patch/380/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20190125153340.2744-2-niklas.soderlund@ragnatech.se>","date":"2019-01-25T15:33:34","name":"[libcamera-devel,v2,1/7] libcamera: stream: add basic Stream class","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"e827e3a62569b4728ec3f447804baa4c99e20901","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/1.1/people/5/?format=json","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"delegate":{"id":16,"url":"https://patchwork.libcamera.org/api/1.1/users/16/?format=json","username":"neg","first_name":"Niklas","last_name":"Söderlund","email":"niklas.soderlund@ragnatech.se"},"mbox":"https://patchwork.libcamera.org/patch/380/mbox/","series":[{"id":132,"url":"https://patchwork.libcamera.org/api/1.1/series/132/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=132","date":"2019-01-25T15:33:33","name":"libcamera: add basic support for Streams and format configuration","version":2,"mbox":"https://patchwork.libcamera.org/series/132/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/380/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/380/checks/","tags":{},"headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net\n\t[195.74.38.229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B909E60B1B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Jan 2019 16:33:52 +0100 (CET)","from bismarck.berto.se (unknown [89.233.230.99])\n\tby bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA\n\tid 9cda1972-20b6-11e9-874f-005056917f90;\n\tFri, 25 Jan 2019 16:33:50 +0100 (CET)"],"X-Halon-ID":"9cda1972-20b6-11e9-874f-005056917f90","Authorized-sender":"niklas@soderlund.pp.se","From":"=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 25 Jan 2019 16:33:34 +0100","Message-Id":"<20190125153340.2744-2-niklas.soderlund@ragnatech.se>","X-Mailer":"git-send-email 2.20.1","In-Reply-To":"<20190125153340.2744-1-niklas.soderlund@ragnatech.se>","References":"<20190125153340.2744-1-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 1/7] libcamera: stream: add basic\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":"Fri, 25 Jan 2019 15:33:53 -0000"},"content":"Add a extremely simple Stream implementation. The idea is that once\ncapability support is added to the library each stream would describe\nit's capabilities using this class. A application would then select one\nor more streams based on these capabilities and using them to configure\nand capture.\n\nAt this stage all the Stream class provides is a way for a Camera object\nto communicate which stream ID it to operates on. This basically\nlimits the usefulness of the object to cameras which only provides one\nstream per camera.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n include/libcamera/libcamera.h |  1 +\n include/libcamera/meson.build |  1 +\n include/libcamera/stream.h    | 25 +++++++++++++\n src/libcamera/meson.build     |  1 +\n src/libcamera/stream.cpp      | 66 +++++++++++++++++++++++++++++++++++\n 5 files changed, 94 insertions(+)\n create mode 100644 include/libcamera/stream.h\n create mode 100644 src/libcamera/stream.cpp","diff":"diff --git a/include/libcamera/libcamera.h b/include/libcamera/libcamera.h\nindex c0511cf6d662b63f..272dfd5e4a67d5de 100644\n--- a/include/libcamera/libcamera.h\n+++ b/include/libcamera/libcamera.h\n@@ -12,6 +12,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__ */\ndiff --git a/include/libcamera/meson.build b/include/libcamera/meson.build\nindex d7cb55ba4a49e1e8..54a680787e5c17aa 100644\n--- a/include/libcamera/meson.build\n+++ b/include/libcamera/meson.build\n@@ -5,6 +5,7 @@ libcamera_api = files([\n     'event_notifier.h',\n     'libcamera.h',\n     'signal.h',\n+    'stream.h',\n     'timer.h',\n ])\n \ndiff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\nnew file mode 100644\nindex 0000000000000000..415815ba12c65e47\n--- /dev/null\n+++ b/include/libcamera/stream.h\n@@ -0,0 +1,25 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2019, Google Inc.\n+ *\n+ * stream.h - Stream object interface\n+ */\n+#ifndef __LIBCAMERA_STREAM_H__\n+#define __LIBCAMERA_STREAM_H__\n+\n+namespace libcamera {\n+\n+class Stream final\n+{\n+public:\n+\tStream(unsigned int id);\n+\n+\tunsigned int id() const { return id_; };\n+\n+private:\n+\tunsigned int id_;\n+};\n+\n+} /* namespace libcamera */\n+\n+#endif /* __LIBCAMERA_STREAM_H__ */\ndiff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\nindex f9f25c0ecf1564cc..9f6ff99eebe2f5bc 100644\n--- a/src/libcamera/meson.build\n+++ b/src/libcamera/meson.build\n@@ -10,6 +10,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 ])\ndiff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\nnew file mode 100644\nindex 0000000000000000..3b44e834ee02b35a\n--- /dev/null\n+++ b/src/libcamera/stream.cpp\n@@ -0,0 +1,66 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2019, Google Inc.\n+ *\n+ * stream.cpp - Stream information handeling\n+ */\n+\n+#include <libcamera/stream.h>\n+\n+/**\n+ * \\file stream.h\n+ * \\brief Stream information\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 format.\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 Stream information carrier\n+ *\n+ * The Stream class is a model of all static information which are associated\n+ * with a single video stream. A application should acquire Stream objects from\n+ * the camera.\n+ *\n+ * Some cameras are capable of supplying more then one stream from the same\n+ * video source. In such cases a application will receive a array of streams to\n+ * inspect and select from to best fit its use-case.\n+ *\n+ * \\todo Add capabilities to the Stream API. Without this the Stream class\n+ *\t only serves to reveal how many streams of unknown capabilities a camera\n+ *\t supports. This in it self is productive as it allows applications to\n+ *\t configure and capture from one or more streams even if it won't be able\n+ *\t to select the optimal stream for the task.\n+ */\n+\n+/**\n+ * \\brief Create a new stream with a ID\n+ * \\param[in] id Numerical ID which should be unique for the camera device the stream belongs to\n+ */\n+Stream::Stream(unsigned int id)\n+\t: id_(id)\n+{\n+}\n+\n+/**\n+ * \\fn Stream::id()\n+ * \\brief Retrieve the streams ID\n+ * \\return The stream ID\n+ */\n+\n+} /* namespace libcamera */\n","prefixes":["libcamera-devel","v2","1/7"]}