[{"id":12320,"web_url":"https://patchwork.libcamera.org/comment/12320/","msgid":"<20200905214050.GK6319@pendragon.ideasonboard.com>","date":"2020-09-05T21:40:50","subject":"Re: [libcamera-devel] [PATCH v2 08/12] android: camera_device: Use\n\tcamera3 stream format","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Wed, Sep 02, 2020 at 05:22:32PM +0200, Jacopo Mondi wrote:\n> When iterating the camera3_stream_t received from the Android camera\n> framework to identify the MJPEG streams, the format check was performed\n> on the CameraStream created when iterating the non-MJPEG streams and not\n> on the format actually requested by Android. As the next patches will\n> remove the creation of CameraStream instances for MJPEG streams, use the\n> camera3_stream format to prepare for that.\n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/android/camera_device.cpp | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index ace7f6b17b4a..7fc61e3e4da7 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -1230,9 +1230,10 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n>  \t/* Now handle MJPEG streams, adding a new stream if required. */\n>  \tfor (unsigned int i = 0; i < stream_list->num_streams; ++i) {\n>  \t\tcamera3_stream_t *stream = stream_list->streams[i];\n> +\t\tPixelFormat format = toPixelFormat(stream->format);\n>  \t\tbool match = false;\n>  \n> -\t\tif (streams_[i].format != formats::MJPEG)\n> +\t\tif (format != formats::MJPEG)\n\nThis could also be\n\n\t\tif (stream->format != HAL_PIXEL_FORMAT_BLOB)\n\nto avoid the toPixelFormat() call.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  \t\t\tcontinue;\n>  \n>  \t\t/* Search for a compatible stream */","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 94BEEBDB1D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  5 Sep 2020 21:41:16 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 33E30629B6;\n\tSat,  5 Sep 2020 23:41:16 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9DCFC62901\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  5 Sep 2020 23:41:14 +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 161F2335;\n\tSat,  5 Sep 2020 23:41:14 +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=\"I9no0AuF\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1599342074;\n\tbh=dsiRYqmVpBTw30PbJUlVxEe2uqi51WJaQS4V8FzI6Hw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=I9no0AuFkFsye8mbvL9wPzi2H61kd9wjopOEpZduovdDjOPyqJN75Wmhe0RVf+M7m\n\tC2O0jSrg9K5eIsmffaQ/v3w0fjGyzPtYooT+lV+Kl8dYz1WIddaelt8X8hqpN8lRIb\n\tmrkhzmi5CplQafdkUU0FG/U95NqN5ek+ooxXFkSE=","Date":"Sun, 6 Sep 2020 00:40:50 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20200905214050.GK6319@pendragon.ideasonboard.com>","References":"<20200902152236.69770-1-jacopo@jmondi.org>\n\t<20200902152236.69770-9-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200902152236.69770-9-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v2 08/12] android: camera_device: Use\n\tcamera3 stream format","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":"tfiga@google.com, libcamera-devel@lists.libcamera.org, hiroh@google.com","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>"}}]