Patch Detail
Show a patch.
GET /api/1.1/patches/14190/?format=api
{ "id": 14190, "url": "https://patchwork.libcamera.org/api/1.1/patches/14190/?format=api", "web_url": "https://patchwork.libcamera.org/patch/14190/", "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": "<20211020104212.121743-3-umang.jain@ideasonboard.com>", "date": "2021-10-20T10:42:10", "name": "[libcamera-devel,v5,2/4] android: post_processor: Drop return value for process()", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "70cb0e24a66ef4b711821ac757eb6d8fa1a1ab2a", "submitter": { "id": 86, "url": "https://patchwork.libcamera.org/api/1.1/people/86/?format=api", "name": "Umang Jain", "email": "umang.jain@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/14190/mbox/", "series": [ { "id": 2640, "url": "https://patchwork.libcamera.org/api/1.1/series/2640/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2640", "date": "2021-10-20T10:42:08", "name": "Async Post Processor", "version": 5, "mbox": "https://patchwork.libcamera.org/series/2640/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/14190/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/14190/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 16AE0BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 20 Oct 2021 10:42:25 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CC86968F5B;\n\tWed, 20 Oct 2021 12:42:24 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3C5AB68F5D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 20 Oct 2021 12:42:23 +0200 (CEST)", "from perceval.ideasonboard.com (unknown [103.251.226.185])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 28B1A2A5;\n\tWed, 20 Oct 2021 12:42:22 +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=\"OYZlDAQZ\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1634726543;\n\tbh=SXg77ETBzTMM3GAp3jgvqdWLWi1O1H4D42TKSyFB45w=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=OYZlDAQZTmHbrnyhEonkMdUBifcEBHY3dX8phlMXsCF4oWHwH1kVaUrSjLm4NSeXS\n\tWLWOwDhZFk2CaH5qxxEnmLaWWgNrCylSht/MFmxwmlaNLZqSxs5bJzC6zu3FrKTykm\n\tkfMj13vHIt+ybDZPzBUEU3lACY6N7hl9yOzxSprw=", "From": "Umang Jain <umang.jain@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 20 Oct 2021 16:12:10 +0530", "Message-Id": "<20211020104212.121743-3-umang.jain@ideasonboard.com>", "X-Mailer": "git-send-email 2.31.1", "In-Reply-To": "<20211020104212.121743-1-umang.jain@ideasonboard.com>", "References": "<20211020104212.121743-1-umang.jain@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v5 2/4] android: post_processor: Drop\n\treturn value for process()", "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": "PostProcessor::process() is invoked by CameraStream class\nin case any post-processing is required for the camera stream.\nThe failure or success is checked via the value returned by\nCameraStream::process().\n\nNow that the post-processor notifies about the post-processing\ncompletion operation, we can drop the return value of\nPostProcessor::process(). The status of post-processing is passed\nto CameraDevice::streamProcessingComplete() by the\nPostProcessor::processComplete signal's slot.\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\n---\n src/android/camera_stream.cpp | 4 +++-\n src/android/jpeg/post_processor_jpeg.cpp | 12 +++++-------\n src/android/jpeg/post_processor_jpeg.h | 6 +++---\n src/android/post_processor.h | 6 +++---\n src/android/yuv/post_processor_yuv.cpp | 14 ++++++--------\n src/android/yuv/post_processor_yuv.h | 6 +++---\n 6 files changed, 23 insertions(+), 25 deletions(-)", "diff": "diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp\nindex 04cbef8c..b3cb06a2 100644\n--- a/src/android/camera_stream.cpp\n+++ b/src/android/camera_stream.cpp\n@@ -191,7 +191,9 @@ int CameraStream::process(const FrameBuffer &source,\n \t\treturn -EINVAL;\n \t}\n \n-\treturn postProcessor_->process(source, &destBuffer, request);\n+\tpostProcessor_->process(source, &destBuffer, request);\n+\n+\treturn 0;\n }\n \n FrameBuffer *CameraStream::getBuffer()\ndiff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp\nindex a001fede..955ea21d 100644\n--- a/src/android/jpeg/post_processor_jpeg.cpp\n+++ b/src/android/jpeg/post_processor_jpeg.cpp\n@@ -98,12 +98,12 @@ void PostProcessorJpeg::generateThumbnail(const FrameBuffer &source,\n \t}\n }\n \n-int PostProcessorJpeg::process(const FrameBuffer &source,\n-\t\t\t CameraBuffer *destination,\n-\t\t\t Camera3RequestDescriptor *request)\n+void PostProcessorJpeg::process(const FrameBuffer &source,\n+\t\t\t\tCameraBuffer *destination,\n+\t\t\t\tCamera3RequestDescriptor *request)\n {\n \tif (!encoder_)\n-\t\treturn 0;\n+\t\treturn;\n \n \tASSERT(destination->numPlanes() == 1);\n \n@@ -199,7 +199,7 @@ int PostProcessorJpeg::process(const FrameBuffer &source,\n \tif (jpeg_size < 0) {\n \t\tLOG(JPEG, Error) << \"Failed to encode stream image\";\n \t\tprocessComplete.emit(request, PostProcessor::Status::Error);\n-\t\treturn jpeg_size;\n+\t\treturn;\n \t}\n \n \t/* Fill in the JPEG blob header. */\n@@ -213,6 +213,4 @@ int PostProcessorJpeg::process(const FrameBuffer &source,\n \t/* Update the JPEG result Metadata. */\n \tresultMetadata->addEntry(ANDROID_JPEG_SIZE, jpeg_size);\n \tprocessComplete.emit(request, PostProcessor::Status::Success);\n-\n-\treturn 0;\n }\ndiff --git a/src/android/jpeg/post_processor_jpeg.h b/src/android/jpeg/post_processor_jpeg.h\nindex 0184d77e..5dab14e1 100644\n--- a/src/android/jpeg/post_processor_jpeg.h\n+++ b/src/android/jpeg/post_processor_jpeg.h\n@@ -22,9 +22,9 @@ public:\n \n \tint configure(const libcamera::StreamConfiguration &incfg,\n \t\t const libcamera::StreamConfiguration &outcfg) override;\n-\tint process(const libcamera::FrameBuffer &source,\n-\t\t CameraBuffer *destination,\n-\t\t Camera3RequestDescriptor *request) override;\n+\tvoid process(const libcamera::FrameBuffer &source,\n+\t\t CameraBuffer *destination,\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 14f5e8c7..7e78cfec 100644\n--- a/src/android/post_processor.h\n+++ b/src/android/post_processor.h\n@@ -28,9 +28,9 @@ public:\n \n \tvirtual int configure(const libcamera::StreamConfiguration &inCfg,\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 Camera3RequestDescriptor *request) = 0;\n+\tvirtual void process(const libcamera::FrameBuffer &source,\n+\t\t\t CameraBuffer *destination,\n+\t\t\t Camera3RequestDescriptor *request) = 0;\n \n \tlibcamera::Signal<Camera3RequestDescriptor *, Status> processComplete;\n };\ndiff --git a/src/android/yuv/post_processor_yuv.cpp b/src/android/yuv/post_processor_yuv.cpp\nindex fd364741..b167f057 100644\n--- a/src/android/yuv/post_processor_yuv.cpp\n+++ b/src/android/yuv/post_processor_yuv.cpp\n@@ -49,20 +49,20 @@ int PostProcessorYuv::configure(const StreamConfiguration &inCfg,\n \treturn 0;\n }\n \n-int PostProcessorYuv::process(const FrameBuffer &source,\n-\t\t\t CameraBuffer *destination,\n-\t\t\t Camera3RequestDescriptor *request)\n+void PostProcessorYuv::process(const FrameBuffer &source,\n+\t\t\t CameraBuffer *destination,\n+\t\t\t Camera3RequestDescriptor *request)\n {\n \tif (!isValidBuffers(source, *destination)) {\n \t\tprocessComplete.emit(request, PostProcessor::Status::Error);\n-\t\treturn -EINVAL;\n+\t\treturn;\n \t}\n \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(request, PostProcessor::Status::Error);\n-\t\treturn -EINVAL;\n+\t\treturn;\n \t}\n \n \tint ret = libyuv::NV12Scale(sourceMapped.planes()[0].data(),\n@@ -80,12 +80,10 @@ int PostProcessorYuv::process(const FrameBuffer &source,\n \tif (ret) {\n \t\tLOG(YUV, Error) << \"Failed NV12 scaling: \" << ret;\n \t\tprocessComplete.emit(request, PostProcessor::Status::Error);\n-\t\treturn -EINVAL;\n+\t\treturn;\n \t}\n \n \tprocessComplete.emit(request, PostProcessor::Status::Success);\n-\n-\treturn 0;\n }\n \n bool PostProcessorYuv::isValidBuffers(const FrameBuffer &source,\ndiff --git a/src/android/yuv/post_processor_yuv.h b/src/android/yuv/post_processor_yuv.h\nindex a4e0ff5d..1278843b 100644\n--- a/src/android/yuv/post_processor_yuv.h\n+++ b/src/android/yuv/post_processor_yuv.h\n@@ -18,9 +18,9 @@ public:\n \n \tint configure(const libcamera::StreamConfiguration &incfg,\n \t\t const libcamera::StreamConfiguration &outcfg) override;\n-\tint process(const libcamera::FrameBuffer &source,\n-\t\t CameraBuffer *destination,\n-\t\t Camera3RequestDescriptor *request) override;\n+\tvoid process(const libcamera::FrameBuffer &source,\n+\t\t CameraBuffer *destination,\n+\t\t Camera3RequestDescriptor *request) override;\n \n private:\n \tbool isValidBuffers(const libcamera::FrameBuffer &source,\n", "prefixes": [ "libcamera-devel", "v5", "2/4" ] }