Show a patch.

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

{
    "id": 381,
    "url": "https://patchwork.libcamera.org/api/patches/381/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/381/",
    "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": "<20190125153340.2744-3-niklas.soderlund@ragnatech.se>",
    "date": "2019-01-25T15:33:35",
    "name": "[libcamera-devel,v2,2/7] libcamera: stream: add basic StreamConfiguration class",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "2c9801fe08856104c1c18662a13f0753e9438f5f",
    "submitter": {
        "id": 5,
        "url": "https://patchwork.libcamera.org/api/people/5/?format=api",
        "name": "Niklas Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "delegate": {
        "id": 16,
        "url": "https://patchwork.libcamera.org/api/users/16/?format=api",
        "username": "neg",
        "first_name": "Niklas",
        "last_name": "Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "mbox": "https://patchwork.libcamera.org/patch/381/mbox/",
    "series": [
        {
            "id": 132,
            "url": "https://patchwork.libcamera.org/api/series/132/?format=api",
            "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/381/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/381/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<niklas.soderlund@ragnatech.se>",
        "Received": [
            "from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net\n\t[195.74.38.228])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C87C260C6A\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 9d3d18f7-20b6-11e9-874f-005056917f90;\n\tFri, 25 Jan 2019 16:33:50 +0100 (CET)"
        ],
        "X-Halon-ID": "9d3d18f7-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:35 +0100",
        "Message-Id": "<20190125153340.2744-3-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 2/7] libcamera: stream: add basic\n\tStreamConfiguration 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 simple StreamConfiguration class to hold configuration data for a\nsingle stream of a Camera. In its current form not many configuration\nparameters are supported but it's expected the number of options will\ngrow over time.\n\nAt this stage the pixel format is represented as a unsigned int to allow\nfor a easy mapping to the V4L2 API. This might be subject to change in\nthe future as we finalize how libcamera shall represent pixelformats.\n\nA StreamConfiguration objected needs to be created from the Stream\nobject it should configure. As the two objects are so closely related I\nhave at this stage opted to implement them in the same stream.{h,cpp} as\nthe Stream class.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n include/libcamera/stream.h | 20 ++++++++++++\n src/libcamera/stream.cpp   | 64 ++++++++++++++++++++++++++++++++++++++\n 2 files changed, 84 insertions(+)",
    "diff": "diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\nindex 415815ba12c65e47..8750797c36dd9b42 100644\n--- a/include/libcamera/stream.h\n+++ b/include/libcamera/stream.h\n@@ -20,6 +20,26 @@ private:\n \tunsigned int id_;\n };\n \n+class StreamConfiguration final\n+{\n+public:\n+\tStreamConfiguration(class Stream &stream);\n+\n+\tunsigned int id() const { return id_; };\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 id_;\n+\tunsigned int width_;\n+\tunsigned int height_;\n+\tunsigned int pixelformat_;\n+};\n+\n } /* namespace libcamera */\n \n #endif /* __LIBCAMERA_STREAM_H__ */\ndiff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\nindex 3b44e834ee02b35a..e40756260c5768f3 100644\n--- a/src/libcamera/stream.cpp\n+++ b/src/libcamera/stream.cpp\n@@ -63,4 +63,68 @@ Stream::Stream(unsigned int id)\n  * \\return The stream ID\n  */\n \n+/**\n+ * \\class StreamConfiguration\n+ * \\brief Stream configuration object\n+ *\n+ * The StreamConfiguration class is a model of all information which can be\n+ * configured for a single video stream. A application should acquire a all\n+ * Stream object from a camera, select the ones it wish to use, create a\n+ * StreamConfiguration for each of those streams, set the desired parameter on\n+ * the objects and feed them back to the camera object to configure the camera.\n+ */\n+\n+/**\n+ * \\fn StreamConfiguration::id()\n+ * \\brief Retrieve the streams ID\n+ * \\return The stream ID\n+ */\n+\n+/**\n+ * \\fn StreamConfiguration::width()\n+ * \\brief Retrieve the Stream width\n+ * \\return The stream width\n+ */\n+\n+/**\n+ * \\fn StreamConfiguration::height()\n+ * \\brief Retrieve the Stream height\n+ * \\return The stream height\n+ */\n+\n+/**\n+ * \\fn StreamConfiguration::pixelformat()\n+ * \\brief Retrieve the Stream pixelformat\n+ * \\return The stream pixelformat\n+ */\n+\n+/**\n+ * \\brief Set desired width and height for the stream\n+ * \\param[in] width The desired width of the stream\n+ * \\param[in] height The desired height of the stream\n+ */\n+void StreamConfiguration::setDimension(unsigned int width, unsigned int height)\n+{\n+\twidth_ = width;\n+\theight_ = height;\n+}\n+\n+/**\n+ * \\brief Set desired pixelformat for the stream\n+ * \\param[in] pixelformat The desired pixelformat of the stream\n+ */\n+void StreamConfiguration::setPixelFormat(unsigned int pixelformat)\n+{\n+\tpixelformat_ = pixelformat;\n+}\n+\n+/**\n+ * \\brief Create a new configuration container for a stream\n+ * \\param[in] stream The stream object the configuration object should act on\n+ */\n+StreamConfiguration::StreamConfiguration(class Stream &stream)\n+\t: id_(stream.id()), width_(0), height_(0), pixelformat_(0)\n+{\n+}\n+\n } /* namespace libcamera */\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "2/7"
    ]
}