[{"id":16115,"web_url":"https://patchwork.libcamera.org/comment/16115/","msgid":"<491f4ff0-22ce-03e6-7a3c-d4b4e9b1065b@ideasonboard.com>","date":"2021-04-03T17:31:42","subject":"Re: [libcamera-devel] [PATCH] android: CameraDevice: Deny if the\n\tstreams is empty","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Hiro,\n\nThanks for the patch.\n\nOn 4/3/21 6:48 PM, Hirokazu Honda wrote:\n> This checks if the number of streams is zero on configuration\n> and then returns -EINVAL.\n>\n> Signed-off-by: Hirokazu Honda <hiroh@chromium.org>\n> ---\n>   src/android/camera_device.cpp | 5 +++++\n>   1 file changed, 5 insertions(+)\n>\n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index eb327978..f175ce53 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -1554,6 +1554,11 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n>   \t\trunning_ = false;\n>   \t}\n>   \n> +\tif (stream_list->num_streams == 0) {\n> +\t\tLOG(HAL, Error) << \"Empty stream configuration\";\nThe error message can be better, something like:\n\n+\t\tLOG(HAL, Error) << \"Failed to find any stream for configuration\";\n\nOther than that:\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n> +\t\treturn -EINVAL;\n> +\t}\n> +\n>   \t/*\n>   \t * Generate an empty configuration, and construct a StreamConfiguration\n>   \t * for each camera3_stream to add to it.","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 55EBFC0DA3\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  3 Apr 2021 17:31:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8E3326877E;\n\tSat,  3 Apr 2021 19:31:50 +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 4225A602CF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  3 Apr 2021 19:31:49 +0200 (CEST)","from localhost.localdomain (unknown [103.238.109.24])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 40829AF0;\n\tSat,  3 Apr 2021 19:31:48 +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=\"VlgZDBPu\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1617471108;\n\tbh=/zT0oHco7X0NUEx1IcjODtp7qGrJKGktAT8Cbum2KVM=;\n\th=Subject:To:References:From:Date:In-Reply-To:From;\n\tb=VlgZDBPuHcAGb2ReCcg83u0+uAklSbDt2lgBzvgu+0Cm0d3oS2ltuODjVnmZmqmEf\n\tfPI22JuaKUK0+rzg2qdovvvsy4VEJNTYB1rJy+3Q/iAmeVNlgN4NEr286EIDuA+Pcp\n\t60UcgvN5408LadxmTtwk9O2/jAeUkeg+/DUDT7mk=","To":"Hirokazu Honda <hiroh@chromium.org>, libcamera-devel@lists.libcamera.org","References":"<20210403131828.1591652-1-hiroh@chromium.org>","From":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<491f4ff0-22ce-03e6-7a3c-d4b4e9b1065b@ideasonboard.com>","Date":"Sat, 3 Apr 2021 23:01:42 +0530","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101\n\tThunderbird/68.11.0","MIME-Version":"1.0","In-Reply-To":"<20210403131828.1591652-1-hiroh@chromium.org>","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [PATCH] android: CameraDevice: Deny if the\n\tstreams is empty","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-Transfer-Encoding":"7bit","Content-Type":"text/plain; charset=\"us-ascii\"; Format=\"flowed\"","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":16117,"web_url":"https://patchwork.libcamera.org/comment/16117/","msgid":"<YGjucgFnKWyG/mxb@pendragon.ideasonboard.com>","date":"2021-04-03T22:38:42","subject":"Re: [libcamera-devel] [PATCH] android: CameraDevice: Deny if the\n\tstreams is empty","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Hiro,\n\nThanks for the patch.\n\nOn Sat, Apr 03, 2021 at 11:01:42PM +0530, Umang Jain wrote:\n> On 4/3/21 6:48 PM, Hirokazu Honda wrote:\n> > This checks if the number of streams is zero on configuration\n> > and then returns -EINVAL.\n> >\n> > Signed-off-by: Hirokazu Honda <hiroh@chromium.org>\n> > ---\n> >   src/android/camera_device.cpp | 5 +++++\n> >   1 file changed, 5 insertions(+)\n> >\n> > diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> > index eb327978..f175ce53 100644\n> > --- a/src/android/camera_device.cpp\n> > +++ b/src/android/camera_device.cpp\n> > @@ -1554,6 +1554,11 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n> >   \t\trunning_ = false;\n> >   \t}\n> >   \n> > +\tif (stream_list->num_streams == 0) {\n> > +\t\tLOG(HAL, Error) << \"Empty stream configuration\";\n>\n> The error message can be better, something like:\n> \n> +\t\tLOG(HAL, Error) << \"Failed to find any stream for configuration\";\n\nThe original message is indeed slightly confusing as it means the\nconfiguration of one stream is empty. \"Empty streams configuration\"\nwould address that. It really doesn't matter much, as this error should\nreally never happen (it would signal a major bug in the camera service,\nI sometimes wonder if we're not too defensive against incorrect\nparameters), but nonetheless if we have an error message let's make it\nas clear as possible. I'll go for \"No streams in configuration\" and\napply.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> Other than that:\n> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n>\n> > +\t\treturn -EINVAL;\n> > +\t}\n> > +\n> >   \t/*\n> >   \t * Generate an empty configuration, and construct a StreamConfiguration\n> >   \t * for each camera3_stream to add to it.","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 17B93C0DA3\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  3 Apr 2021 22:39:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8C7DF602E6;\n\tSun,  4 Apr 2021 00:39:30 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 63E4D602E5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun,  4 Apr 2021 00:39:29 +0200 (CEST)","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 3DAB93D7;\n\tSun,  4 Apr 2021 00:39:28 +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=\"fhMrihyQ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1617489568;\n\tbh=2Ek/vS3EjzRKkhsEiQ6mGO4lGsNtfYEbVvFOgBMpcF4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=fhMrihyQqCFHh7vw4L5Gn+NbXMMgjQHYKgujETf/xNm7RsQdVLKmUdu9j/13hC67e\n\tZ9lUzr5IqU/qaL9VMY74gASJ6kEjAe31wQzClcugRliLhMuceTLAJkUnRx2BZtWJUS\n\tuUBhXf0HphR+UjDO6jj5P7FFEuubq71vtmov6lus=","Date":"Sun, 4 Apr 2021 01:38:42 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Hirokazu Honda <hiroh@chromium.org>","Message-ID":"<YGjucgFnKWyG/mxb@pendragon.ideasonboard.com>","References":"<20210403131828.1591652-1-hiroh@chromium.org>\n\t<491f4ff0-22ce-03e6-7a3c-d4b4e9b1065b@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<491f4ff0-22ce-03e6-7a3c-d4b4e9b1065b@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] android: CameraDevice: Deny if the\n\tstreams is empty","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>"}}]