Show a patch.

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

{
    "id": 14077,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/14077/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/14077/",
    "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": "<20211011073505.243864-3-umang.jain@ideasonboard.com>",
    "date": "2021-10-11T07:35:00",
    "name": "[libcamera-devel,v4,2/7] android: camera_stream: Plumb process() with Camera3RequestDescriptor",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "df5d8d8608bf0fc37bbbeef651f2507a1e24c1d5",
    "submitter": {
        "id": 86,
        "url": "https://patchwork.libcamera.org/api/1.1/people/86/?format=api",
        "name": "Umang Jain",
        "email": "umang.jain@ideasonboard.com"
    },
    "delegate": {
        "id": 12,
        "url": "https://patchwork.libcamera.org/api/1.1/users/12/?format=api",
        "username": "uajain",
        "first_name": "Umang",
        "last_name": "Jain",
        "email": "umang.jain@ideasonboard.com"
    },
    "mbox": "https://patchwork.libcamera.org/patch/14077/mbox/",
    "series": [
        {
            "id": 2611,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2611/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2611",
            "date": "2021-10-11T07:34:58",
            "name": "Async Post Processor",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/2611/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/14077/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/14077/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 5E6CAC323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 11 Oct 2021 07:35:23 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2ADB368F4E;\n\tMon, 11 Oct 2021 09:35:23 +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 EEC3568F4C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 11 Oct 2021 09:35:18 +0200 (CEST)",
            "from perceval.ideasonboard.com (unknown [103.251.226.107])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A1B3A2BD;\n\tMon, 11 Oct 2021 09:35:17 +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=\"k1TA4rFy\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1633937718;\n\tbh=CTheA1PRCa4GFq+iWAoQIypHnIjfkEBaFYGUCjCRNmY=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=k1TA4rFyUrhrJ3so0bZxlEh7+KimQNQLxT51NZJrFpmdYVTnDFDnT3jLejRIEnNmn\n\tuX0fONBKfpK9a98e7NKgxC993jOKGuzT+gxlH5NpeuTCDkfqHQtwWEL0niED9d65A0\n\tZ+Zv7kW11u8hMTT53YuW8xeWdwq3eNiCiiZuHfNc=",
        "From": "Umang Jain <umang.jain@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 11 Oct 2021 13:05:00 +0530",
        "Message-Id": "<20211011073505.243864-3-umang.jain@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<20211011073505.243864-1-umang.jain@ideasonboard.com>",
        "References": "<20211011073505.243864-1-umang.jain@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v4 2/7] android: camera_stream: Plumb\n\tprocess() with Camera3RequestDescriptor",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Data (or broader context) required for post processing of a camera request\nis saved via Camera3RequestDescriptor. Instead of passing individual\narguments to CameraStream::process(), pass the Camera3RequestDescriptor\npointer to it. All the arguments necessary to run the post-processor can\nbe accessed from the descriptor.\n\nIn subsequent commits, we will prepare the post-processor to run\nasynchronously. Hence, it will require the Camera3RequestDescriptor\npointer to be emitted back in the post-processing completion handler\nto finally complete the request (i.e. sending the capture results back\nto the framework).\n\nStore result metadata which is sent as capture results into the\nCamera3RequestDescriptor. This is will remove the need to send the\nresult metadata pointer separately to CameraStream::process().\nIn the subsequent commit, a Camera3RequestDescriptor pointer\nwill be passed to CameraStream::process() and the result metadata\ncan be directly accessed from there.\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Hirokazu Honda <hiroh@chromium.org>\n---\n src/android/camera_device.cpp            | 9 +++++----\n src/android/camera_device.h              | 1 +\n src/android/camera_stream.cpp            | 5 ++---\n src/android/camera_stream.h              | 5 +++--\n src/android/jpeg/post_processor_jpeg.cpp | 5 +++--\n src/android/jpeg/post_processor_jpeg.h   | 3 +--\n src/android/post_processor.h             | 5 +++--\n src/android/yuv/post_processor_yuv.cpp   | 3 +--\n src/android/yuv/post_processor_yuv.h     | 3 +--\n 9 files changed, 20 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 48a96d0c..b52bdc8f 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -1207,6 +1207,8 @@ void CameraDevice::requestComplete(Request *request)\n \t\tresultMetadata = std::make_unique<CameraMetadata>(0, 0);\n \t}\n \n+\tdescriptor->resultMetadata_ = std::move(resultMetadata);\n+\n \t/* Handle post-processing. */\n \tfor (camera3_stream_buffer_t &buffer : descriptor->buffers_) {\n \t\tCameraStream *cameraStream =\n@@ -1224,9 +1226,8 @@ void CameraDevice::requestComplete(Request *request)\n \t\t\tcontinue;\n \t\t}\n \n-\t\tint ret = cameraStream->process(*src, buffer,\n-\t\t\t\t\t\tdescriptor->settings_,\n-\t\t\t\t\t\tresultMetadata.get());\n+\t\tint ret = cameraStream->process(*src, buffer, descriptor);\n+\n \t\t/*\n \t\t * Return the FrameBuffer to the CameraStream now that we're\n \t\t * done processing it.\n@@ -1241,7 +1242,7 @@ void CameraDevice::requestComplete(Request *request)\n \t\t}\n \t}\n \n-\tcaptureResult.result = resultMetadata->get();\n+\tcaptureResult.result = descriptor->resultMetadata_->get();\n \tdescriptor->status_ = Camera3RequestDescriptor::Status::Success;\n \tsendCaptureResults();\n }\ndiff --git a/src/android/camera_device.h b/src/android/camera_device.h\nindex 26d1c6de..3da8dffa 100644\n--- a/src/android/camera_device.h\n+++ b/src/android/camera_device.h\n@@ -55,6 +55,7 @@ struct Camera3RequestDescriptor {\n \tstd::vector<std::unique_ptr<libcamera::FrameBuffer>> frameBuffers_;\n \tCameraMetadata settings_;\n \tstd::unique_ptr<CaptureRequest> request_;\n+\tstd::unique_ptr<CameraMetadata> resultMetadata_;\n \n \tcamera3_capture_result_t captureResult_ = {};\n \tStatus status_ = Status::Pending;\ndiff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp\nindex 3b96d2e9..8f47e4d8 100644\n--- a/src/android/camera_stream.cpp\n+++ b/src/android/camera_stream.cpp\n@@ -144,8 +144,7 @@ int CameraStream::waitFence(int fence)\n \n int CameraStream::process(const FrameBuffer &source,\n \t\t\t  camera3_stream_buffer_t &camera3Dest,\n-\t\t\t  const CameraMetadata &requestMetadata,\n-\t\t\t  CameraMetadata *resultMetadata)\n+\t\t\t  Camera3RequestDescriptor *request)\n {\n \t/* Handle waiting on fences on the destination buffer. */\n \tint fence = camera3Dest.acquire_fence;\n@@ -175,7 +174,7 @@ int CameraStream::process(const FrameBuffer &source,\n \t\treturn -EINVAL;\n \t}\n \n-\treturn postProcessor_->process(source, &dest, requestMetadata, resultMetadata);\n+\treturn postProcessor_->process(source, &dest, request);\n }\n \n FrameBuffer *CameraStream::getBuffer()\ndiff --git a/src/android/camera_stream.h b/src/android/camera_stream.h\nindex 03ecfa94..04cfd111 100644\n--- a/src/android/camera_stream.h\n+++ b/src/android/camera_stream.h\n@@ -23,6 +23,8 @@ class CameraDevice;\n class CameraMetadata;\n class PostProcessor;\n \n+struct Camera3RequestDescriptor;\n+\n class CameraStream\n {\n public:\n@@ -120,8 +122,7 @@ public:\n \tint configure();\n \tint process(const libcamera::FrameBuffer &source,\n \t\t    camera3_stream_buffer_t &camera3Buffer,\n-\t\t    const CameraMetadata &requestMetadata,\n-\t\t    CameraMetadata *resultMetadata);\n+\t\t    Camera3RequestDescriptor *request);\n \tlibcamera::FrameBuffer *getBuffer();\n \tvoid putBuffer(libcamera::FrameBuffer *buffer);\n \ndiff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp\nindex f6d47f63..656c48b2 100644\n--- a/src/android/jpeg/post_processor_jpeg.cpp\n+++ b/src/android/jpeg/post_processor_jpeg.cpp\n@@ -99,14 +99,15 @@ void PostProcessorJpeg::generateThumbnail(const FrameBuffer &source,\n \n int PostProcessorJpeg::process(const FrameBuffer &source,\n \t\t\t       CameraBuffer *destination,\n-\t\t\t       const CameraMetadata &requestMetadata,\n-\t\t\t       CameraMetadata *resultMetadata)\n+\t\t\t       Camera3RequestDescriptor *request)\n {\n \tif (!encoder_)\n \t\treturn 0;\n \n \tASSERT(destination->numPlanes() == 1);\n \n+\tconst CameraMetadata &requestMetadata = request->settings_;\n+\tCameraMetadata *resultMetadata = request->resultMetadata_.get();\n \tcamera_metadata_ro_entry_t entry;\n \tint ret;\n \ndiff --git a/src/android/jpeg/post_processor_jpeg.h b/src/android/jpeg/post_processor_jpeg.h\nindex 6fd31022..0184d77e 100644\n--- a/src/android/jpeg/post_processor_jpeg.h\n+++ b/src/android/jpeg/post_processor_jpeg.h\n@@ -24,8 +24,7 @@ public:\n \t\t      const libcamera::StreamConfiguration &outcfg) override;\n \tint process(const libcamera::FrameBuffer &source,\n \t\t    CameraBuffer *destination,\n-\t\t    const CameraMetadata &requestMetadata,\n-\t\t    CameraMetadata *resultMetadata) override;\n+\t\t    Camera3RequestDescriptor *request) override;\n \n private:\n \tvoid generateThumbnail(const libcamera::FrameBuffer &source,\ndiff --git a/src/android/post_processor.h b/src/android/post_processor.h\nindex ab2b2c60..fa13c7e0 100644\n--- a/src/android/post_processor.h\n+++ b/src/android/post_processor.h\n@@ -14,6 +14,8 @@\n \n class CameraMetadata;\n \n+struct Camera3RequestDescriptor;\n+\n class PostProcessor\n {\n public:\n@@ -23,8 +25,7 @@ public:\n \t\t\t      const libcamera::StreamConfiguration &outCfg) = 0;\n \tvirtual int process(const libcamera::FrameBuffer &source,\n \t\t\t    CameraBuffer *destination,\n-\t\t\t    const CameraMetadata &requestMetadata,\n-\t\t\t    CameraMetadata *resultMetadata) = 0;\n+\t\t\t    Camera3RequestDescriptor *request) = 0;\n };\n \n #endif /* __ANDROID_POST_PROCESSOR_H__ */\ndiff --git a/src/android/yuv/post_processor_yuv.cpp b/src/android/yuv/post_processor_yuv.cpp\nindex 7b3b4960..8110a1f1 100644\n--- a/src/android/yuv/post_processor_yuv.cpp\n+++ b/src/android/yuv/post_processor_yuv.cpp\n@@ -51,8 +51,7 @@ int PostProcessorYuv::configure(const StreamConfiguration &inCfg,\n \n int PostProcessorYuv::process(const FrameBuffer &source,\n \t\t\t      CameraBuffer *destination,\n-\t\t\t      [[maybe_unused]] const CameraMetadata &requestMetadata,\n-\t\t\t      [[maybe_unused]] CameraMetadata *metadata)\n+\t\t\t      [[maybe_unused]] Camera3RequestDescriptor *request)\n {\n \tif (!isValidBuffers(source, *destination))\n \t\treturn -EINVAL;\ndiff --git a/src/android/yuv/post_processor_yuv.h b/src/android/yuv/post_processor_yuv.h\nindex 12f7af07..a4e0ff5d 100644\n--- a/src/android/yuv/post_processor_yuv.h\n+++ b/src/android/yuv/post_processor_yuv.h\n@@ -20,8 +20,7 @@ public:\n \t\t      const libcamera::StreamConfiguration &outcfg) override;\n \tint process(const libcamera::FrameBuffer &source,\n \t\t    CameraBuffer *destination,\n-\t\t    const CameraMetadata &requestMetadata,\n-\t\t    CameraMetadata *metadata) override;\n+\t\t    Camera3RequestDescriptor *request) override;\n \n private:\n \tbool isValidBuffers(const libcamera::FrameBuffer &source,\n",
    "prefixes": [
        "libcamera-devel",
        "v4",
        "2/7"
    ]
}