Show a patch.

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

{
    "id": 13802,
    "url": "https://patchwork.libcamera.org/api/patches/13802/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/13802/",
    "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": "<20210910070638.467294-5-umang.jain@ideasonboard.com>",
    "date": "2021-09-10T07:06:33",
    "name": "[libcamera-devel,v2,4/9] android: post_processor: Notify post processing completion status",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "515ca324552ad523d2b981cb065f631fc7b132f6",
    "submitter": {
        "id": 86,
        "url": "https://patchwork.libcamera.org/api/people/86/?format=api",
        "name": "Umang Jain",
        "email": "umang.jain@ideasonboard.com"
    },
    "delegate": {
        "id": 12,
        "url": "https://patchwork.libcamera.org/api/users/12/?format=api",
        "username": "uajain",
        "first_name": "Umang",
        "last_name": "Jain",
        "email": "umang.jain@ideasonboard.com"
    },
    "mbox": "https://patchwork.libcamera.org/patch/13802/mbox/",
    "series": [
        {
            "id": 2513,
            "url": "https://patchwork.libcamera.org/api/series/2513/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2513",
            "date": "2021-09-10T07:06:29",
            "name": "Async Post Processor",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/2513/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/13802/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/13802/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 76D21BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 10 Sep 2021 07:06:56 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3927869176;\n\tFri, 10 Sep 2021 09:06:56 +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 09D7169169\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Sep 2021 09:06:55 +0200 (CEST)",
            "from perceval.ideasonboard.com (unknown [103.251.226.149])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DB959883;\n\tFri, 10 Sep 2021 09:06:53 +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=\"kWJcQ1tV\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1631257614;\n\tbh=m9I01tWs4PuAhksXpy0rzOChudu48aF0JkDThhFLk0Y=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=kWJcQ1tVUYeShVrr2ZwnnF+1GGjyqqk6wLfqmQc5wWh0eETu5F6CWmmulZaUQWptn\n\tiErQ7KHRL5Fdf7x/auD/jjttHDQpylFeZLJcDUB/UoCkGgT0VlrmmxO+33r5eMy01T\n\tX69D5pnwDwd2xmMZMUmANjKVDceL6hAqL94jtzx8=",
        "From": "Umang Jain <umang.jain@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 10 Sep 2021 12:36:33 +0530",
        "Message-Id": "<20210910070638.467294-5-umang.jain@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<20210910070638.467294-1-umang.jain@ideasonboard.com>",
        "References": "<20210910070638.467294-1-umang.jain@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 4/9] android: post_processor: Notify\n\tpost processing completion status",
        "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": "We should be able to know if post-processing has been completed\nsuccessfully or encountered some errors. This commit introduces a\nSignal<> which when connected, will notify that the post-processing\nhas been completed. The status of PostProcessor::process() will be\npassed as a PostProcessor::Status argument. The signal will be required\nwhen the post-processor is meant to run asynchronously (in subsequent\ncommits).\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\n---\n src/android/jpeg/post_processor_jpeg.cpp | 7 ++++++-\n src/android/post_processor.h             | 8 ++++++++\n src/android/yuv/post_processor_yuv.cpp   | 4 ++++\n 3 files changed, 18 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp\nindex 741eeb21..1df3dfb1 100644\n--- a/src/android/jpeg/post_processor_jpeg.cpp\n+++ b/src/android/jpeg/post_processor_jpeg.cpp\n@@ -103,8 +103,10 @@ int PostProcessorJpeg::process(const FrameBuffer *source,\n \t\t\t       CameraMetadata *resultMetadata,\n \t\t\t       const Camera3RequestDescriptor *context)\n {\n-\tif (!encoder_)\n+\tif (!encoder_) {\n+\t\tprocessComplete.emit(PostProcessor::Status::Failed, context);\n \t\treturn 0;\n+\t}\n \n \tASSERT(destination->numPlanes() == 1);\n \n@@ -197,6 +199,7 @@ int PostProcessorJpeg::process(const FrameBuffer *source,\n \t\t\t\t\t exif.data(), quality);\n \tif (jpeg_size < 0) {\n \t\tLOG(JPEG, Error) << \"Failed to encode stream image\";\n+\t\tprocessComplete.emit(PostProcessor::Status::Failed, context);\n \t\treturn jpeg_size;\n \t}\n \n@@ -211,5 +214,7 @@ int PostProcessorJpeg::process(const FrameBuffer *source,\n \t/* Update the JPEG result Metadata. */\n \tresultMetadata->addEntry(ANDROID_JPEG_SIZE, jpeg_size);\n \n+\tprocessComplete.emit(PostProcessor::Status::Succeeded, context);\n+\n \treturn 0;\n }\ndiff --git a/src/android/post_processor.h b/src/android/post_processor.h\nindex 1213e7e6..25c9411f 100644\n--- a/src/android/post_processor.h\n+++ b/src/android/post_processor.h\n@@ -7,6 +7,8 @@\n #ifndef __ANDROID_POST_PROCESSOR_H__\n #define __ANDROID_POST_PROCESSOR_H__\n \n+#include <libcamera/base/signal.h>\n+\n #include <libcamera/framebuffer.h>\n #include <libcamera/stream.h>\n \n@@ -28,6 +30,12 @@ public:\n \t\t\t    const CameraMetadata &requestMetadata,\n \t\t\t    CameraMetadata *resultMetadata,\n \t\t\t    const Camera3RequestDescriptor *context) = 0;\n+\n+\tenum Status {\n+\t\tSucceeded,\n+\t\tFailed,\n+\t};\n+\tlibcamera::Signal<Status, const Camera3RequestDescriptor *> processComplete;\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 13a78abe..d2df110a 100644\n--- a/src/android/yuv/post_processor_yuv.cpp\n+++ b/src/android/yuv/post_processor_yuv.cpp\n@@ -61,6 +61,7 @@ int PostProcessorYuv::process(const FrameBuffer *source,\n \tconst MappedFrameBuffer sourceMapped(source, MappedFrameBuffer::MapFlag::Read);\n \tif (!sourceMapped.isValid()) {\n \t\tLOG(YUV, Error) << \"Failed to mmap camera frame buffer\";\n+\t\tprocessComplete.emit(PostProcessor::Status::Failed, context);\n \t\treturn -EINVAL;\n \t}\n \n@@ -78,9 +79,12 @@ int PostProcessorYuv::process(const FrameBuffer *source,\n \t\t\t\t    libyuv::FilterMode::kFilterBilinear);\n \tif (ret) {\n \t\tLOG(YUV, Error) << \"Failed NV12 scaling: \" << ret;\n+\t\tprocessComplete.emit(PostProcessor::Status::Failed, context);\n \t\treturn -EINVAL;\n \t}\n \n+\tprocessComplete.emit(PostProcessor::Status::Succeeded, context);\n+\n \treturn 0;\n }\n \n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "4/9"
    ]
}