[{"id":12402,"web_url":"https://patchwork.libcamera.org/comment/12402/","msgid":"<20200910102916.GC4095624@oden.dyn.berto.se>","date":"2020-09-10T10:29:16","subject":"Re: [libcamera-devel] [PATCH v3 01/11] android: camera_device:\n\tRefuse unsupported formats","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Jacopo,\n\nThanks for your patch.\n\nOn 2020-09-08 15:41:32 +0200, Jacopo Mondi wrote:\n> The current implementation of CameraDevice::initializeStreamConfigurations()\n> fails if an image format marked as mandatory is not supported by the\n> libcamera::Camera device, but erroneously accepts non-mandatory\n> non-supported formats in the list of accepted ones.\n> \n> Fix this by ignoring non supported image formats which are not marked as\n> mandatory.\n> \n> Reviewed-by: Hirokazu Honda <hiroh@chromium.org>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  src/android/camera_device.cpp | 14 ++++++++++----\n>  1 file changed, 10 insertions(+), 4 deletions(-)\n> \n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index 25829918cd29..28fb3868c082 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -392,10 +392,16 @@ int CameraDevice::initializeStreamConfigurations()\n>  \t\t\t\tbreak;\n>  \t\t\t}\n>  \t\t}\n> -\t\tif (camera3Format.mandatory && !mappedFormat.isValid()) {\n> -\t\t\tLOG(HAL, Error) << \"Failed to map Android format \"\n> -\t\t\t\t\t<< camera3Format.name << \" (\"\n> -\t\t\t\t\t<< utils::hex(androidFormat) << \")\";\n> +\n> +\t\tif (!mappedFormat.isValid()) {\n> +\t\t\t/* If the format is not mandatory, skip it. */\n> +\t\t\tif (!camera3Format.mandatory)\n> +\t\t\t\tcontinue;\n> +\n> +\t\t\tLOG(HAL, Error)\n> +\t\t\t\t<< \"Failed to map mandatory Android format \"\n> +\t\t\t\t<< camera3Format.name << \" (\"\n> +\t\t\t\t<< utils::hex(androidFormat) << \"): aborting\";\n>  \t\t\treturn -EINVAL;\n>  \t\t}\n>  \n> -- \n> 2.28.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 9B35FBDB1D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 10 Sep 2020 10:29:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3860E62CE1;\n\tThu, 10 Sep 2020 12:29:19 +0200 (CEST)","from mail-lf1-x144.google.com (mail-lf1-x144.google.com\n\t[IPv6:2a00:1450:4864:20::144])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 70B8062C43\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Sep 2020 12:29:17 +0200 (CEST)","by mail-lf1-x144.google.com with SMTP id b12so3279767lfp.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Sep 2020 03:29:17 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tq2sm1467539ljp.118.2020.09.10.03.29.16\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 10 Sep 2020 03:29:16 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com\n\theader.b=\"rm4lHdxl\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=I7iLm4bUW5kpJrhAVD8TZVvwZS03oETadx7d9ChYGgY=;\n\tb=rm4lHdxl6TN9B7zzfBonpbOu0Nf1IiBs3INshDOrI+Cah/ZKO1WxWKWK1L+jlt47PC\n\toAoJQH4thw/al63kz2AkYs8pXoLlI5p0uF6wGmEh762nD7kV4FMK7pnFMjCyYLaEywni\n\t02HsMastIh4S6t+uUecx5Jdi2JrNpBzmbe2LrRBCwpcY28rV9aDvtL1eFyYTdo9bH/5M\n\tM67o9RgM0jK/yktEUmJwYCRbb4QFCGYO/9fS/nTlLih8VrMhn4HtNqmhe7ltXlCGJzf8\n\tvxt+G266lVtFsYI+GZkZCI01S6fIpygNysz2w+6qbXNDGrXmvuujDT/W2tWskvR0D6W7\n\tV73A==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=I7iLm4bUW5kpJrhAVD8TZVvwZS03oETadx7d9ChYGgY=;\n\tb=ErDf3BY7GR8gYKMjDlm2G+3FPGJpmnF6WCrdgqPVQyjmkQieX1EGl+oBofdEYy3ANl\n\tsUKZgMuzYl10HHzxYWb3iGgnkIfnSXF2EGUi8BDESGYbr20UJ91eh2FQjn/JpJu9JV3I\n\txFGObR/WUASwIPh7IUpAGL0LCQzn+knvrNyH6qQcGc/f3SvqO5K7Du9DTtsc3ke4xkF3\n\t0Z3E3dCy4swUQw2VQP8yHV6DAqQX32MeKOgxi5cKZN8IR7MKWlf8e/nHa2tRt4YnzYFO\n\tm2Mtsvn3aZNNYHRrm+vTIpV+0f71ejIppbd3jwc/WYX9WRU/K5dNRRF33Kf14ocTJ+/k\n\tfhHQ==","X-Gm-Message-State":"AOAM533Ve5Kcvm+h3OWsNTkW731TI8t4Z5TpzuJrg0z/hd5dcoQe+xsa\n\tBmT2VPPb2/XBy89tbchGoslTnA==","X-Google-Smtp-Source":"ABdhPJzc8SMyfxIluS1jzz6u8HJEP4SVRDJTemdKSclxLmqOOSJHjAfzxWacyIHDGbxX3+mGmRHfgA==","X-Received":"by 2002:a19:c608:: with SMTP id w8mr3862839lff.88.1599733756901; \n\tThu, 10 Sep 2020 03:29:16 -0700 (PDT)","Date":"Thu, 10 Sep 2020 12:29:16 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20200910102916.GC4095624@oden.dyn.berto.se>","References":"<20200908134142.27470-1-jacopo@jmondi.org>\n\t<20200908134142.27470-2-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200908134142.27470-2-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v3 01/11] android: camera_device:\n\tRefuse unsupported formats","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":"hanlinchen@chromium.org, libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"iso-8859-1\"","Content-Transfer-Encoding":"quoted-printable","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]