Show a patch.

GET /api/patches/335/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 335,
    "url": "https://patchwork.libcamera.org/api/patches/335/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/335/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20190122234505.32634-2-niklas.soderlund@ragnatech.se>",
    "date": "2019-01-22T23:44:58",
    "name": "[libcamera-devel,1/8] 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/people/5/?format=api",
        "name": "Niklas Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/335/mbox/",
    "series": [
        {
            "id": 118,
            "url": "https://patchwork.libcamera.org/api/series/118/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=118",
            "date": "2019-01-22T23:44:57",
            "name": "libcamera: add basic support for Streams and format configuration",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/118/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/335/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/335/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<niklas.soderlund@ragnatech.se>",
        "Received": [
            "from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net\n\t[195.74.38.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C3CE660C7D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Jan 2019 00:46:37 +0100 (CET)",
            "from bismarck.berto.se (unknown [89.233.230.99])\n\tby bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA\n\tid e83a2c68-1e9f-11e9-911a-0050569116f7;\n\tWed, 23 Jan 2019 00:46:15 +0100 (CET)"
        ],
        "X-Halon-ID": "e83a2c68-1e9f-11e9-911a-0050569116f7",
        "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": "Wed, 23 Jan 2019 00:44:58 +0100",
        "Message-Id": "<20190122234505.32634-2-niklas.soderlund@ragnatech.se>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20190122234505.32634-1-niklas.soderlund@ragnatech.se>",
        "References": "<20190122234505.32634-1-niklas.soderlund@ragnatech.se>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 1/8] libcamera: stream: add basic Stream\n\tclass",
        "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": "Tue, 22 Jan 2019 23:46:38 -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",
        "1/8"
    ]
}