[{"id":13491,"web_url":"https://patchwork.libcamera.org/comment/13491/","msgid":"<20201026210705.GD3756@pendragon.ideasonboard.com>","date":"2020-10-26T21:07:05","subject":"Re: [libcamera-devel] [PATCH 1/3] android: jpeg: Return encoded\n\tbytes size from PostProcessorJpeg","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Umang,\n\nThank you for the patch.\n\nOn Mon, Oct 26, 2020 at 07:31:32PM +0530, Umang Jain wrote:\n> Returning 0 from PostProcessJpeg::process() is not really helpful.\n> Also, one expects that the process() returns the size of the output\n> data from the processor.\n> \n> Signed-off-by: Umang Jain <email@uajain.com>\n> ---\n>  src/android/jpeg/post_processor_jpeg.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp\n> index 93acfe5..c56f1b2 100644\n> --- a/src/android/jpeg/post_processor_jpeg.cpp\n> +++ b/src/android/jpeg/post_processor_jpeg.cpp\n> @@ -101,5 +101,5 @@ int PostProcessorJpeg::process(const FrameBuffer &source,\n>  \tconst uint32_t jpeg_orientation = 0;\n>  \tmetadata->addEntry(ANDROID_JPEG_ORIENTATION, &jpeg_orientation, 1);\n>  \n> -\treturn 0;\n> +\treturn jpeg_size;\n\nIs this needed by the rest of the series ? If not, I'd rather skip it\nfor now, as returning the output data size will not always be as\nstraightforward as returning an integer. For post-processors that\nproduce multi-planar formats, we'll possibly need a size per plane. I'd\nrather wait until we get an actual use case for the size in the caller.\n\n>  }","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 84D56BDB1E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 26 Oct 2020 21:07:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5609362062;\n\tMon, 26 Oct 2020 22:07:54 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2C11E60350\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Oct 2020 22:07:53 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B7816527;\n\tMon, 26 Oct 2020 22:07:52 +0100 (CET)"],"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=\"esIfAV4V\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1603746472;\n\tbh=OUqk9rDeINVJLznWzlaH05eTIq55vZdewcZKS0Zc5RU=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=esIfAV4VufRxUr2B47DVOwMPmD2lEM9VmEpheCg2+GlG+ZKF+enoN7EW9Y0hcAdrB\n\tdDGpZ/0oao3PBX2wm91pxbikmu8XCwemXb4rEY6QU1+1e34jzuwF0uhmwyZEB0vzPb\n\tEU/e/Wg0mrvTVZSnimaB6OEJ2Y87FFsInp4okFUg=","Date":"Mon, 26 Oct 2020 23:07:05 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Umang Jain <email@uajain.com>","Message-ID":"<20201026210705.GD3756@pendragon.ideasonboard.com>","References":"<20201026140134.44166-1-email@uajain.com>\n\t<20201026140134.44166-2-email@uajain.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201026140134.44166-2-email@uajain.com>","Subject":"Re: [libcamera-devel] [PATCH 1/3] android: jpeg: Return encoded\n\tbytes size from PostProcessorJpeg","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>","Cc":"libcamera-devel@lists.libcamera.org","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>"}},{"id":13503,"web_url":"https://patchwork.libcamera.org/comment/13503/","msgid":"<2925168d-3297-2174-61ff-943bfd88b749@uajain.com>","date":"2020-10-27T04:31:07","subject":"Re: [libcamera-devel] [PATCH 1/3] android: jpeg: Return encoded\n\tbytes size from PostProcessorJpeg","submitter":{"id":1,"url":"https://patchwork.libcamera.org/api/people/1/","name":"Umang Jain","email":"email@uajain.com"},"content":"Hi Laurent,\n\nOn 10/27/20 2:37 AM, Laurent Pinchart wrote:\n> Hi Umang,\n>\n> Thank you for the patch.\n>\n> On Mon, Oct 26, 2020 at 07:31:32PM +0530, Umang Jain wrote:\n>> Returning 0 from PostProcessJpeg::process() is not really helpful.\n>> Also, one expects that the process() returns the size of the output\n>> data from the processor.\n>>\n>> Signed-off-by: Umang Jain <email@uajain.com>\n>> ---\n>>   src/android/jpeg/post_processor_jpeg.cpp | 2 +-\n>>   1 file changed, 1 insertion(+), 1 deletion(-)\n>>\n>> diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp\n>> index 93acfe5..c56f1b2 100644\n>> --- a/src/android/jpeg/post_processor_jpeg.cpp\n>> +++ b/src/android/jpeg/post_processor_jpeg.cpp\n>> @@ -101,5 +101,5 @@ int PostProcessorJpeg::process(const FrameBuffer &source,\n>>   \tconst uint32_t jpeg_orientation = 0;\n>>   \tmetadata->addEntry(ANDROID_JPEG_ORIENTATION, &jpeg_orientation, 1);\n>>   \n>> -\treturn 0;\n>> +\treturn jpeg_size;\n> Is this needed by the rest of the series ? If not, I'd rather skip it\n> for now, as returning the output data size will not always be as\n> straightforward as returning an integer. For post-processors that\n> produce multi-planar formats, we'll possibly need a size per plane. I'd\n> rather wait until we get an actual use case for the size in the caller.\nNo, it's not needed by rest of the series as such (and I will take a \ndeeper look today to double-check it). I needed this when I tested these \npatches, in the instance where I needed to write the encoded thumbnail \nout to a file for inspection. I  need to know the no. of bytes I need to \nwrite to file from destination span. And yes, I agree with your analysis \nthat we might need to rework this entirely to support returning \nmulti-planer formats.\n\n\n>\n>>   }","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 306CBC3B5C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 27 Oct 2020 04:31:13 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 87E8662069;\n\tTue, 27 Oct 2020 05:31:12 +0100 (CET)","from mail.uajain.com (static.126.159.217.95.clients.your-server.de\n\t[95.217.159.126])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E172D6034C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 27 Oct 2020 05:31:10 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=uajain.com header.i=@uajain.com\n\theader.b=\"wdihWd1H\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=uajain.com; s=mail;\n\tt=1603773070; bh=vymhNECFJlQkRl02L8vGAnKd4H9GSeJ5lDaaVYPx9CQ=;\n\th=Subject:To:Cc:References:From:In-Reply-To;\n\tb=wdihWd1HOqK/YA3yvhoZIdeZfupF+NrnxnC8KECMMoLYssLOeq+8PgUbGUscB99am\n\tOd6lAJwoWClQFG+Wp95V1kjY0WgpubWRArfRrqUcdyUfJnY5KlGoX58zb7Vu7lz14T\n\tj/FCDxQpDenBekr1bSyH9AjNujZ4qsC2EQXFKknYQ/k2dUPk1qu6Fv4gaAEREAn5Dm\n\tVXG2hNUSw2wn/ENOiweDxpCvcx9XBaxaly33ChWKpTcttbJrVdGs3VO3fohzDSM323\n\t26zjOh1y9QLxH2t7x8r8Eb97Sw91fe6eVZM8ywCuonNpSq6FG58BbgtNt3fHiN0hot\n\tudF8dvlpLJV3w==","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20201026140134.44166-1-email@uajain.com>\n\t<20201026140134.44166-2-email@uajain.com>\n\t<20201026210705.GD3756@pendragon.ideasonboard.com>","From":"Umang Jain <email@uajain.com>","Message-ID":"<2925168d-3297-2174-61ff-943bfd88b749@uajain.com>","Date":"Tue, 27 Oct 2020 10:01:07 +0530","Mime-Version":"1.0","In-Reply-To":"<20201026210705.GD3756@pendragon.ideasonboard.com>","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [PATCH 1/3] android: jpeg: Return encoded\n\tbytes size from PostProcessorJpeg","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>","Cc":"libcamera-devel@lists.libcamera.org","Content-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]