[{"id":21248,"web_url":"https://patchwork.libcamera.org/comment/21248/","msgid":"<CAO5uPHPkT-iU6D4xCRMo4N2QP+sMEyPobhQ024+sXoCT+6uvEQ@mail.gmail.com>","date":"2021-11-25T13:15:41","subject":"Re: [libcamera-devel] [PATCH v2 2/2] android: Log stream types\n\tusing PixelFormat::toString()","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Hi Umang, thank you for the patch.\n\nOn Thu, Nov 25, 2021 at 10:12 PM Umang Jain <umang.jain@ideasonboard.com> wrote:\n>\n> Log stream types using PixelFormat::toString() instead of hex values,\n> since that is more human readable.\n>\n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n\nReviewed-by: Hirokazu Honda <hiroh@chromium.org>\n\n> ---\n>  src/android/camera_capabilities.cpp | 5 +++--\n>  src/android/camera_device.cpp       | 2 +-\n>  2 files changed, 4 insertions(+), 3 deletions(-)\n>\n> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> index f357902e..71f302c4 100644\n> --- a/src/android/camera_capabilities.cpp\n> +++ b/src/android/camera_capabilities.cpp\n> @@ -713,7 +713,8 @@ int CameraCapabilities::initializeStreamConfigurations()\n>         LOG(HAL, Debug) << \"Collected stream configuration map: \";\n>         for (const auto &entry : streamConfigurations_)\n>                 LOG(HAL, Debug) << \"{ \" << entry.resolution.toString() << \" - \"\n> -                               << utils::hex(entry.androidFormat) << \" }\";\n> +                               << toPixelFormat(entry.androidFormat).toString()\n> +                               << \" }\";\n>\n>         return 0;\n>  }\n> @@ -1303,7 +1304,7 @@ int CameraCapabilities::initializeStaticMetadata()\n>                 minFrameDurations.push_back(entry.minFrameDurationNsec);\n>\n>                 LOG(HAL, Debug)\n> -                       << \"Output Stream: \" << utils::hex(entry.androidFormat)\n> +                       << \"Output Stream: \" << toPixelFormat(entry.androidFormat).toString()\n>                         << \" (\" << entry.resolution.toString() << \")[\"\n>                         << entry.minFrameDurationNsec << \"]\"\n>                         << \"@\" << fps;\n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index ad4bf07c..cc6dccc1 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -566,7 +566,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n>                                << \", direction: \" << directionToString(stream->stream_type)\n>                                << \", width: \" << stream->width\n>                                << \", height: \" << stream->height\n> -                              << \", format: \" << utils::hex(stream->format)\n> +                              << \", format: \" << format.toString()\n>                                << \", rotation: \" << rotationToString(stream->rotation)\n>  #if defined(OS_CHROMEOS)\n>                                << \", crop_rotate_scale_degrees: \"\n> --\n> 2.31.0\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 0279DBDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 25 Nov 2021 13:15:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4352B6036F;\n\tThu, 25 Nov 2021 14:15:52 +0100 (CET)","from mail-ed1-x536.google.com (mail-ed1-x536.google.com\n\t[IPv6:2a00:1450:4864:20::536])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A5DFC60231\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Nov 2021 14:15:51 +0100 (CET)","by mail-ed1-x536.google.com with SMTP id y12so25409910eda.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Nov 2021 05:15:51 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"HpeL3fHZ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=6gKQUqksDWxajBBdPHZo3vXi/86hZ3ZDxwT/qvUrMnc=;\n\tb=HpeL3fHZuRyWFfxaJhDjzeV61UrFW8Z6zCnLIvmI1iU4+T1ppYWHlmooDZmuNHpR3L\n\tGnWdd4XORt4YCeFjYT86dHIdEow8mPSEDLjhBqSXAWQhbYlUr9Os7BflUxnvLRUht3yt\n\tCqNDh/KzUUg/hxUPSD6KmRxIJpV6km41u8+uU=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=6gKQUqksDWxajBBdPHZo3vXi/86hZ3ZDxwT/qvUrMnc=;\n\tb=Dp+J00yFAulKXKr7Pf86CuQxlrcr9pf6JrOY1zEm/2gWN+vVkoIkHPvuua/ag/u+9X\n\tJQ4NeWFGcNUuDNs9IJ/I8vftquRMFXQ7l1EhXgEGnw/j/hjnPf+HD9Rb2GYZQHKHozWN\n\twKqvUTjjo5yUPvumgLOosTa+rTWa9Ehxq0f4aYoNo2syNBm4KahXrTTOPX/nIFnC/Car\n\tltjDP8phtYoEG60B0jiP6QAboeY72/DAKihRfVCi7e7XqxPLOxX5+sv0LtCXV7MA4GlF\n\tQkA1ho/i5mOvuxfoqtS0PU+XzrNLQJ2U4lj17u2ESWHTGD2eh4yzXkfqocA1RaQCLk7c\n\tqY6g==","X-Gm-Message-State":"AOAM533JsDUqhpeANaSnQancsRZZiKTQDKGOw6QKgUX2XSW3CagJ4DNo\n\tyEP+5B+bmr+czOoWvcFFMS5Lht8GWWmrtYNnh1i3SKJSkFg=","X-Google-Smtp-Source":"ABdhPJyEkPOgilKg3VQNfM/fDS0+DjpcJ0D3tQkIpag6Nlg3kinlOn2Oc/oy6dT7c8S+zJxR1yYSbl3QBLPADUzPKhM=","X-Received":"by 2002:a17:907:6ea1:: with SMTP id\n\tsh33mr31422347ejc.150.1637846151119; \n\tThu, 25 Nov 2021 05:15:51 -0800 (PST)","MIME-Version":"1.0","References":"<20211125131224.927640-1-umang.jain@ideasonboard.com>\n\t<20211125131224.927640-3-umang.jain@ideasonboard.com>","In-Reply-To":"<20211125131224.927640-3-umang.jain@ideasonboard.com>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Thu, 25 Nov 2021 22:15:41 +0900","Message-ID":"<CAO5uPHPkT-iU6D4xCRMo4N2QP+sMEyPobhQ024+sXoCT+6uvEQ@mail.gmail.com>","To":"Umang Jain <umang.jain@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v2 2/2] android: Log stream types\n\tusing PixelFormat::toString()","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","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21249,"web_url":"https://patchwork.libcamera.org/comment/21249/","msgid":"<163784689108.3059017.11213513768084701192@Monstersaurus>","date":"2021-11-25T13:28:11","subject":"Re: [libcamera-devel] [PATCH v2 2/2] android: Log stream types\n\tusing PixelFormat::toString()","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Umang Jain (2021-11-25 13:12:24)\n> Log stream types using PixelFormat::toString() instead of hex values,\n> since that is more human readable.\n> \n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n>  src/android/camera_capabilities.cpp | 5 +++--\n>  src/android/camera_device.cpp       | 2 +-\n>  2 files changed, 4 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> index f357902e..71f302c4 100644\n> --- a/src/android/camera_capabilities.cpp\n> +++ b/src/android/camera_capabilities.cpp\n> @@ -713,7 +713,8 @@ int CameraCapabilities::initializeStreamConfigurations()\n>         LOG(HAL, Debug) << \"Collected stream configuration map: \";\n>         for (const auto &entry : streamConfigurations_)\n>                 LOG(HAL, Debug) << \"{ \" << entry.resolution.toString() << \" - \"\n> -                               << utils::hex(entry.androidFormat) << \" }\";\n> +                               << toPixelFormat(entry.androidFormat).toString()\n\nDo all androidFormats get correctly converted to libcamera formats\ncurrently?\n\nThis might still need to print the Android format, or have an android\nspecific string function... (Or print both the android hex string, and\nour representation of it?)\n\n\n> +                               << \" }\";\n>  \n>         return 0;\n>  }\n> @@ -1303,7 +1304,7 @@ int CameraCapabilities::initializeStaticMetadata()\n>                 minFrameDurations.push_back(entry.minFrameDurationNsec);\n>  \n>                 LOG(HAL, Debug)\n> -                       << \"Output Stream: \" << utils::hex(entry.androidFormat)\n> +                       << \"Output Stream: \" << toPixelFormat(entry.androidFormat).toString()\n>                         << \" (\" << entry.resolution.toString() << \")[\"\n>                         << entry.minFrameDurationNsec << \"]\"\n>                         << \"@\" << fps;\n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index ad4bf07c..cc6dccc1 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -566,7 +566,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n>                                << \", direction: \" << directionToString(stream->stream_type)\n>                                << \", width: \" << stream->width\n>                                << \", height: \" << stream->height\n> -                              << \", format: \" << utils::hex(stream->format)\n> +                              << \", format: \" << format.toString()\n>                                << \", rotation: \" << rotationToString(stream->rotation)\n>  #if defined(OS_CHROMEOS)\n>                                << \", crop_rotate_scale_degrees: \"\n> -- \n> 2.31.0\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 A677EBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 25 Nov 2021 13:28:16 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DADDB6036F;\n\tThu, 25 Nov 2021 14:28:15 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E60F360231\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Nov 2021 14:28:13 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 700F990E;\n\tThu, 25 Nov 2021 14:28:13 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"sbSFjszz\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1637846893;\n\tbh=Wx9SE6NqWJSGPUY/dkHKiffnYurgHWPL58APmnud7uE=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=sbSFjszz20YoQtfLL8BG2lDqJPfpW22OEVHYMaIF2wn3QmH0QQF/UtKBuaRSRuxGb\n\tTQTlVk+txI/3fZ0RUCsBaO5SMK62V6E+BVUEJHOTrGN4aWuSRhJHMF/e4hHf+481r/\n\tTtOmeZ8ic61vhgz6+rYDPjYXQferFg+/addq4PUo=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20211125131224.927640-3-umang.jain@ideasonboard.com>","References":"<20211125131224.927640-1-umang.jain@ideasonboard.com>\n\t<20211125131224.927640-3-umang.jain@ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Umang Jain <umang.jain@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 25 Nov 2021 13:28:11 +0000","Message-ID":"<163784689108.3059017.11213513768084701192@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v2 2/2] android: Log stream types\n\tusing PixelFormat::toString()","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21250,"web_url":"https://patchwork.libcamera.org/comment/21250/","msgid":"<74afae3a-c6da-7ba2-204a-70bc77d778cc@ideasonboard.com>","date":"2021-11-25T13:45:32","subject":"Re: [libcamera-devel] [PATCH v2 2/2] android: Log stream types\n\tusing PixelFormat::toString()","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Kieran,\n\nOn 11/25/21 6:58 PM, Kieran Bingham wrote:\n> Quoting Umang Jain (2021-11-25 13:12:24)\n>> Log stream types using PixelFormat::toString() instead of hex values,\n>> since that is more human readable.\n>>\n>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n>> ---\n>>   src/android/camera_capabilities.cpp | 5 +++--\n>>   src/android/camera_device.cpp       | 2 +-\n>>   2 files changed, 4 insertions(+), 3 deletions(-)\n>>\n>> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n>> index f357902e..71f302c4 100644\n>> --- a/src/android/camera_capabilities.cpp\n>> +++ b/src/android/camera_capabilities.cpp\n>> @@ -713,7 +713,8 @@ int CameraCapabilities::initializeStreamConfigurations()\n>>          LOG(HAL, Debug) << \"Collected stream configuration map: \";\n>>          for (const auto &entry : streamConfigurations_)\n>>                  LOG(HAL, Debug) << \"{ \" << entry.resolution.toString() << \" - \"\n>> -                               << utils::hex(entry.androidFormat) << \" }\";\n>> +                               << toPixelFormat(entry.androidFormat).toString()\n> Do all androidFormats get correctly converted to libcamera formats\n> currently?\n\n\nYes, that's my interpretation of toPixelFormat()\n\n>\n> This might still need to print the Android format, or have an android\n> specific string function... (Or print both the android hex string, and\n> our representation of it?)\n\n\nIf the format is not supported, toPixelFormat shall print an Error about \nthe unsupported format (along with it's hex string)\n\n         if (it == formatsMap_.end()) {\n             LOG(HAL, Error) << \"Requested format \" << utils::hex(format)\n                     << \" not supported\";\n\n>\n>\n>> +                               << \" }\";\n>>   \n>>          return 0;\n>>   }\n>> @@ -1303,7 +1304,7 @@ int CameraCapabilities::initializeStaticMetadata()\n>>                  minFrameDurations.push_back(entry.minFrameDurationNsec);\n>>   \n>>                  LOG(HAL, Debug)\n>> -                       << \"Output Stream: \" << utils::hex(entry.androidFormat)\n>> +                       << \"Output Stream: \" << toPixelFormat(entry.androidFormat).toString()\n>>                          << \" (\" << entry.resolution.toString() << \")[\"\n>>                          << entry.minFrameDurationNsec << \"]\"\n>>                          << \"@\" << fps;\n>> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n>> index ad4bf07c..cc6dccc1 100644\n>> --- a/src/android/camera_device.cpp\n>> +++ b/src/android/camera_device.cpp\n>> @@ -566,7 +566,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n>>                                 << \", direction: \" << directionToString(stream->stream_type)\n>>                                 << \", width: \" << stream->width\n>>                                 << \", height: \" << stream->height\n>> -                              << \", format: \" << utils::hex(stream->format)\n>> +                              << \", format: \" << format.toString()\n>>                                 << \", rotation: \" << rotationToString(stream->rotation)\n>>   #if defined(OS_CHROMEOS)\n>>                                 << \", crop_rotate_scale_degrees: \"\n>> -- \n>> 2.31.0\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 8BC90BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 25 Nov 2021 13:45:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D67B96036F;\n\tThu, 25 Nov 2021 14:45:40 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6677F60231\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Nov 2021 14:45:39 +0100 (CET)","from [192.168.1.106] (unknown [103.251.226.170])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5DFF390E;\n\tThu, 25 Nov 2021 14:45:38 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"szUUFojn\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1637847939;\n\tbh=AtwqHSgYM1e36oLf9EgE7ARR4mSWiHQHxCdQjz9Hkls=;\n\th=Subject:To:References:From:Date:In-Reply-To:From;\n\tb=szUUFojnblZKnWSkcgf1PZBXCynpejbPwAJWFNu4PS4uv3fA+9q9TxiDhnb7wLZn4\n\tZocobm7neXcsA+2dsD/UNALczibcwHeYD4Wp4o6kFaUAyFn2E7G1Y+meELJ8NPbfcR\n\t6KcrE4oy58ZQwUZXJhPHRM2BX1NjcBaXgVpn+xDA=","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20211125131224.927640-1-umang.jain@ideasonboard.com>\n\t<20211125131224.927640-3-umang.jain@ideasonboard.com>\n\t<163784689108.3059017.11213513768084701192@Monstersaurus>","From":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<74afae3a-c6da-7ba2-204a-70bc77d778cc@ideasonboard.com>","Date":"Thu, 25 Nov 2021 19:15:32 +0530","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.10.2","MIME-Version":"1.0","In-Reply-To":"<163784689108.3059017.11213513768084701192@Monstersaurus>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"8bit","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [PATCH v2 2/2] android: Log stream types\n\tusing PixelFormat::toString()","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21252,"web_url":"https://patchwork.libcamera.org/comment/21252/","msgid":"<YZ+UfCrIfm6C6usC@pendragon.ideasonboard.com>","date":"2021-11-25T13:49:48","subject":"Re: [libcamera-devel] [PATCH v2 2/2] android: Log stream types\n\tusing PixelFormat::toString()","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Thu, Nov 25, 2021 at 01:28:11PM +0000, Kieran Bingham wrote:\n> Quoting Umang Jain (2021-11-25 13:12:24)\n> > Log stream types using PixelFormat::toString() instead of hex values,\n> > since that is more human readable.\n> > \n> > Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> > ---\n> >  src/android/camera_capabilities.cpp | 5 +++--\n> >  src/android/camera_device.cpp       | 2 +-\n> >  2 files changed, 4 insertions(+), 3 deletions(-)\n> > \n> > diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> > index f357902e..71f302c4 100644\n> > --- a/src/android/camera_capabilities.cpp\n> > +++ b/src/android/camera_capabilities.cpp\n> > @@ -713,7 +713,8 @@ int CameraCapabilities::initializeStreamConfigurations()\n> >         LOG(HAL, Debug) << \"Collected stream configuration map: \";\n> >         for (const auto &entry : streamConfigurations_)\n> >                 LOG(HAL, Debug) << \"{ \" << entry.resolution.toString() << \" - \"\n> > -                               << utils::hex(entry.androidFormat) << \" }\";\n> > +                               << toPixelFormat(entry.androidFormat).toString()\n> \n> Do all androidFormats get correctly converted to libcamera formats\n> currently?\n> \n> This might still need to print the Android format, or have an android\n> specific string function... (Or print both the android hex string, and\n> our representation of it?)\n\nThat's also my concern. If we receive from the camera service a format\nwe don't support, printing an \"unknown\" or similar name hinders\ndebugging. I'd rather keep the android format in hex in the locations\nbefore we validate it.\n\n> > +                               << \" }\";\n> >  \n> >         return 0;\n> >  }\n> > @@ -1303,7 +1304,7 @@ int CameraCapabilities::initializeStaticMetadata()\n> >                 minFrameDurations.push_back(entry.minFrameDurationNsec);\n> >  \n> >                 LOG(HAL, Debug)\n> > -                       << \"Output Stream: \" << utils::hex(entry.androidFormat)\n> > +                       << \"Output Stream: \" << toPixelFormat(entry.androidFormat).toString()\n> >                         << \" (\" << entry.resolution.toString() << \")[\"\n> >                         << entry.minFrameDurationNsec << \"]\"\n> >                         << \"@\" << fps;\n> > diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> > index ad4bf07c..cc6dccc1 100644\n> > --- a/src/android/camera_device.cpp\n> > +++ b/src/android/camera_device.cpp\n> > @@ -566,7 +566,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n> >                                << \", direction: \" << directionToString(stream->stream_type)\n> >                                << \", width: \" << stream->width\n> >                                << \", height: \" << stream->height\n> > -                              << \", format: \" << utils::hex(stream->format)\n> > +                              << \", format: \" << format.toString()\n> >                                << \", rotation: \" << rotationToString(stream->rotation)\n> >  #if defined(OS_CHROMEOS)\n> >                                << \", crop_rotate_scale_degrees: \"","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 342A8BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 25 Nov 2021 13:50:14 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9DF676033C;\n\tThu, 25 Nov 2021 14:50:13 +0100 (CET)","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 D4B8760233\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Nov 2021 14:50:11 +0100 (CET)","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 48ACF90E;\n\tThu, 25 Nov 2021 14:50:11 +0100 (CET)"],"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=\"HD5t6daD\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1637848211;\n\tbh=7THY/+H2EONOAoXQxzoPtgzY8dAvLhN9bNdU2wb3otU=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=HD5t6daDMqRdqCyz4rGOpipdtmNnuSynO3bTGfPrG+FqndWcHf8Cp1qdtRT2DB2Vv\n\tLDrsxRNFlCDTEWhY/b1iaoEvZQdUEHOMumUh/Qk6XDT95HMvaOBxr/LrlPt7W2IDHM\n\t8sf3W1AqwirzXvaD91r7kT4x2+tOVAKsI9EcDhok=","Date":"Thu, 25 Nov 2021 15:49:48 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<YZ+UfCrIfm6C6usC@pendragon.ideasonboard.com>","References":"<20211125131224.927640-1-umang.jain@ideasonboard.com>\n\t<20211125131224.927640-3-umang.jain@ideasonboard.com>\n\t<163784689108.3059017.11213513768084701192@Monstersaurus>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<163784689108.3059017.11213513768084701192@Monstersaurus>","Subject":"Re: [libcamera-devel] [PATCH v2 2/2] android: Log stream types\n\tusing PixelFormat::toString()","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","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21253,"web_url":"https://patchwork.libcamera.org/comment/21253/","msgid":"<163784976183.3059017.2078398430137213821@Monstersaurus>","date":"2021-11-25T14:16:01","subject":"Re: [libcamera-devel] [PATCH v2 2/2] android: Log stream types\n\tusing PixelFormat::toString()","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2021-11-25 13:49:48)\n> On Thu, Nov 25, 2021 at 01:28:11PM +0000, Kieran Bingham wrote:\n> > Quoting Umang Jain (2021-11-25 13:12:24)\n> > > Log stream types using PixelFormat::toString() instead of hex values,\n> > > since that is more human readable.\n> > > \n> > > Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> > > ---\n> > >  src/android/camera_capabilities.cpp | 5 +++--\n> > >  src/android/camera_device.cpp       | 2 +-\n> > >  2 files changed, 4 insertions(+), 3 deletions(-)\n> > > \n> > > diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> > > index f357902e..71f302c4 100644\n> > > --- a/src/android/camera_capabilities.cpp\n> > > +++ b/src/android/camera_capabilities.cpp\n> > > @@ -713,7 +713,8 @@ int CameraCapabilities::initializeStreamConfigurations()\n> > >         LOG(HAL, Debug) << \"Collected stream configuration map: \";\n> > >         for (const auto &entry : streamConfigurations_)\n> > >                 LOG(HAL, Debug) << \"{ \" << entry.resolution.toString() << \" - \"\n> > > -                               << utils::hex(entry.androidFormat) << \" }\";\n> > > +                               << toPixelFormat(entry.androidFormat).toString()\n> > \n> > Do all androidFormats get correctly converted to libcamera formats\n> > currently?\n> > \n> > This might still need to print the Android format, or have an android\n> > specific string function... (Or print both the android hex string, and\n> > our representation of it?)\n> \n> That's also my concern. If we receive from the camera service a format\n> we don't support, printing an \"unknown\" or similar name hinders\n> debugging. I'd rather keep the android format in hex in the locations\n> before we validate it.\n\nI think we should have both. Or only print the hex if it's unknown ...\n\n--\nKieran\n\n\n> \n> > > +                               << \" }\";\n> > >  \n> > >         return 0;\n> > >  }\n> > > @@ -1303,7 +1304,7 @@ int CameraCapabilities::initializeStaticMetadata()\n> > >                 minFrameDurations.push_back(entry.minFrameDurationNsec);\n> > >  \n> > >                 LOG(HAL, Debug)\n> > > -                       << \"Output Stream: \" << utils::hex(entry.androidFormat)\n> > > +                       << \"Output Stream: \" << toPixelFormat(entry.androidFormat).toString()\n> > >                         << \" (\" << entry.resolution.toString() << \")[\"\n> > >                         << entry.minFrameDurationNsec << \"]\"\n> > >                         << \"@\" << fps;\n> > > diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> > > index ad4bf07c..cc6dccc1 100644\n> > > --- a/src/android/camera_device.cpp\n> > > +++ b/src/android/camera_device.cpp\n> > > @@ -566,7 +566,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n> > >                                << \", direction: \" << directionToString(stream->stream_type)\n> > >                                << \", width: \" << stream->width\n> > >                                << \", height: \" << stream->height\n> > > -                              << \", format: \" << utils::hex(stream->format)\n> > > +                              << \", format: \" << format.toString()\n> > >                                << \", rotation: \" << rotationToString(stream->rotation)\n> > >  #if defined(OS_CHROMEOS)\n> > >                                << \", crop_rotate_scale_degrees: \"\n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","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 A068EBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 25 Nov 2021 14:16:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DB2996036F;\n\tThu, 25 Nov 2021 15:16:05 +0100 (CET)","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 7100360231\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Nov 2021 15:16:04 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0522390E;\n\tThu, 25 Nov 2021 15:16:03 +0100 (CET)"],"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=\"qQPqIeel\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1637849764;\n\tbh=CBkMRegyPLPZ/SFDs76QzlpD5VfWKQSiHwPcE+0NCos=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=qQPqIeelMTO/eWd/X6pDiLQtGubwf5RRaTd4uaS4FCbxanByFXKAyEcdC5WL/9nS2\n\tPXvo1yejAZeuHYwddoPvy6ggLt1tO0iw57uRpB8yoECZ+cIHy1ioz3Cb/3RKHUfnho\n\ta5FpyCHLty9e1Ds/EWmDVNSGFqJQMIlSheVNfdg8=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<YZ+UfCrIfm6C6usC@pendragon.ideasonboard.com>","References":"<20211125131224.927640-1-umang.jain@ideasonboard.com>\n\t<20211125131224.927640-3-umang.jain@ideasonboard.com>\n\t<163784689108.3059017.11213513768084701192@Monstersaurus>\n\t<YZ+UfCrIfm6C6usC@pendragon.ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Thu, 25 Nov 2021 14:16:01 +0000","Message-ID":"<163784976183.3059017.2078398430137213821@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v2 2/2] android: Log stream types\n\tusing PixelFormat::toString()","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","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21254,"web_url":"https://patchwork.libcamera.org/comment/21254/","msgid":"<98d5b18e-b9bb-6a89-238d-55043deace54@ideasonboard.com>","date":"2021-11-25T14:25:01","subject":"Re: [libcamera-devel] [PATCH v2 2/2] android: Log stream types\n\tusing PixelFormat::toString()","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi\n\nOn 11/25/21 7:46 PM, Kieran Bingham wrote:\n> Quoting Laurent Pinchart (2021-11-25 13:49:48)\n>> On Thu, Nov 25, 2021 at 01:28:11PM +0000, Kieran Bingham wrote:\n>>> Quoting Umang Jain (2021-11-25 13:12:24)\n>>>> Log stream types using PixelFormat::toString() instead of hex values,\n>>>> since that is more human readable.\n>>>>\n>>>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n>>>> ---\n>>>>   src/android/camera_capabilities.cpp | 5 +++--\n>>>>   src/android/camera_device.cpp       | 2 +-\n>>>>   2 files changed, 4 insertions(+), 3 deletions(-)\n>>>>\n>>>> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n>>>> index f357902e..71f302c4 100644\n>>>> --- a/src/android/camera_capabilities.cpp\n>>>> +++ b/src/android/camera_capabilities.cpp\n>>>> @@ -713,7 +713,8 @@ int CameraCapabilities::initializeStreamConfigurations()\n>>>>          LOG(HAL, Debug) << \"Collected stream configuration map: \";\n>>>>          for (const auto &entry : streamConfigurations_)\n>>>>                  LOG(HAL, Debug) << \"{ \" << entry.resolution.toString() << \" - \"\n>>>> -                               << utils::hex(entry.androidFormat) << \" }\";\n>>>> +                               << toPixelFormat(entry.androidFormat).toString()\n>>> Do all androidFormats get correctly converted to libcamera formats\n>>> currently?\n>>>\n>>> This might still need to print the Android format, or have an android\n>>> specific string function... (Or print both the android hex string, and\n>>> our representation of it?)\n>> That's also my concern. If we receive from the camera service a format\n>> we don't support, printing an \"unknown\" or similar name hinders\n>> debugging. I'd rather keep the android format in hex in the locations\n>> before we validate it.\n> I think we should have both. Or only print the hex if it's unknown ...\n\n\nIn that case, the hex is printed if the format is unknown as part of \nError logging. It is done through CameraCapabilites::toPixelFormat()\n\n>\n> --\n> Kieran\n>\n>\n>>>> +                               << \" }\";\n>>>>   \n>>>>          return 0;\n>>>>   }\n>>>> @@ -1303,7 +1304,7 @@ int CameraCapabilities::initializeStaticMetadata()\n>>>>                  minFrameDurations.push_back(entry.minFrameDurationNsec);\n>>>>   \n>>>>                  LOG(HAL, Debug)\n>>>> -                       << \"Output Stream: \" << utils::hex(entry.androidFormat)\n>>>> +                       << \"Output Stream: \" << toPixelFormat(entry.androidFormat).toString()\n>>>>                          << \" (\" << entry.resolution.toString() << \")[\"\n>>>>                          << entry.minFrameDurationNsec << \"]\"\n>>>>                          << \"@\" << fps;\n>>>> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n>>>> index ad4bf07c..cc6dccc1 100644\n>>>> --- a/src/android/camera_device.cpp\n>>>> +++ b/src/android/camera_device.cpp\n>>>> @@ -566,7 +566,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n>>>>                                 << \", direction: \" << directionToString(stream->stream_type)\n>>>>                                 << \", width: \" << stream->width\n>>>>                                 << \", height: \" << stream->height\n>>>> -                              << \", format: \" << utils::hex(stream->format)\n>>>> +                              << \", format: \" << format.toString()\n\n\nAlso, the 'format' here comes from\n\n         PixelFormat format = capabilities_.toPixelFormat(stream->format);\n\na few lines above.\n\n>>>>                                 << \", rotation: \" << rotationToString(stream->rotation)\n>>>>   #if defined(OS_CHROMEOS)\n>>>>                                 << \", crop_rotate_scale_degrees: \"\n>> -- \n>> Regards,\n>>\n>> Laurent Pinchart","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 94AB8BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 25 Nov 2021 14:25:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F308160376;\n\tThu, 25 Nov 2021 15:25:07 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D42C160231\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Nov 2021 15:25:06 +0100 (CET)","from [192.168.1.106] (unknown [103.251.226.170])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 80C2890E;\n\tThu, 25 Nov 2021 15:25:05 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"UAumUVB/\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1637850306;\n\tbh=HnXhz+S2MpP5jpcp4knEIhhyIO9nYj0z6kmh+8mGolw=;\n\th=Subject:To:Cc:References:From:Date:In-Reply-To:From;\n\tb=UAumUVB/zi2lON5iWg+VHjfrY1yNPFoICN8U43PhUZKSM95CpKS+29rVDm0LKdafU\n\tOwpmc/Cog/jjbpgQ5RmIpTZIxf8OSkesdecb9htobiCrJMItaPak62I8bxDLYCL+Ob\n\t4hG2gDIX+ejqPDiQdF+lGUfe+m5kXP5C047W5oJQ=","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20211125131224.927640-1-umang.jain@ideasonboard.com>\n\t<20211125131224.927640-3-umang.jain@ideasonboard.com>\n\t<163784689108.3059017.11213513768084701192@Monstersaurus>\n\t<YZ+UfCrIfm6C6usC@pendragon.ideasonboard.com>\n\t<163784976183.3059017.2078398430137213821@Monstersaurus>","From":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<98d5b18e-b9bb-6a89-238d-55043deace54@ideasonboard.com>","Date":"Thu, 25 Nov 2021 19:55:01 +0530","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.10.2","MIME-Version":"1.0","In-Reply-To":"<163784976183.3059017.2078398430137213821@Monstersaurus>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"8bit","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [PATCH v2 2/2] android: Log stream types\n\tusing PixelFormat::toString()","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","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21260,"web_url":"https://patchwork.libcamera.org/comment/21260/","msgid":"<163787720463.3153335.4698981693380633142@Monstersaurus>","date":"2021-11-25T21:53:24","subject":"Re: [libcamera-devel] [PATCH v2 2/2] android: Log stream types\n\tusing PixelFormat::toString()","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Umang Jain (2021-11-25 14:25:01)\n> Hi\n> \n> On 11/25/21 7:46 PM, Kieran Bingham wrote:\n> > Quoting Laurent Pinchart (2021-11-25 13:49:48)\n> >> On Thu, Nov 25, 2021 at 01:28:11PM +0000, Kieran Bingham wrote:\n> >>> Quoting Umang Jain (2021-11-25 13:12:24)\n> >>>> Log stream types using PixelFormat::toString() instead of hex values,\n> >>>> since that is more human readable.\n> >>>>\n> >>>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> >>>> ---\n> >>>>   src/android/camera_capabilities.cpp | 5 +++--\n> >>>>   src/android/camera_device.cpp       | 2 +-\n> >>>>   2 files changed, 4 insertions(+), 3 deletions(-)\n> >>>>\n> >>>> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> >>>> index f357902e..71f302c4 100644\n> >>>> --- a/src/android/camera_capabilities.cpp\n> >>>> +++ b/src/android/camera_capabilities.cpp\n> >>>> @@ -713,7 +713,8 @@ int CameraCapabilities::initializeStreamConfigurations()\n> >>>>          LOG(HAL, Debug) << \"Collected stream configuration map: \";\n> >>>>          for (const auto &entry : streamConfigurations_)\n> >>>>                  LOG(HAL, Debug) << \"{ \" << entry.resolution.toString() << \" - \"\n> >>>> -                               << utils::hex(entry.androidFormat) << \" }\";\n> >>>> +                               << toPixelFormat(entry.androidFormat).toString()\n> >>> Do all androidFormats get correctly converted to libcamera formats\n> >>> currently?\n> >>>\n> >>> This might still need to print the Android format, or have an android\n> >>> specific string function... (Or print both the android hex string, and\n> >>> our representation of it?)\n> >> That's also my concern. If we receive from the camera service a format\n> >> we don't support, printing an \"unknown\" or similar name hinders\n> >> debugging. I'd rather keep the android format in hex in the locations\n> >> before we validate it.\n> > I think we should have both. Or only print the hex if it's unknown ...\n> \n> \n> In that case, the hex is printed if the format is unknown as part of \n> Error logging. It is done through CameraCapabilites::toPixelFormat()\n\nIn which case, I'd be content with this.\n\nLaurent?\n\n\n> >\n> > --\n> > Kieran\n> >\n> >\n> >>>> +                               << \" }\";\n> >>>>   \n> >>>>          return 0;\n> >>>>   }\n> >>>> @@ -1303,7 +1304,7 @@ int CameraCapabilities::initializeStaticMetadata()\n> >>>>                  minFrameDurations.push_back(entry.minFrameDurationNsec);\n> >>>>   \n> >>>>                  LOG(HAL, Debug)\n> >>>> -                       << \"Output Stream: \" << utils::hex(entry.androidFormat)\n> >>>> +                       << \"Output Stream: \" << toPixelFormat(entry.androidFormat).toString()\n> >>>>                          << \" (\" << entry.resolution.toString() << \")[\"\n> >>>>                          << entry.minFrameDurationNsec << \"]\"\n> >>>>                          << \"@\" << fps;\n> >>>> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> >>>> index ad4bf07c..cc6dccc1 100644\n> >>>> --- a/src/android/camera_device.cpp\n> >>>> +++ b/src/android/camera_device.cpp\n> >>>> @@ -566,7 +566,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n> >>>>                                 << \", direction: \" << directionToString(stream->stream_type)\n> >>>>                                 << \", width: \" << stream->width\n> >>>>                                 << \", height: \" << stream->height\n> >>>> -                              << \", format: \" << utils::hex(stream->format)\n> >>>> +                              << \", format: \" << format.toString()\n> \n> \n> Also, the 'format' here comes from\n> \n>          PixelFormat format = capabilities_.toPixelFormat(stream->format);\n> \n> a few lines above.\n> \n> >>>>                                 << \", rotation: \" << rotationToString(stream->rotation)\n> >>>>   #if defined(OS_CHROMEOS)\n> >>>>                                 << \", crop_rotate_scale_degrees: \"\n> >> -- \n> >> Regards,\n> >>\n> >> Laurent Pinchart","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 065D7BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 25 Nov 2021 21:53:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4FC366038B;\n\tThu, 25 Nov 2021 22:53:29 +0100 (CET)","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 398966022D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Nov 2021 22:53:27 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C65EC881;\n\tThu, 25 Nov 2021 22:53:26 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"jefgW+lE\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1637877206;\n\tbh=DvxNeB1FJnlPuGus+Sgo/galZfqh1dH3ZobKSCubusU=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=jefgW+lEMsI36qa4EIYEKjiclXoKsDnc/+3OT5hLxRjQcwGmtvNa2LP3ls3mr8D2z\n\t/A7OIoAH5ek8dLEwRxLK1YJqWoomYKDYWxRCBnH7Eq8Mit5gRz1BPkH/tshU3mQkPC\n\tkuvT10JPh3H++IHTGGJgyvlrM+keDHU7Cpji92vo=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<98d5b18e-b9bb-6a89-238d-55043deace54@ideasonboard.com>","References":"<20211125131224.927640-1-umang.jain@ideasonboard.com>\n\t<20211125131224.927640-3-umang.jain@ideasonboard.com>\n\t<163784689108.3059017.11213513768084701192@Monstersaurus>\n\t<YZ+UfCrIfm6C6usC@pendragon.ideasonboard.com>\n\t<163784976183.3059017.2078398430137213821@Monstersaurus>\n\t<98d5b18e-b9bb-6a89-238d-55043deace54@ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tUmang Jain <umang.jain@ideasonboard.com>","Date":"Thu, 25 Nov 2021 21:53:24 +0000","Message-ID":"<163787720463.3153335.4698981693380633142@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v2 2/2] android: Log stream types\n\tusing PixelFormat::toString()","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","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21261,"web_url":"https://patchwork.libcamera.org/comment/21261/","msgid":"<YaASPQ9MHUw/tguX@pendragon.ideasonboard.com>","date":"2021-11-25T22:46:21","subject":"Re: [libcamera-devel] [PATCH v2 2/2] android: Log stream types\n\tusing PixelFormat::toString()","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Thu, Nov 25, 2021 at 09:53:24PM +0000, Kieran Bingham wrote:\n> Quoting Umang Jain (2021-11-25 14:25:01)\n> > On 11/25/21 7:46 PM, Kieran Bingham wrote:\n> > > Quoting Laurent Pinchart (2021-11-25 13:49:48)\n> > >> On Thu, Nov 25, 2021 at 01:28:11PM +0000, Kieran Bingham wrote:\n> > >>> Quoting Umang Jain (2021-11-25 13:12:24)\n> > >>>> Log stream types using PixelFormat::toString() instead of hex values,\n> > >>>> since that is more human readable.\n> > >>>>\n> > >>>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> > >>>> ---\n> > >>>>   src/android/camera_capabilities.cpp | 5 +++--\n> > >>>>   src/android/camera_device.cpp       | 2 +-\n> > >>>>   2 files changed, 4 insertions(+), 3 deletions(-)\n> > >>>>\n> > >>>> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> > >>>> index f357902e..71f302c4 100644\n> > >>>> --- a/src/android/camera_capabilities.cpp\n> > >>>> +++ b/src/android/camera_capabilities.cpp\n> > >>>> @@ -713,7 +713,8 @@ int CameraCapabilities::initializeStreamConfigurations()\n> > >>>>          LOG(HAL, Debug) << \"Collected stream configuration map: \";\n> > >>>>          for (const auto &entry : streamConfigurations_)\n> > >>>>                  LOG(HAL, Debug) << \"{ \" << entry.resolution.toString() << \" - \"\n> > >>>> -                               << utils::hex(entry.androidFormat) << \" }\";\n> > >>>> +                               << toPixelFormat(entry.androidFormat).toString()\n> > >>>\n> > >>> Do all androidFormats get correctly converted to libcamera formats\n> > >>> currently?\n> > >>>\n> > >>> This might still need to print the Android format, or have an android\n> > >>> specific string function... (Or print both the android hex string, and\n> > >>> our representation of it?)\n> > >>\n> > >> That's also my concern. If we receive from the camera service a format\n> > >> we don't support, printing an \"unknown\" or similar name hinders\n> > >> debugging. I'd rather keep the android format in hex in the locations\n> > >> before we validate it.\n> > >\n> > > I think we should have both. Or only print the hex if it's unknown ...\n> > \n> > In that case, the hex is printed if the format is unknown as part of \n> > Error logging. It is done through CameraCapabilites::toPixelFormat()\n> \n> In which case, I'd be content with this.\n> \n> Laurent?\n\nI'm sorry, but it still bothers me a bit :-S The mapping between Android\nformats and libcamera formats isn't 1:1, we map multiple Android formats\nto NV21 for instance. With this patch we lose the ability to tell the\ndifferent Android formats apart.\n\nThe Camera3Format structure contains a name member. If we want to print\na name instead of the hex value, we should add a function that will use\nthe camera3FormatsMap to lookup the name and return something like\n\"Unknown (0x....)\" when the format isn't known.\n\n> > >>>> +                               << \" }\";\n> > >>>>   \n> > >>>>          return 0;\n> > >>>>   }\n> > >>>> @@ -1303,7 +1304,7 @@ int CameraCapabilities::initializeStaticMetadata()\n> > >>>>                  minFrameDurations.push_back(entry.minFrameDurationNsec);\n> > >>>>   \n> > >>>>                  LOG(HAL, Debug)\n> > >>>> -                       << \"Output Stream: \" << utils::hex(entry.androidFormat)\n> > >>>> +                       << \"Output Stream: \" << toPixelFormat(entry.androidFormat).toString()\n> > >>>>                          << \" (\" << entry.resolution.toString() << \")[\"\n> > >>>>                          << entry.minFrameDurationNsec << \"]\"\n> > >>>>                          << \"@\" << fps;\n> > >>>> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> > >>>> index ad4bf07c..cc6dccc1 100644\n> > >>>> --- a/src/android/camera_device.cpp\n> > >>>> +++ b/src/android/camera_device.cpp\n> > >>>> @@ -566,7 +566,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n> > >>>>                                 << \", direction: \" << directionToString(stream->stream_type)\n> > >>>>                                 << \", width: \" << stream->width\n> > >>>>                                 << \", height: \" << stream->height\n> > >>>> -                              << \", format: \" << utils::hex(stream->format)\n> > >>>> +                              << \", format: \" << format.toString()\n> > \n> > Also, the 'format' here comes from\n> > \n> >          PixelFormat format = capabilities_.toPixelFormat(stream->format);\n> > \n> > a few lines above.\n> > \n> > >>>>                                 << \", rotation: \" << rotationToString(stream->rotation)\n> > >>>>   #if defined(OS_CHROMEOS)\n> > >>>>                                 << \", crop_rotate_scale_degrees: \"","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 BD6D8BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 25 Nov 2021 22:46:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 045E960490;\n\tThu, 25 Nov 2021 23:46:48 +0100 (CET)","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 2464160423\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Nov 2021 23:46:46 +0100 (CET)","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 8B835881;\n\tThu, 25 Nov 2021 23:46:45 +0100 (CET)"],"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=\"kgP8QGON\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1637880405;\n\tbh=XIr80XI7Zbh0xIrY8Tp6Y3LXebbegw1F517Fk0Ppvpc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=kgP8QGON9Ro6SVntcjKafnXHQWopUFu/dQv3Frvxml/89X2kj0cYIlW6BeHDZFisR\n\tb2kF6E78nFjPh+ohdx2n9kOv+nW0P2pvrlUETOHTBLqLvuAta4MeszwPoig+JuY1gW\n\tjSg4ALskIw+Lc3ysSko6q8+TtS3xyxAPzlhwnCvs=","Date":"Fri, 26 Nov 2021 00:46:21 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<YaASPQ9MHUw/tguX@pendragon.ideasonboard.com>","References":"<20211125131224.927640-1-umang.jain@ideasonboard.com>\n\t<20211125131224.927640-3-umang.jain@ideasonboard.com>\n\t<163784689108.3059017.11213513768084701192@Monstersaurus>\n\t<YZ+UfCrIfm6C6usC@pendragon.ideasonboard.com>\n\t<163784976183.3059017.2078398430137213821@Monstersaurus>\n\t<98d5b18e-b9bb-6a89-238d-55043deace54@ideasonboard.com>\n\t<163787720463.3153335.4698981693380633142@Monstersaurus>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<163787720463.3153335.4698981693380633142@Monstersaurus>","Subject":"Re: [libcamera-devel] [PATCH v2 2/2] android: Log stream types\n\tusing PixelFormat::toString()","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","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]