{"id":319,"url":"https://patchwork.libcamera.org/api/patches/319/?format=json","web_url":"https://patchwork.libcamera.org/patch/319/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20190121230640.8783-4-niklas.soderlund@ragnatech.se>","date":"2019-01-21T23:06:39","name":"[libcamera-devel,RFC,3/4] libcamera: streamformat: add basic class for stream formats","commit_ref":null,"pull_url":null,"state":"rejected","archived":false,"hash":"e05b28d30fdcbf051f39a55b6651229f29943a12","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/?format=json","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/319/mbox/","series":[{"id":109,"url":"https://patchwork.libcamera.org/api/series/109/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=109","date":"2019-01-21T23:06:36","name":"libcamera: add base for applications to configure cameras","version":1,"mbox":"https://patchwork.libcamera.org/series/109/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/319/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/319/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 9814860C9D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Jan 2019 00:07:16 +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 4a0eb00f-1dd1-11e9-874f-005056917f90;\n\tTue, 22 Jan 2019 00:07:14 +0100 (CET)"],"X-Halon-ID":"4a0eb00f-1dd1-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":"Tue, 22 Jan 2019 00:06:39 +0100","Message-Id":"<20190121230640.8783-4-niklas.soderlund@ragnatech.se>","X-Mailer":"git-send-email 2.20.1","In-Reply-To":"<20190121230640.8783-1-niklas.soderlund@ragnatech.se>","References":"<20190121230640.8783-1-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [RFC 3/4] libcamera: streamformat: add basic\n\tclass for stream formats","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, 21 Jan 2019 23:07:17 -0000"},"content":"Each stream in a camera object have its own format specification. The\nStreamFormat class holds all this information and should be filled in by\nthe application to configure a 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_format.h | 32 ++++++++++++\n src/libcamera/meson.build         |  1 +\n src/libcamera/stream_format.cpp   | 82 +++++++++++++++++++++++++++++++\n 5 files changed, 117 insertions(+)\n create mode 100644 include/libcamera/stream_format.h\n create mode 100644 src/libcamera/stream_format.cpp","diff":"diff --git a/include/libcamera/libcamera.h b/include/libcamera/libcamera.h\nindex 272dfd5e4a67d5de..7aefdcee51eca69c 100644\n--- a/include/libcamera/libcamera.h\n+++ b/include/libcamera/libcamera.h\n@@ -13,6 +13,7 @@\n #include <libcamera/event_notifier.h>\n #include <libcamera/signal.h>\n #include <libcamera/stream.h>\n+#include <libcamera/stream_format.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 54a680787e5c17aa..ca4e43fe70e42277 100644\n--- a/include/libcamera/meson.build\n+++ b/include/libcamera/meson.build\n@@ -6,6 +6,7 @@ libcamera_api = files([\n     'libcamera.h',\n     'signal.h',\n     'stream.h',\n+    'stream_format.h',\n     'timer.h',\n ])\n \ndiff --git a/include/libcamera/stream_format.h b/include/libcamera/stream_format.h\nnew file mode 100644\nindex 0000000000000000..34d93c1c56284e6a\n--- /dev/null\n+++ b/include/libcamera/stream_format.h\n@@ -0,0 +1,32 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2019, Google Inc.\n+ *\n+ * stream_format.h - Stream format interface\n+ */\n+#ifndef __LIBCAMERA_STREAM_FORMAT_H__\n+#define __LIBCAMERA_STREAM_FORMAT_H__\n+\n+namespace libcamera {\n+\n+class StreamFormat final\n+{\n+public:\n+\tStreamFormat();\n+\n+\tunsigned int width() const { return width_; };\n+\tunsigned int height() const { return height_; };\n+\tunsigned int pixelformat() const { return pixelformat_; };\n+\n+\tvoid setDimension(unsigned int width, unsigned int height);\n+\tvoid setPixelFormat(unsigned int pixelformat);\n+\n+private:\n+\tunsigned int width_;\n+\tunsigned int height_;\n+\tunsigned int pixelformat_;\n+};\n+\n+} /* namespace libcamera */\n+\n+#endif /* __LIBCAMERA_STREAM_FORMAT_H__ */\ndiff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\nindex 9f6ff99eebe2f5bc..819b92a511c3ee09 100644\n--- a/src/libcamera/meson.build\n+++ b/src/libcamera/meson.build\n@@ -11,6 +11,7 @@ libcamera_sources = files([\n     'pipeline_handler.cpp',\n     'signal.cpp',\n     'stream.cpp',\n+    'stream_format.cpp',\n     'timer.cpp',\n     'v4l2_device.cpp',\n ])\ndiff --git a/src/libcamera/stream_format.cpp b/src/libcamera/stream_format.cpp\nnew file mode 100644\nindex 0000000000000000..9171980907b7a840\n--- /dev/null\n+++ b/src/libcamera/stream_format.cpp\n@@ -0,0 +1,82 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2019, Google Inc.\n+ *\n+ * stream_format.cpp - Stream image format settings\n+ */\n+\n+#include <libcamera/stream_format.h>\n+\n+/**\n+ * \\file stream_format.h\n+ * \\brief Stream format specification\n+ *\n+ * A camera device can provide frames in different resolutions and formats\n+ * concurrently from a single image source. The StreamFormat 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+\n+namespace libcamera {\n+\n+/**\n+ * \\class StreamFormat\n+ * \\brief Stream format settings\n+ *\n+ * The StreamFormat class models all parameters which an application can set\n+ * for a individual stream which is part of a camera device.\n+ */\n+\n+/**\n+ * \\brief Create a stream format information carrier\n+ */\n+StreamFormat::StreamFormat()\n+\t: width_(0), height_(0), pixelformat_(0)\n+{\n+}\n+\n+/**\n+ * \\fn StreamFormat::width()\n+ * \\brief Retrieve the Stream width\n+ * \\return The stream width\n+ */\n+\n+/**\n+ * \\fn StreamFormat::height()\n+ * \\brief Retrieve the Stream height\n+ * \\return The stream height\n+ */\n+\n+/**\n+ * \\fn StreamFormat::pixelformat()\n+ * \\brief Retrieve the Stream pixelformat\n+ * \\return The stream pixelformat\n+ */\n+\n+/**\n+ * \\brief Set the width and height of the stream format\n+ * \\param[in] width The desired width of the stream\n+ * \\param[in] height The desired height of the stream\n+ */\n+void StreamFormat::setDimension(unsigned int width, unsigned int height)\n+{\n+\twidth_ = width;\n+\theight_ = height;\n+}\n+\n+/**\n+ * \\brief Set the pixelformat of the stream format\n+ * \\param[in] pixelformat The desired pixelformat of the stream\n+ */\n+void StreamFormat::setPixelFormat(unsigned int pixelformat)\n+{\n+\tpixelformat_ = pixelformat;\n+}\n+\n+\n+} /* namespace libcamera */\n","prefixes":["libcamera-devel","RFC","3/4"]}