[{"id":12403,"web_url":"https://patchwork.libcamera.org/comment/12403/","msgid":"<20200910103306.GD4095624@oden.dyn.berto.se>","date":"2020-09-10T10:33:06","subject":"Re: [libcamera-devel] [PATCH v3 02/11] android: camera_device:\n\tGenerate JPEG sizes","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 work.\n\nOn 2020-09-08 15:41:33 +0200, Jacopo Mondi wrote:\n> When producing the list of image resolutions to claim as supported by the\n> camera HAL, the JPEG stream was assumed to be 'always valid' as, at the\n> time, there was no JPEG support in place at all.\n> \n> With the introduction of support for JPEG compression, reporting\n> non-valid sizes as supported obviously causes troubles.\n> \n> In order to avoid reporting non-supported resolutions as supported,\n> produce the list of available JPEG sizes by using the ones supported\n> by the YCbCr_420_888 format, from which the JPEG stream is encoded.\n> \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 | 40 ++++++++++++++++++++++-------------\n>  1 file changed, 25 insertions(+), 15 deletions(-)\n> \n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index 28fb3868c082..1b2e12d6d33c 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -363,17 +363,21 @@ int CameraDevice::initializeStreamConfigurations()\n>  \t\tconst std::vector<PixelFormat> &libcameraFormats =\n>  \t\t\tcamera3Format.libcameraFormats;\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\tcontinue;\n> +\t\t}\n> +\n>  \t\t/*\n>  \t\t * Test the libcamera formats that can produce images\n>  \t\t * compatible with the format defined by Android.\n>  \t\t */\n>  \t\tPixelFormat mappedFormat;\n>  \t\tfor (const PixelFormat &pixelFormat : libcameraFormats) {\n> -\t\t\t/* \\todo Fixed mapping for JPEG. */\n> -\t\t\tif (androidFormat == HAL_PIXEL_FORMAT_BLOB) {\n> -\t\t\t\tmappedFormat = formats::MJPEG;\n> -\t\t\t\tbreak;\n> -\t\t\t}\n>  \n>  \t\t\t/*\n>  \t\t\t * The stream configuration size can be adjusted,\n> @@ -416,19 +420,25 @@ int CameraDevice::initializeStreamConfigurations()\n>  \t\t\tcfg.size = res;\n>  \n>  \t\t\tCameraConfiguration::Status status = cameraConfig->validate();\n> -\t\t\t/*\n> -\t\t\t * Unconditionally report we can produce JPEG.\n> -\t\t\t *\n> -\t\t\t * \\todo The JPEG stream will be implemented as an\n> -\t\t\t * HAL-only stream, but some cameras can produce it\n> -\t\t\t * directly. As of now, claim support for JPEG without\n> -\t\t\t * inspecting where the JPEG stream is produced.\n> -\t\t\t */\n> -\t\t\tif (androidFormat != HAL_PIXEL_FORMAT_BLOB &&\n> -\t\t\t    status != CameraConfiguration::Valid)\n> +\t\t\tif (status != CameraConfiguration::Valid)\n>  \t\t\t\tcontinue;\n>  \n>  \t\t\tstreamConfigurations_.push_back({ res, androidFormat });\n> +\n> +\t\t\t/*\n> +\t\t\t * If the format is HAL_PIXEL_FORMAT_YCbCr_420_888\n> +\t\t\t * from which JPEG is produced, add an entry for\n> +\t\t\t * the JPEG stream.\n> +\t\t\t *\n> +\t\t\t * \\todo Wire the JPEG encoder to query the supported\n> +\t\t\t * sizes provided a list of formats it can encode.\n\nnit: Is this needed? Are we expecting the JPEG encoder to reject some \nresolutions?\n\nIn any case,\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> +\t\t\t *\n> +\t\t\t * \\todo Support JPEG streams produced by the Camera\n> +\t\t\t * natively.\n> +\t\t\t */\n> +\t\t\tif (androidFormat == HAL_PIXEL_FORMAT_YCbCr_420_888)\n> +\t\t\t\tstreamConfigurations_.push_back(\n> +\t\t\t\t\t{ res, HAL_PIXEL_FORMAT_BLOB });\n>  \t\t}\n>  \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 517E6C3B5B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 10 Sep 2020 10:33:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DC02062CE1;\n\tThu, 10 Sep 2020 12:33:09 +0200 (CEST)","from mail-lj1-x244.google.com (mail-lj1-x244.google.com\n\t[IPv6:2a00:1450:4864:20::244])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5CDD162C43\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Sep 2020 12:33:08 +0200 (CEST)","by mail-lj1-x244.google.com with SMTP id k25so7446788ljg.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Sep 2020 03:33:08 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tw17sm1242741lfk.95.2020.09.10.03.33.07\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 10 Sep 2020 03:33:07 -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=\"UWmx/WJS\"; 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=dUxJX44KlJHDx8HfiaPjO5l43deGLFV0dRp85sllWJk=;\n\tb=UWmx/WJSSyKyl33ZYNa5V1WLuxO4HEzHP7vzrQoPrvufjBvVhXeZeyMFdBCBe3Y7SA\n\t7P19gIjfGmp089xsx6LSeZxe/L22/s1ItSMGUvDY9lH26pExB2ATwSn0YHqE4wkbdpKI\n\tJwEBdk1AZDSqN46yk0rHHo9t2sh6ltz6396bD9Op8yVvt4EBNvqSmhfeVJHjOjthLWiB\n\tUJeLcOFHS7TCGnfdeDaXm+wSI46JH8stwQZwXUJdPSQWDhRV9N3kF5eLpWNT79cQrwCA\n\tG3+tGTt89Np/B5QTvZUgRTRZuLuHjv1b+/J7gweoCDF2VCswaSlJi/E1OrBvrJa3ABEG\n\tAqZA==","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=dUxJX44KlJHDx8HfiaPjO5l43deGLFV0dRp85sllWJk=;\n\tb=geIKMisVa/wysWos3dhF9/Q0sznPTvT8e7XJ/i8sfDX/PVRSE0Pn/2ZpKlo+Urir+g\n\t9qYvWy65cIwwxgVikf2TPFFORfrF7eTtFuaaonKMErh743SPgYW6cIH7WguLAj7OGdme\n\tsKHuV+oTlAHF9TmupmFeQP1mCP0zvMejCLQEUWkk8+2cVWKbmR1N32WRSBRNmcnKMlIh\n\tZ7vpJTgVi4yfyacQFMNgwa1hst64l5Kx8uG57xWUn7b6KT2oqFPny6fliKvxj1LqOA0R\n\twP+u3q5gUj+a5zCYCI2wpt3JQCsZNzzBF0/P+9b+YjO/5m42FuershPGN4qi4pV1PZpS\n\tCf3g==","X-Gm-Message-State":"AOAM530hIAAAgNSqfYsB0+qouiCXZ0c69Fjobed4pDwe69T4PnRGj/Pg\n\tWQUa+bbez1cdmf3L+PFvEljISUX+X3OeCg==","X-Google-Smtp-Source":"ABdhPJwsIcRCbQSfSsK3+nDzQc6Tb6AcBWSOvKfAoCOR+lDtosniUGLXE/lHA+QKXNrDoSfO/n/ysg==","X-Received":"by 2002:a2e:898a:: with SMTP id c10mr3858650lji.4.1599733987789; \n\tThu, 10 Sep 2020 03:33:07 -0700 (PDT)","Date":"Thu, 10 Sep 2020 12:33:06 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20200910103306.GD4095624@oden.dyn.berto.se>","References":"<20200908134142.27470-1-jacopo@jmondi.org>\n\t<20200908134142.27470-3-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200908134142.27470-3-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v3 02/11] android: camera_device:\n\tGenerate JPEG sizes","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":12415,"web_url":"https://patchwork.libcamera.org/comment/12415/","msgid":"<20200910111424.3taj6b2h2wrrpgum@uno.localdomain>","date":"2020-09-10T11:14:24","subject":"Re: [libcamera-devel] [PATCH v3 02/11] android: camera_device:\n\tGenerate JPEG sizes","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Niklas,\n\nOn Thu, Sep 10, 2020 at 12:33:06PM +0200, Niklas Söderlund wrote:\n> Hi Jacopo,\n>\n> Thanks for your work.\n>\n> On 2020-09-08 15:41:33 +0200, Jacopo Mondi wrote:\n> > When producing the list of image resolutions to claim as supported by the\n> > camera HAL, the JPEG stream was assumed to be 'always valid' as, at the\n> > time, there was no JPEG support in place at all.\n> >\n> > With the introduction of support for JPEG compression, reporting\n> > non-valid sizes as supported obviously causes troubles.\n> >\n> > In order to avoid reporting non-supported resolutions as supported,\n> > produce the list of available JPEG sizes by using the ones supported\n> > by the YCbCr_420_888 format, from which the JPEG stream is encoded.\n> >\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 | 40 ++++++++++++++++++++++-------------\n> >  1 file changed, 25 insertions(+), 15 deletions(-)\n> >\n> > diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> > index 28fb3868c082..1b2e12d6d33c 100644\n> > --- a/src/android/camera_device.cpp\n> > +++ b/src/android/camera_device.cpp\n> > @@ -363,17 +363,21 @@ int CameraDevice::initializeStreamConfigurations()\n> >  \t\tconst std::vector<PixelFormat> &libcameraFormats =\n> >  \t\t\tcamera3Format.libcameraFormats;\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\tcontinue;\n> > +\t\t}\n> > +\n> >  \t\t/*\n> >  \t\t * Test the libcamera formats that can produce images\n> >  \t\t * compatible with the format defined by Android.\n> >  \t\t */\n> >  \t\tPixelFormat mappedFormat;\n> >  \t\tfor (const PixelFormat &pixelFormat : libcameraFormats) {\n> > -\t\t\t/* \\todo Fixed mapping for JPEG. */\n> > -\t\t\tif (androidFormat == HAL_PIXEL_FORMAT_BLOB) {\n> > -\t\t\t\tmappedFormat = formats::MJPEG;\n> > -\t\t\t\tbreak;\n> > -\t\t\t}\n> >\n> >  \t\t\t/*\n> >  \t\t\t * The stream configuration size can be adjusted,\n> > @@ -416,19 +420,25 @@ int CameraDevice::initializeStreamConfigurations()\n> >  \t\t\tcfg.size = res;\n> >\n> >  \t\t\tCameraConfiguration::Status status = cameraConfig->validate();\n> > -\t\t\t/*\n> > -\t\t\t * Unconditionally report we can produce JPEG.\n> > -\t\t\t *\n> > -\t\t\t * \\todo The JPEG stream will be implemented as an\n> > -\t\t\t * HAL-only stream, but some cameras can produce it\n> > -\t\t\t * directly. As of now, claim support for JPEG without\n> > -\t\t\t * inspecting where the JPEG stream is produced.\n> > -\t\t\t */\n> > -\t\t\tif (androidFormat != HAL_PIXEL_FORMAT_BLOB &&\n> > -\t\t\t    status != CameraConfiguration::Valid)\n> > +\t\t\tif (status != CameraConfiguration::Valid)\n> >  \t\t\t\tcontinue;\n> >\n> >  \t\t\tstreamConfigurations_.push_back({ res, androidFormat });\n> > +\n> > +\t\t\t/*\n> > +\t\t\t * If the format is HAL_PIXEL_FORMAT_YCbCr_420_888\n> > +\t\t\t * from which JPEG is produced, add an entry for\n> > +\t\t\t * the JPEG stream.\n> > +\t\t\t *\n> > +\t\t\t * \\todo Wire the JPEG encoder to query the supported\n> > +\t\t\t * sizes provided a list of formats it can encode.\n>\n> nit: Is this needed? Are we expecting the JPEG encoder to reject some\n> resolutions?\n\nIt's more about alignments and limitations in the supported\nresolutions.\n\n>\n> In any case,\n>\n> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n>\n> > +\t\t\t *\n> > +\t\t\t * \\todo Support JPEG streams produced by the Camera\n> > +\t\t\t * natively.\n> > +\t\t\t */\n> > +\t\t\tif (androidFormat == HAL_PIXEL_FORMAT_YCbCr_420_888)\n> > +\t\t\t\tstreamConfigurations_.push_back(\n> > +\t\t\t\t\t{ res, HAL_PIXEL_FORMAT_BLOB });\n> >  \t\t}\n> >  \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\n>\n> --\n> Regards,\n> Niklas Söderlund","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 7599EC3B5B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 10 Sep 2020 11:10:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0A0E962D27;\n\tThu, 10 Sep 2020 13:10:43 +0200 (CEST)","from relay10.mail.gandi.net (relay10.mail.gandi.net\n\t[217.70.178.230])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 17AF962D04\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Sep 2020 13:10:41 +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 relay10.mail.gandi.net (Postfix) with ESMTPSA id 70F92240010;\n\tThu, 10 Sep 2020 11:10:40 +0000 (UTC)"],"Date":"Thu, 10 Sep 2020 13:14:24 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Message-ID":"<20200910111424.3taj6b2h2wrrpgum@uno.localdomain>","References":"<20200908134142.27470-1-jacopo@jmondi.org>\n\t<20200908134142.27470-3-jacopo@jmondi.org>\n\t<20200910103306.GD4095624@oden.dyn.berto.se>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200910103306.GD4095624@oden.dyn.berto.se>","Subject":"Re: [libcamera-devel] [PATCH v3 02/11] android: camera_device:\n\tGenerate JPEG sizes","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=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":12431,"web_url":"https://patchwork.libcamera.org/comment/12431/","msgid":"<CAO5uPHP3q5YE3xdf-QbbvuhQu1+=8-EA6TXMZddW196TF1eWgA@mail.gmail.com>","date":"2020-09-11T02:02:30","subject":"Re: [libcamera-devel] [PATCH v3 02/11] android: camera_device:\n\tGenerate JPEG sizes","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Thanks for the patch. LGTM.\n\nOn Thu, Sep 10, 2020 at 8:10 PM Jacopo Mondi <jacopo@jmondi.org> wrote:\n>\n> Hi Niklas,\n>\n> On Thu, Sep 10, 2020 at 12:33:06PM +0200, Niklas Söderlund wrote:\n> > Hi Jacopo,\n> >\n> > Thanks for your work.\n> >\n> > On 2020-09-08 15:41:33 +0200, Jacopo Mondi wrote:\n> > > When producing the list of image resolutions to claim as supported by the\n> > > camera HAL, the JPEG stream was assumed to be 'always valid' as, at the\n> > > time, there was no JPEG support in place at all.\n> > >\n> > > With the introduction of support for JPEG compression, reporting\n> > > non-valid sizes as supported obviously causes troubles.\n> > >\n> > > In order to avoid reporting non-supported resolutions as supported,\n> > > produce the list of available JPEG sizes by using the ones supported\n> > > by the YCbCr_420_888 format, from which the JPEG stream is encoded.\n> > >\n> > > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Hirokazu Honda <hiroh@chromium.org>\n> > > ---\n> > >  src/android/camera_device.cpp | 40 ++++++++++++++++++++++-------------\n> > >  1 file changed, 25 insertions(+), 15 deletions(-)\n> > >\n> > > diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> > > index 28fb3868c082..1b2e12d6d33c 100644\n> > > --- a/src/android/camera_device.cpp\n> > > +++ b/src/android/camera_device.cpp\n> > > @@ -363,17 +363,21 @@ int CameraDevice::initializeStreamConfigurations()\n> > >             const std::vector<PixelFormat> &libcameraFormats =\n> > >                     camera3Format.libcameraFormats;\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> > > +                   continue;\n> > > +           }\n> > > +\n> > >             /*\n> > >              * Test the libcamera formats that can produce images\n> > >              * compatible with the format defined by Android.\n> > >              */\n> > >             PixelFormat mappedFormat;\n> > >             for (const PixelFormat &pixelFormat : libcameraFormats) {\n> > > -                   /* \\todo Fixed mapping for JPEG. */\n> > > -                   if (androidFormat == HAL_PIXEL_FORMAT_BLOB) {\n> > > -                           mappedFormat = formats::MJPEG;\n> > > -                           break;\n> > > -                   }\n> > >\n> > >                     /*\n> > >                      * The stream configuration size can be adjusted,\n> > > @@ -416,19 +420,25 @@ int CameraDevice::initializeStreamConfigurations()\n> > >                     cfg.size = res;\n> > >\n> > >                     CameraConfiguration::Status status = cameraConfig->validate();\n> > > -                   /*\n> > > -                    * Unconditionally report we can produce JPEG.\n> > > -                    *\n> > > -                    * \\todo The JPEG stream will be implemented as an\n> > > -                    * HAL-only stream, but some cameras can produce it\n> > > -                    * directly. As of now, claim support for JPEG without\n> > > -                    * inspecting where the JPEG stream is produced.\n> > > -                    */\n> > > -                   if (androidFormat != HAL_PIXEL_FORMAT_BLOB &&\n> > > -                       status != CameraConfiguration::Valid)\n> > > +                   if (status != CameraConfiguration::Valid)\n> > >                             continue;\n> > >\n> > >                     streamConfigurations_.push_back({ res, androidFormat });\n> > > +\n> > > +                   /*\n> > > +                    * If the format is HAL_PIXEL_FORMAT_YCbCr_420_888\n> > > +                    * from which JPEG is produced, add an entry for\n> > > +                    * the JPEG stream.\n> > > +                    *\n> > > +                    * \\todo Wire the JPEG encoder to query the supported\n> > > +                    * sizes provided a list of formats it can encode.\n> >\n> > nit: Is this needed? Are we expecting the JPEG encoder to reject some\n> > resolutions?\n>\n> It's more about alignments and limitations in the supported\n> resolutions.\n>\n> >\n> > In any case,\n> >\n> > Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> >\n> > > +                    *\n> > > +                    * \\todo Support JPEG streams produced by the Camera\n> > > +                    * natively.\n> > > +                    */\n> > > +                   if (androidFormat == HAL_PIXEL_FORMAT_YCbCr_420_888)\n> > > +                           streamConfigurations_.push_back(\n> > > +                                   { res, HAL_PIXEL_FORMAT_BLOB });\n> > >             }\n> > >     }\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 F0133BDB1D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 11 Sep 2020 02:02:42 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5912862D38;\n\tFri, 11 Sep 2020 04:02:42 +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 D2F116037B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 11 Sep 2020 04:02:41 +0200 (CEST)","by mail-ej1-x642.google.com with SMTP id nw23so11641031ejb.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Sep 2020 19:02:41 -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=\"fnNQs5IA\"; 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=UgGy7ffkY/2j3LOtK9zUcgqOhouIW5z/S9bpOtkTC2g=;\n\tb=fnNQs5IAbZOjsZkekhtt4n5VakvN+BmTqBlqiOijB9kn9Es5DUyRVMOqElXU5JFAbL\n\t64YJfyne29kS3lCM+O4XUEpsIsqnoX9rEnIw/tGcYuJO48gD6XvdbNFiHEqozS6veH4p\n\t47bci0CbPrCf6yhVZ/fugc8hNQguVRI63u3Eg=","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=UgGy7ffkY/2j3LOtK9zUcgqOhouIW5z/S9bpOtkTC2g=;\n\tb=VFswuRBDdDVsuBvNadzj7ZK14uYvkmxSGqGYFAJRK1zMG7tslWUcOCNFx2eaFdCctD\n\tb+UEeZnb703w6jowu9oMb2DSkdI0e2mv9uzqsxyA5QKKlWd3zjJS24U+r8NAZ7s89pGE\n\tyOMczo6I8ImNe8H+28BjIUoPujUgqSLkxFA1N2E+LQcNeYnkT+NTidVY1B717s7Jv6D4\n\t1xmizZHylsKPNr25prpW7kw3jyR0jszyQT5AyNdvMCSBBgUbh4U4OWQwsgwQ7mKoq6V8\n\t086BQGLy8rkmpQWXCvdJKI277x+ZsV9Gx6fZOVM+Rmz8P4Zv7zO5BnCWAMvIb3gIzXsT\n\tM87w==","X-Gm-Message-State":"AOAM53175w3gdIKVOchQJkGUPz6bE9xljK50pQWk6BezFR4lfv70oqKA\n\toG4Xb1NKu5zFAMQi1Mrr57TbZHdQHezq7J5Ey4Yjgg==","X-Google-Smtp-Source":"ABdhPJxh491aBuL7NkiZ01F0Re46eod7BkD+LiCq0X/uGEuXjJRHbaNlJMMWyUfRAD94y6RaFSKqNy6GnQ+BVDarOMU=","X-Received":"by 2002:a17:906:344e:: with SMTP id\n\td14mr12331152ejb.42.1599789761352; \n\tThu, 10 Sep 2020 19:02:41 -0700 (PDT)","MIME-Version":"1.0","References":"<20200908134142.27470-1-jacopo@jmondi.org>\n\t<20200908134142.27470-3-jacopo@jmondi.org>\n\t<20200910103306.GD4095624@oden.dyn.berto.se>\n\t<20200910111424.3taj6b2h2wrrpgum@uno.localdomain>","In-Reply-To":"<20200910111424.3taj6b2h2wrrpgum@uno.localdomain>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Fri, 11 Sep 2020 11:02:30 +0900","Message-ID":"<CAO5uPHP3q5YE3xdf-QbbvuhQu1+=8-EA6TXMZddW196TF1eWgA@mail.gmail.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v3 02/11] android: camera_device:\n\tGenerate JPEG sizes","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>"}}]