Show a patch.

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

{
    "id": 320,
    "url": "https://patchwork.libcamera.org/api/patches/320/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/320/",
    "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": "<20190121230640.8783-5-niklas.soderlund@ragnatech.se>",
    "date": "2019-01-21T23:06:40",
    "name": "[libcamera-devel,RFC,4/4] libcamera: camera: integrate streams and configuration",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": false,
    "hash": "a53be8601703940663ebd727d000303997e6285f",
    "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/320/mbox/",
    "series": [
        {
            "id": 109,
            "url": "https://patchwork.libcamera.org/api/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/320/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/320/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 4220460C83\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Jan 2019 00:07:20 +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 4a933f3d-1dd1-11e9-874f-005056917f90;\n\tTue, 22 Jan 2019 00:07:16 +0100 (CET)"
        ],
        "X-Halon-ID": "4a933f3d-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:40 +0100",
        "Message-Id": "<20190121230640.8783-5-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 4/4] libcamera: camera: integrate streams\n\tand configuration",
        "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:20 -0000"
    },
    "content": "Implement stubs for retrieving the streams of a camera and configuration\nof the same. This just add stubs and further building blocks are needed\nto make this useful.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n include/libcamera/camera.h |  9 ++++++++\n src/libcamera/camera.cpp   | 46 ++++++++++++++++++++++++++++++++++++++\n 2 files changed, 55 insertions(+)",
    "diff": "diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h\nindex 03b285c840c246e1..13395d994bade85a 100644\n--- a/include/libcamera/camera.h\n+++ b/include/libcamera/camera.h\n@@ -7,11 +7,16 @@\n #ifndef __LIBCAMERA_CAMERA_H__\n #define __LIBCAMERA_CAMERA_H__\n \n+#include <map>\n #include <memory>\n #include <string>\n+#include <vector>\n \n namespace libcamera {\n \n+class Stream;\n+class StreamFormat;\n+\n class Camera final\n {\n public:\n@@ -22,6 +27,10 @@ public:\n \n \tconst std::string &name() const;\n \n+\tstd::vector<Stream> streams() const;\n+\n+\tint configure(const std::map<unsigned int, StreamFormat *> &config);\n+\n \tint acquire();\n \tvoid release();\n \ndiff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\nindex b80bc36e410a6e0a..ad9cf948135c03bd 100644\n--- a/src/libcamera/camera.cpp\n+++ b/src/libcamera/camera.cpp\n@@ -6,6 +6,7 @@\n  */\n \n #include <libcamera/camera.h>\n+#include <libcamera/stream.h>\n \n #include \"log.h\"\n \n@@ -83,6 +84,51 @@ const std::string &Camera::name() const\n \treturn name_;\n }\n \n+/**\n+ * \\brief Retrieve the supported streams of the camera\n+ *\n+ * \\return An array of streams supported by the camera device\n+ */\n+std::vector<Stream> Camera::streams() const\n+{\n+\tstd::vector<Stream> streams;\n+\n+\t/* TODO: Call into pipeline handler and get streams. */\n+\t/* HACK: Hard code a single stream with ID 0. */\n+\tstreams.push_back(Stream(0));\n+\n+\treturn streams;\n+}\n+\n+/**\n+ * \\brief Configure the camera device prior to capture\n+ *\n+ * Prior to starting capture, the camera device must be configured to select a\n+ * set of streams.\n+ *\n+ * The requested configuration \\a config shall contain at least one stream and\n+ * may contain multiple streams. For each stream an associated StreamFormat\n+ * shall be supplied. Streams supported by the camera device not part of the\n+ * \\a config will be disabled.\n+ *\n+ * Exclusive access to the camera device shall be ensured by a call to\n+ * Camera::acquire() before calling this function, otherwise an -EACCES error\n+ * will be returned.\n+ *\n+ * \\param[in] config Array of stream configurations to setup\n+ *\n+ * \\return 0 on success or a negative error code on error.\n+ */\n+int Camera::configure(const std::map<unsigned int, StreamFormat *> &config)\n+{\n+\tif (!acquired_)\n+\t\treturn -EACCES;\n+\n+\t/* TODO: Call into pipeline handler to configure the hardware. */\n+\n+\treturn 0;\n+}\n+\n Camera::Camera(const std::string &name)\n \t: name_(name)\n {\n",
    "prefixes": [
        "libcamera-devel",
        "RFC",
        "4/4"
    ]
}