Show a patch.

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

{
    "id": 9970,
    "url": "https://patchwork.libcamera.org/api/patches/9970/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/9970/",
    "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": "<20201006144432.22908-2-jacopo@jmondi.org>",
    "date": "2020-10-06T14:44:20",
    "name": "[libcamera-devel,v2,01/13] android: camera_stream: Break out CameraStream",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "c0dd9d93d4196182584f1afa39f20d272b95fbc1",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/9970/mbox/",
    "series": [
        {
            "id": 1356,
            "url": "https://patchwork.libcamera.org/api/series/1356/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1356",
            "date": "2020-10-06T14:44:19",
            "name": "CameraStream refactor",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/1356/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/9970/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/9970/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id A89C8BEEE1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  6 Oct 2020 14:40:40 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E518363C9F;\n\tTue,  6 Oct 2020 16:40:39 +0200 (CEST)",
            "from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net\n\t[217.70.183.195])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6562663BBF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  6 Oct 2020 16:40:39 +0200 (CEST)",
            "from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay3-d.mail.gandi.net (Postfix) with ESMTPSA id A507360002;\n\tTue,  6 Oct 2020 14:40:38 +0000 (UTC)"
        ],
        "X-Originating-IP": "93.34.118.233",
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue,  6 Oct 2020 16:44:20 +0200",
        "Message-Id": "<20201006144432.22908-2-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.28.0",
        "In-Reply-To": "<20201006144432.22908-1-jacopo@jmondi.org>",
        "References": "<20201006144432.22908-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v2 01/13] android: camera_stream: Break\n\tout CameraStream",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "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>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Break CameraStream out of the CameraDevice class.\n\nNo functional changes, only the code is moved.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/android/camera_device.cpp |  6 ------\n src/android/camera_device.h   | 24 +--------------------\n src/android/camera_stream.cpp | 18 ++++++++++++++++\n src/android/camera_stream.h   | 40 +++++++++++++++++++++++++++++++++++\n src/android/meson.build       |  1 +\n 5 files changed, 60 insertions(+), 29 deletions(-)\n create mode 100644 src/android/camera_stream.cpp\n create mode 100644 src/android/camera_stream.h",
    "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 751699cd2113..bbc692fe109f 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -169,12 +169,6 @@ MappedCamera3Buffer::MappedCamera3Buffer(const buffer_handle_t camera3buffer,\n \t}\n }\n \n-CameraStream::CameraStream(PixelFormat format, Size size,\n-\t\t\t   unsigned int index, Encoder *encoder)\n-\t: format_(format), size_(size), index_(index), encoder_(encoder)\n-{\n-}\n-\n /*\n  * \\struct Camera3RequestDescriptor\n  *\ndiff --git a/src/android/camera_device.h b/src/android/camera_device.h\nindex 1837748d2efc..52923ec979a7 100644\n--- a/src/android/camera_device.h\n+++ b/src/android/camera_device.h\n@@ -23,33 +23,11 @@\n #include \"libcamera/internal/log.h\"\n #include \"libcamera/internal/message.h\"\n \n+#include \"camera_stream.h\"\n #include \"jpeg/encoder.h\"\n \n class CameraMetadata;\n \n-class CameraStream\n-{\n-public:\n-\tCameraStream(libcamera::PixelFormat format, libcamera::Size size,\n-\t\t     unsigned int index, Encoder *encoder = nullptr);\n-\n-\tconst libcamera::PixelFormat &format() const { return format_; }\n-\tconst libcamera::Size &size() const { return size_; }\n-\tunsigned int index() const { return index_; }\n-\tEncoder *encoder() const { return encoder_.get(); }\n-\n-private:\n-\tlibcamera::PixelFormat format_;\n-\tlibcamera::Size size_;\n-\t/*\n-\t * The index of the libcamera StreamConfiguration as added during\n-\t * configureStreams(). A single libcamera Stream may be used to deliver\n-\t * one or more streams to the Android framework.\n-\t */\n-\tunsigned int index_;\n-\tstd::unique_ptr<Encoder> encoder_;\n-};\n-\n class CameraDevice : protected libcamera::Loggable\n {\n public:\ndiff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp\nnew file mode 100644\nindex 000000000000..cd9084aeb51b\n--- /dev/null\n+++ b/src/android/camera_stream.cpp\n@@ -0,0 +1,18 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2020, Google Inc.\n+ *\n+ * camera_stream.cpp - Camera HAL stream\n+ */\n+\n+#include \"camera_stream.h\"\n+\n+#include \"jpeg/encoder.h\"\n+\n+using namespace libcamera;\n+\n+CameraStream::CameraStream(PixelFormat format, Size size,\n+\t\t\t   unsigned int index, Encoder *encoder)\n+\t: format_(format), size_(size), index_(index), encoder_(encoder)\n+{\n+}\ndiff --git a/src/android/camera_stream.h b/src/android/camera_stream.h\nnew file mode 100644\nindex 000000000000..0de6b6fc6f8c\n--- /dev/null\n+++ b/src/android/camera_stream.h\n@@ -0,0 +1,40 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2020, Google Inc.\n+ *\n+ * camera_stream.h - Camera HAL stream\n+ */\n+#ifndef __ANDROID_CAMERA_STREAM_H__\n+#define __ANDROID_CAMERA_STREAM_H__\n+\n+#include <memory>\n+\n+#include <libcamera/geometry.h>\n+#include <libcamera/pixel_format.h>\n+\n+class Encoder;\n+\n+class CameraStream\n+{\n+public:\n+\tCameraStream(libcamera::PixelFormat format, libcamera::Size size,\n+\t\t     unsigned int index, Encoder *encoder = nullptr);\n+\n+\tconst libcamera::PixelFormat &format() const { return format_; }\n+\tconst libcamera::Size &size() const { return size_; }\n+\tunsigned int index() const { return index_; }\n+\tEncoder *encoder() const { return encoder_.get(); }\n+\n+private:\n+\tlibcamera::PixelFormat format_;\n+\tlibcamera::Size size_;\n+\t/*\n+\t * The index of the libcamera StreamConfiguration as added during\n+\t * configureStreams(). A single libcamera Stream may be used to deliver\n+\t * one or more streams to the Android framework.\n+\t */\n+\tunsigned int index_;\n+\tstd::unique_ptr<Encoder> encoder_;\n+};\n+\n+#endif /* __ANDROID_CAMERA_STREAM__ */\ndiff --git a/src/android/meson.build b/src/android/meson.build\nindex 0293c2036561..802bb89afe57 100644\n--- a/src/android/meson.build\n+++ b/src/android/meson.build\n@@ -20,6 +20,7 @@ android_hal_sources = files([\n     'camera_device.cpp',\n     'camera_metadata.cpp',\n     'camera_ops.cpp',\n+    'camera_stream.cpp',\n     'jpeg/encoder_libjpeg.cpp',\n     'jpeg/exif.cpp',\n ])\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "01/13"
    ]
}