[{"id":27866,"web_url":"https://patchwork.libcamera.org/comment/27866/","msgid":"<20230924185145.GB6390@pendragon.ideasonboard.com>","date":"2023-09-24T18:51:45","subject":"Re: [libcamera-devel] [PATCH RFC 4/7] android: camera_device:\n\tsupport when no Direct stream is found","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Mattijs,\n\nThank you for the patch.\n\nOn Fri, Sep 15, 2023 at 09:57:28AM +0200, Mattijs Korpershoek via libcamera-devel wrote:\n> As the comment states, it's possible that the first element in\n> streamConfig.streams is a Internal stream.\n> In that case sourceStream stays a nullptr and all the Mapped streams are\n> mapped towards a nullptr.\n> \n> Make sure that the Mapped streams are mapped to an Internal stream in case\n> that's the first element.\n> \n> Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>\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 1f7ce4402b63..d34bae715a47 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -724,7 +724,8 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n>  \t\t\t * be used when constructing the subsequent mapped\n>  \t\t\t * streams.\n>  \t\t\t */\n> -\t\t\tif (stream.type == CameraStream::Type::Direct)\n> +\t\t\tif (stream.type == CameraStream::Type::Direct ||\n> +\t\t\t    stream.type == CameraStream::Type::Internal)\n\nThis looks good, but I think the above comment should be updated.\n\ndiff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 25cedd44446d..130b04ffed6d 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -718,11 +718,10 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n\n \t\t\t/*\n \t\t\t * The streamConfig.streams vector contains as its first\n-\t\t\t * element a Direct (or Internal) stream, and then an\n-\t\t\t * optional set of Mapped streams derived from the\n-\t\t\t * Direct stream. Cache the Direct stream pointer, to\n-\t\t\t * be used when constructing the subsequent mapped\n-\t\t\t * streams.\n+\t\t\t * element a Direct or Internal stream, and then an\n+\t\t\t * optional set of Mapped streams derived from that\n+\t\t\t * stream. Cache the source stream pointer, to be used\n+\t\t\t * when constructing the subsequent mapped streams.\n \t\t\t */\n \t\t\tif (stream.type == CameraStream::Type::Direct)\n \t\t\t\tsourceStream = &streams_.back();\n\nWith this,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  \t\t\t\tsourceStream = &streams_.back();\n>  \t\t}\n>  \t}\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 141C5C326B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 24 Sep 2023 18:51:37 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6B45E62944;\n\tSun, 24 Sep 2023 20:51:36 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 098C762916\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 24 Sep 2023 20:51:35 +0200 (CEST)","from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi\n\t[213.243.189.158])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 03503842;\n\tSun, 24 Sep 2023 20:49:54 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1695581496;\n\tbh=hbOP15KBFXQReEB8B9nQZI2HeaERwdQKF8Wo+mhXm1k=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=uu25CMLRgFryD8gjkKP5uWE6pqQ0tDeIuNj8q/u6yprU5NW8sV801lnwfXXBlNIsZ\n\tBabvmG/C+asHZz930zTzFmrw2MqSCykykm5/vPdjww04fDubatNYNNQ1HZXsuWd9Of\n\tliXlXu236XX0cAyUHFytQFyzYCPuP27fsgHue4P92f8CdYIuP9RzZ71AUUAfH/cRDk\n\tk2tcpBS7ktxs4Lmnotr+sJQzrP0EyCpJi94H3xddxOQcC2ighjpFN/mRnCkjQ+R8dc\n\tiYnMch6ZxlyEAYsC/KGvntTXbDsMv2mEJZvaRJxHSvNhu/vsA40tkA01BiC7DONC7K\n\t4AmZaDio2D0zg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1695581395;\n\tbh=hbOP15KBFXQReEB8B9nQZI2HeaERwdQKF8Wo+mhXm1k=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=FD+k2Wxflf2xbLIVFQ/5V2a5lYqHbuG6uJTsTesmVTrG46YDws3yaxjwDPaBtAQmd\n\tvZzjy/YYPHm6orYKDuvqVYqeWmfnA6mbWQX6YTr2LHS8F5A9q6MMccHpHZMCj+D7Xm\n\t0djk23Rame/FikuGBUegkftpb74tBkX+Ck0yMSyk="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"FD+k2Wxf\"; dkim-atps=neutral","Date":"Sun, 24 Sep 2023 21:51:45 +0300","To":"Mattijs Korpershoek <mkorpershoek@baylibre.com>","Message-ID":"<20230924185145.GB6390@pendragon.ideasonboard.com>","References":"<20230915-libyuv-convert-v1-0-1e5bcf68adac@baylibre.com>\n\t<20230915-libyuv-convert-v1-4-1e5bcf68adac@baylibre.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20230915-libyuv-convert-v1-4-1e5bcf68adac@baylibre.com>","Subject":"Re: [libcamera-devel] [PATCH RFC 4/7] android: camera_device:\n\tsupport when no Direct stream is found","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tGuillaume La Roque <glaroque@baylibre.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]