[{"id":11691,"web_url":"https://patchwork.libcamera.org/comment/11691/","msgid":"<20200729083722.s64zmx5gapcplhtb@uno.localdomain>","date":"2020-07-29T08:37:22","subject":"Re: [libcamera-devel] [PATCH 1/3] android: camera_device: Skip\n\tinstead of fail if camera don't support format","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Niklas,\n\nOn Tue, Jul 28, 2020 at 08:55:46PM +0200, Niklas Söderlund wrote:\n> If the libcamera Camera don't support the Android format do not fail the\n> initialization. Instead skip adding the Android format to the list of\n> supported formats reported.\n>\n> This allows extending the camera3FormatsMap with Android formats not\n> supported by all libcamera Cameras and probe and report only the ones\n> that overlap.\n>\n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> ---\n>  src/android/camera_device.cpp | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index b49d6681e5a52d32..265627a98422bd67 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -282,10 +282,10 @@ int CameraDevice::initializeStreamConfigurations()\n>  \t\t\t}\n>  \t\t}\n>  \t\tif (!mappedFormat.isValid()) {\n> -\t\t\tLOG(HAL, Error) << \"Failed to map Android format \"\n> +\t\t\tLOG(HAL, Debug) << \"Failed to map Android format \"\n>  \t\t\t\t\t<< camera3Format.name << \" (\"\n>  \t\t\t\t\t<< utils::hex(androidFormat) << \")\";\n> -\t\t\treturn -EINVAL;\n> +\t\t\tcontinue;\n\nOk, I see where this is going, but I think we should now enforce that\nthe formats currently listed in Camera3FormatsMap, which if I'm not mistaken\nare mandatory to be supported, are actually supported by the Camera.\n\nHave a look at the documentation of android.scaler.availableStreamConfigurations\nand the below table. I think we need to re-loop on the streamConfigurations_\nvector and make sure we tick the box for the required formats.\n\n>  \t\t}\n>\n>  \t\t/*\n> --\n> 2.27.0\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","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 1A538BD878\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 29 Jul 2020 08:33:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 727CA613C6;\n\tWed, 29 Jul 2020 10:33:44 +0200 (CEST)","from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net\n\t[217.70.183.193])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5B15C605B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 Jul 2020 10:33:43 +0200 (CEST)","from uno.localdomain (93-34-118-233.ip49.fastwebnet.it\n\t[93.34.118.233]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay1-d.mail.gandi.net (Postfix) with ESMTPSA id A78AE24000B;\n\tWed, 29 Jul 2020 08:33:42 +0000 (UTC)"],"X-Originating-IP":"93.34.118.233","Date":"Wed, 29 Jul 2020 10:37:22 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Message-ID":"<20200729083722.s64zmx5gapcplhtb@uno.localdomain>","References":"<20200728185548.3361465-1-niklas.soderlund@ragnatech.se>\n\t<20200728185548.3361465-2-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200728185548.3361465-2-niklas.soderlund@ragnatech.se>","Subject":"Re: [libcamera-devel] [PATCH 1/3] android: camera_device: Skip\n\tinstead of fail if camera don't support 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":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]