[{"id":12404,"web_url":"https://patchwork.libcamera.org/comment/12404/","msgid":"<20200910103602.GE4095624@oden.dyn.berto.se>","date":"2020-09-10T10:36:02","subject":"Re: [libcamera-devel] [PATCH v3 03/11] android: camera_device: Add\n\tdebug to stream initialization","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:34 +0200, Jacopo Mondi wrote:\n> Add debug printouts to the CameraDevice::initializeStreamConfigurations()\n> function that help to follow the process of building the stream\n> configurations map.\n> \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> ---\n>  src/android/camera_device.cpp | 23 ++++++++++++++++++++++-\n>  1 file changed, 22 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index 1b2e12d6d33c..17b5fd5f59eb 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -363,12 +363,19 @@ int CameraDevice::initializeStreamConfigurations()\n>  \t\tconst std::vector<PixelFormat> &libcameraFormats =\n>  \t\t\tcamera3Format.libcameraFormats;\n>  \n> +\t\tLOG(HAL, Debug) << \"Trying to map Android format \"\n> +\t\t\t\t<< camera3Format.name;\n> +\n>  \t\t/*\n>  \t\t * JPEG is always supported, either produced directly by the\n>  \t\t * camera, or encoded in the HAL.\n>  \t\t */\n>  \t\tif (androidFormat == HAL_PIXEL_FORMAT_BLOB) {\n>  \t\t\tformatsMap_[androidFormat] = formats::MJPEG;\n> +\t\t\tLOG(HAL, Debug) << \"Mapped Android format \"\n> +\t\t\t\t\t<< camera3Format.name << \" to \"\n> +\t\t\t\t\t<< formats::MJPEG.toString()\n> +\t\t\t\t\t<< \" (fixed mapping)\";\n>  \t\t\tcontinue;\n>  \t\t}\n>  \n> @@ -379,6 +386,8 @@ int CameraDevice::initializeStreamConfigurations()\n>  \t\tPixelFormat mappedFormat;\n>  \t\tfor (const PixelFormat &pixelFormat : libcameraFormats) {\n>  \n> +\t\t\tLOG(HAL, Debug) << \"Testing \" << pixelFormat.toString();\n> +\n>  \t\t\t/*\n>  \t\t\t * The stream configuration size can be adjusted,\n>  \t\t\t * not the pixel format.\n> @@ -414,14 +423,26 @@ int CameraDevice::initializeStreamConfigurations()\n>  \t\t * stream configurations map, by testing the image resolutions.\n>  \t\t */\n>  \t\tformatsMap_[androidFormat] = mappedFormat;\n> +\t\tLOG(HAL, Debug) << \"Mapped Android format \"\n> +\t\t\t\t<< camera3Format.name << \" to \"\n> +\t\t\t\t<< mappedFormat.toString();\n>  \n>  \t\tfor (const Size &res : cameraResolutions) {\n>  \t\t\tcfg.pixelFormat = mappedFormat;\n>  \t\t\tcfg.size = res;\n>  \n> +\t\t\tstd::stringstream ss;\n> +\t\t\tss << \"Testing \" << cfg.toString();\n\nnit: I would drop the std:;stringstream and either store the common part \nin a std::string or simply duplicated in both LOG() lines as I think it \nmakes the code easier to read.\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> +\n>  \t\t\tCameraConfiguration::Status status = cameraConfig->validate();\n> -\t\t\tif (status != CameraConfiguration::Valid)\n> +\t\t\tif (status != CameraConfiguration::Valid) {\n> +\t\t\t\tss << \" not supported\";\n> +\t\t\t\tLOG(HAL, Debug) << ss.str();\n>  \t\t\t\tcontinue;\n> +\t\t\t}\n> +\n> +\t\t\tss << \" supported\";\n> +\t\t\tLOG(HAL, Debug) << ss.str();\n>  \n>  \t\t\tstreamConfigurations_.push_back({ res, androidFormat });\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 03786C3B5B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 10 Sep 2020 10:36:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 734CD62D38;\n\tThu, 10 Sep 2020 12:36:05 +0200 (CEST)","from mail-lj1-x241.google.com (mail-lj1-x241.google.com\n\t[IPv6:2a00:1450:4864:20::241])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 585F762C43\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Sep 2020 12:36:04 +0200 (CEST)","by mail-lj1-x241.google.com with SMTP id a15so7529426ljk.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Sep 2020 03:36:04 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tq2sm1471987ljp.118.2020.09.10.03.36.03\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 10 Sep 2020 03:36:03 -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=\"0DyT5pwR\"; 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=1DA6in277pyVQaUmd/8d+jyjHwYjukkoEQ8GxkO2BAg=;\n\tb=0DyT5pwRuz8as3iIdtiH996hUvGdnviDp0szxbNaRLHmNJ7V1Ou5F6E1IrccjdD4vM\n\tGDqETCuqBxyYXlHpNNMa3wT1JgSMSNBZi14s0agBEUXnOQ7Sif1uWj1ABd9FfPM4mOkb\n\tmWB3VZF6oNlOIKWopwKM7EFIY2qerkClpqXu4dVlqPRE8RT4A/lbTJu4uO5dXqDlrRKo\n\tyl8N3oHDgCh7BgZmWNlAeGjH3tpC3ACIwHX3H0aFDyxp6OXFRpOkm2QJLd+2h3YkGJNV\n\tBR+3Tx9K6KWRMz5X8FlboERz8JDXOvQJXcrs3e500CgAlwdAB/5WGeu2BuRoxFpuKQpE\n\tMkPg==","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=1DA6in277pyVQaUmd/8d+jyjHwYjukkoEQ8GxkO2BAg=;\n\tb=f7623eTjCwJGZ5Inh9idEAQz33sFSXGl1K8ixZUXYy5qx9ThRTj9JJ6E8q6vfss28Y\n\tfEK0G+lvvKly4faj1xN/XBM8pv1yQp4Q5m+PNIVpdmBrD/ewKYP3M7ZRP3TPRzPxjPIj\n\tI5Q2+zwMuSbNpFm1SMjgB3SWR27YHA47NfHm160ZeY4Lx19PWu/OGL61sWOIssBtrpwk\n\tQ89D70sVZ5B79Lw9iZfgldU4g/JLRxAyZrXXrOdaJtrB6k2zN6/WogspRio43bDD3zbb\n\tssmG9rx/RI0I4J6mY5e7OdJSKAbA8+BMoF8kgfKhFjWUVpPYHGAzGsFlPpED2MtWh0k8\n\tYbWA==","X-Gm-Message-State":"AOAM532TI1FQWKVpRh8zgL9Zws4offDNAw6RBlbHyZfAt/j7AI0C5kEv\n\tOM6XAIweBkbM2jjAktj7grGccQ==","X-Google-Smtp-Source":"ABdhPJwoyN8lnzlDg1tU9icdxLP1tTSIvkQV6CdcAiAeBT6yXjOXcZoaOS15s1s196ODxOBjfgJIeg==","X-Received":"by 2002:a05:651c:106f:: with SMTP id\n\ty15mr4277155ljm.170.1599734163737; \n\tThu, 10 Sep 2020 03:36:03 -0700 (PDT)","Date":"Thu, 10 Sep 2020 12:36:02 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20200910103602.GE4095624@oden.dyn.berto.se>","References":"<20200908134142.27470-1-jacopo@jmondi.org>\n\t<20200908134142.27470-4-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200908134142.27470-4-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v3 03/11] android: camera_device: Add\n\tdebug to stream initialization","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>"}},{"id":12432,"web_url":"https://patchwork.libcamera.org/comment/12432/","msgid":"<CAO5uPHNksK=GvuJ-GFcqon+rQuwfdux63PSLQjFR7=oEpAsoJA@mail.gmail.com>","date":"2020-09-11T02:04:33","subject":"Re: [libcamera-devel] [PATCH v3 03/11] android: camera_device: Add\n\tdebug to stream initialization","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"On Thu, Sep 10, 2020 at 7:36 PM Niklas Söderlund\n<niklas.soderlund@ragnatech.se> wrote:\n>\n> Hi Jacopo,\n>\n> Thanks for your patch.\n>\n> On 2020-09-08 15:41:34 +0200, Jacopo Mondi wrote:\n> > Add debug printouts to the CameraDevice::initializeStreamConfigurations()\n> > function that help to follow the process of building the stream\n> > configurations map.\n> >\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> > ---\n> >  src/android/camera_device.cpp | 23 ++++++++++++++++++++++-\n> >  1 file changed, 22 insertions(+), 1 deletion(-)\n> >\n> > diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> > index 1b2e12d6d33c..17b5fd5f59eb 100644\n> > --- a/src/android/camera_device.cpp\n> > +++ b/src/android/camera_device.cpp\n> > @@ -363,12 +363,19 @@ int CameraDevice::initializeStreamConfigurations()\n> >               const std::vector<PixelFormat> &libcameraFormats =\n> >                       camera3Format.libcameraFormats;\n> >\n> > +             LOG(HAL, Debug) << \"Trying to map Android format \"\n> > +                             << camera3Format.name;\n> > +\n> >               /*\n> >                * JPEG is always supported, either produced directly by the\n> >                * camera, or encoded in the HAL.\n> >                */\n> >               if (androidFormat == HAL_PIXEL_FORMAT_BLOB) {\n> >                       formatsMap_[androidFormat] = formats::MJPEG;\n> > +                     LOG(HAL, Debug) << \"Mapped Android format \"\n> > +                                     << camera3Format.name << \" to \"\n> > +                                     << formats::MJPEG.toString()\n> > +                                     << \" (fixed mapping)\";\n> >                       continue;\n> >               }\n> >\n> > @@ -379,6 +386,8 @@ int CameraDevice::initializeStreamConfigurations()\n> >               PixelFormat mappedFormat;\n> >               for (const PixelFormat &pixelFormat : libcameraFormats) {\n> >\n> > +                     LOG(HAL, Debug) << \"Testing \" << pixelFormat.toString();\n> > +\n> >                       /*\n> >                        * The stream configuration size can be adjusted,\n> >                        * not the pixel format.\n> > @@ -414,14 +423,26 @@ int CameraDevice::initializeStreamConfigurations()\n> >                * stream configurations map, by testing the image resolutions.\n> >                */\n> >               formatsMap_[androidFormat] = mappedFormat;\n> > +             LOG(HAL, Debug) << \"Mapped Android format \"\n> > +                             << camera3Format.name << \" to \"\n> > +                             << mappedFormat.toString();\n> >\n> >               for (const Size &res : cameraResolutions) {\n> >                       cfg.pixelFormat = mappedFormat;\n> >                       cfg.size = res;\n> >\n> > +                     std::stringstream ss;\n> > +                     ss << \"Testing \" << cfg.toString();\n>\n> nit: I would drop the std:;stringstream and either store the common part\n> in a std::string or simply duplicated in both LOG() lines as I think it\n> makes the code easier to read.\n>\n> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n+1\nReviewed-by: Hirokazu Honda <hiroh@chromium.org>\n>\n> > +\n> >                       CameraConfiguration::Status status = cameraConfig->validate();\n> > -                     if (status != CameraConfiguration::Valid)\n> > +                     if (status != CameraConfiguration::Valid) {\n> > +                             ss << \" not supported\";\n> > +                             LOG(HAL, Debug) << ss.str();\n> >                               continue;\n> > +                     }\n> > +\n> > +                     ss << \" supported\";\n> > +                     LOG(HAL, Debug) << ss.str();\n> >\n> >                       streamConfigurations_.push_back({ res, androidFormat });\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\n>\n> --\n> Regards,\n> Niklas Söderlund\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 72B9DC3B5B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 11 Sep 2020 02:04:46 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0AC6462D38;\n\tFri, 11 Sep 2020 04:04:46 +0200 (CEST)","from mail-ej1-x642.google.com (mail-ej1-x642.google.com\n\t[IPv6:2a00:1450:4864:20::642])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6BA1F6037B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 11 Sep 2020 04:04:44 +0200 (CEST)","by mail-ej1-x642.google.com with SMTP id nw23so11646458ejb.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Sep 2020 19:04:44 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"ghtOjgCr\"; 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:content-transfer-encoding;\n\tbh=6Bdz+v39/UYRmY4DMGAerNOeX0nWwpD9eHY0l7W+TIE=;\n\tb=ghtOjgCrspQPKvomJ/ic5jNydn/Esz432dH1JUGTYt++7BuJGJAZX4wMGutzfdWHzJ\n\t1jdU+803zKUkx1Al2u+SCAtzH9KfBZc87PyBFa2XeOAeZuzGLw4SiMroXoGBzs8R1ytu\n\tCm5GLXeeZk+6ukWyfjjRRkLJixVPKVZ2gMCkU=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc:content-transfer-encoding;\n\tbh=6Bdz+v39/UYRmY4DMGAerNOeX0nWwpD9eHY0l7W+TIE=;\n\tb=lOiHXm8TPIh2/MPNxD6xhpHjhhqg4zahn4jvOfqC2rii3oTPyqBQ0E3xxN6ABbfiOY\n\t/yQBQJK1zFbzZFYJfM68eBo0pmjXS2G0IqygOzU7JJqXUkBChFpeGpqpaF8LqAE47YLM\n\t8S8Bgmu1ikO8JOK1yHvdP7QWLrS8ugFnVifVrwZXTgzwY4ZNtaO2kidCSFLecysh/Vix\n\tH9+I41RH4Xta0HOn8BcLpGUeKE3VQ0yy/TGTSX5mh9Ar9k+qpE2lAfIFUhfuWrIEwq4i\n\txJgxrF8bzJXD67pKHZbbsd7EePulxkg0xoxLmVjBP2R/rzSgdSlp40DcZwvVyyhJGY1o\n\titkg==","X-Gm-Message-State":"AOAM533zUNoKr6Kg1r0h31OkjnFho7gE5l/OXK1piJ2ZKTkLt7hfZZV/\n\tN/gkIDWBzjtlx1U4kEI8G60dcoz/xBm4ZK95+9DqAg==","X-Google-Smtp-Source":"ABdhPJz9DqWLLfysurUawl4tXGEPY5KgvhDddGUw0kdN/h1hzx1UV3w40AUhS8QkxTOf3xsqUbGK3OL05LM1wCxWhl8=","X-Received":"by 2002:a17:906:4553:: with SMTP id\n\ts19mr11441663ejq.475.1599789884004; \n\tThu, 10 Sep 2020 19:04:44 -0700 (PDT)","MIME-Version":"1.0","References":"<20200908134142.27470-1-jacopo@jmondi.org>\n\t<20200908134142.27470-4-jacopo@jmondi.org>\n\t<20200910103602.GE4095624@oden.dyn.berto.se>","In-Reply-To":"<20200910103602.GE4095624@oden.dyn.berto.se>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Fri, 11 Sep 2020 11:04:33 +0900","Message-ID":"<CAO5uPHNksK=GvuJ-GFcqon+rQuwfdux63PSLQjFR7=oEpAsoJA@mail.gmail.com>","To":"=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Subject":"Re: [libcamera-devel] [PATCH v3 03/11] android: camera_device: Add\n\tdebug to stream initialization","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":"Hanlin Chen <hanlinchen@chromium.org>,\n\tlibcamera-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>"}}]