Show a patch.

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

{
    "id": 9956,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/9956/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/9956/",
    "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": "<20201005104649.10812-10-laurent.pinchart@ideasonboard.com>",
    "date": "2020-10-05T10:46:43",
    "name": "[libcamera-devel,09/15] android: camera_stream: Add FrameBufferAllocator",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": false,
    "hash": "c4b0af153ccf3e2eaf58d6c4822ad0e945e1e2ca",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": {
        "id": 14,
        "url": "https://patchwork.libcamera.org/api/1.1/users/14/?format=api",
        "username": "pinchartl",
        "first_name": "Laurent",
        "last_name": "Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "mbox": "https://patchwork.libcamera.org/patch/9956/mbox/",
    "series": [
        {
            "id": 1349,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1349/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1349",
            "date": "2020-10-05T10:46:34",
            "name": "CameraStream refactoring",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1349/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/9956/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/9956/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 82ECDC3B5F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Oct 2020 10:47:42 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4E6F363C30;\n\tMon,  5 Oct 2020 12:47:42 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 24E2863B82\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Oct 2020 12:47:37 +0200 (CEST)",
            "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id AA6D259E;\n\tMon,  5 Oct 2020 12:47:36 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"gWuUuXcm\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1601894856;\n\tbh=gWnFdfQ82p8qI2GH2SoAhdCVCPTo1HR0A/KgjeK/8uo=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=gWuUuXcmqmSGxc48KWcraaymvTR/fjtBgCN3Jz5n0ZTT8NN8ebyoWDbdMwhzv6lGo\n\t7+7kg1wzwDFEwWx/KUSk6bL/riSluLqvqzv2zhEhNa/mKusmcqZxVyxaEnP7NFx8e8\n\t9U6xvdtbNg8ALaEdQgLpXqJBs6J5rWv5nDIGE82Q=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon,  5 Oct 2020 13:46:43 +0300",
        "Message-Id": "<20201005104649.10812-10-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20201005104649.10812-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20201005104649.10812-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH 09/15] android: camera_stream: Add\n\tFrameBufferAllocator",
        "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": "From: Jacopo Mondi <jacopo@jmondi.org>\n\nAdd a FrameBufferAllocator class member to the CameraStream class.\nThe allocator is constructed for CameraStream instances that needs\ninternal allocation and deleted at class destruction time.\n\nThe definition of a destructor for the class deletes the implicitly\ndefined copy constructor, required as the CameraDevice stores\nCameraStream instances in a pre-reserved vector. In order to make the\nCameraStream copy-constructable it is required to make the encoder_\npointer decay to a raw pointer, as unique_ptr<> are not\ncopy-constructable.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/android/camera_stream.cpp | 13 +++++++++++--\n src/android/camera_stream.h   |  6 +++++-\n 2 files changed, 16 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp\nindex 6e7419ae31b8..9f3e7026b1a4 100644\n--- a/src/android/camera_stream.cpp\n+++ b/src/android/camera_stream.cpp\n@@ -19,12 +19,21 @@ LOG_DECLARE_CATEGORY(HAL);\n CameraStream::CameraStream(CameraDevice *cameraDev, Type type,\n \t\t\t   camera3_stream_t *androidStream, unsigned int index)\n \t: cameraDevice_(cameraDev), type_(type), androidStream_(androidStream),\n-\t  index_(index), encoder_(nullptr)\n+\t  index_(index), encoder_(nullptr), allocator_(nullptr)\n {\n \tconfig_ = cameraDevice_->cameraConfiguration();\n \n \tif (type_ == Type::Internal || type_ == Type::Mapped)\n-\t\tencoder_.reset(new EncoderLibJpeg);\n+\t\tencoder_ = new EncoderLibJpeg();\n+\n+\tif (type == Type::Internal)\n+\t\tallocator_ = new FrameBufferAllocator(cameraDevice_->camera());\n+}\n+\n+CameraStream::~CameraStream()\n+{\n+\tdelete encoder_;\n+\tdelete allocator_;\n }\n \n const StreamConfiguration &CameraStream::streamConfiguration() const\ndiff --git a/src/android/camera_stream.h b/src/android/camera_stream.h\nindex b67b4c0ca0b3..eaf4357ed096 100644\n--- a/src/android/camera_stream.h\n+++ b/src/android/camera_stream.h\n@@ -13,6 +13,7 @@\n \n #include <libcamera/buffer.h>\n #include <libcamera/camera.h>\n+#include <libcamera/framebuffer_allocator.h>\n #include <libcamera/geometry.h>\n #include <libcamera/pixel_format.h>\n \n@@ -109,6 +110,8 @@ public:\n \t};\n \tCameraStream(CameraDevice *cameraDev, Type type,\n \t\t     camera3_stream_t *androidStream, unsigned int index);\n+\tCameraStream(const CameraStream &) = default;\n+\t~CameraStream();\n \n \tint outputFormat() const { return androidStream_->format; }\n \tType type() const { return type_; }\n@@ -135,7 +138,8 @@ private:\n \t */\n \tunsigned int index_;\n \tlibcamera::CameraConfiguration *config_;\n-\tstd::unique_ptr<Encoder> encoder_;\n+\tEncoder *encoder_;\n+\tlibcamera::FrameBufferAllocator *allocator_;\n };\n \n #endif /* __ANDROID_CAMERA_STREAM__ */\n",
    "prefixes": [
        "libcamera-devel",
        "09/15"
    ]
}