Show a patch.

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

{
    "id": 318,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/318/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/318/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/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": "<20190121230640.8783-3-niklas.soderlund@ragnatech.se>",
    "date": "2019-01-21T23:06:38",
    "name": "[libcamera-devel,RFC,2/4] libcamera: stream: add basic stream class",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": false,
    "hash": "b995d8438cac3baaa7fc22578fec1b9097d5f1ea",
    "submitter": {
        "id": 5,
        "url": "https://patchwork.libcamera.org/api/1.1/people/5/?format=api",
        "name": "Niklas Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/318/mbox/",
    "series": [
        {
            "id": 109,
            "url": "https://patchwork.libcamera.org/api/1.1/series/109/?format=api",
            "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/318/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/318/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 AEE1760B2D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Jan 2019 00:07:15 +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 497f7b30-1dd1-11e9-874f-005056917f90;\n\tTue, 22 Jan 2019 00:07:13 +0100 (CET)"
        ],
        "X-Halon-ID": "497f7b30-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:38 +0100",
        "Message-Id": "<20190121230640.8783-3-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 2/4] 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": "Mon, 21 Jan 2019 23:07:15 -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 there numerical ID\nconfigure and capture those streams.\n\nAt this stage all the Stream class provides is a way for a Camera object\nto communicate which stream IDs it's able to operate 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      | 58 +++++++++++++++++++++++++++++++++++\n 5 files changed, 86 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..8386c68e33fe57d0\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() { 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..db47c24760b360b4\n--- /dev/null\n+++ b/src/libcamera/stream.cpp\n@@ -0,0 +1,58 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2019, Google Inc.\n+ *\n+ * stream.cpp - Stream information\n+ */\n+\n+#include <libcamera/stream.h>\n+\n+/**\n+ * \\file stream.h\n+ * \\brief Stream information handling\n+ *\n+ * Each camera device is composed of one or multiple video stream connected\n+ * to one image source. The Stream class holds all static information about\n+ * a stream belonging to a camera device. A camera should provide a separate\n+ * Stream object for every stream it can support.\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 can be\n+ * associated with a video stream. It provides the mapping of a stream\n+ * capabilities to a numerical ID which should be used when configuring\n+ * the camera which might contain a collections of streams.\n+ *\n+ * \\todo Add capabilities to the Stream API. Without this the Stream class\n+ *\t only serves to map streams of unknown capabilities to a stream ID.\n+ *\t This in it self is important as it allows applications to configure\n+ *\t and capture from one or more streams even if it won't be able to\n+ *\t 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",
        "RFC",
        "2/4"
    ]
}