[{"id":12321,"web_url":"https://patchwork.libcamera.org/comment/12321/","msgid":"<20200905214232.GL6319@pendragon.ideasonboard.com>","date":"2020-09-05T21:42:32","subject":"Re: [libcamera-devel] [PATCH v2 09/12] android: camera_device: Use\n\tAndroid format","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Wed, Sep 02, 2020 at 05:22:33PM +0200, Jacopo Mondi wrote:\n> We assumed HAL_PIXEL_FORMAT_BLOB is always mapped to libcamera::MJPEG\n> and at the moment this is true. To protect against future changes in the\n> mapping, inspect the Android format instead of the libcamera one.\n\nI'm not sure what you want to protest against. The second hunk is a\nsmall optimization, so I think that's good (and could be squashed with\n08/12), but I'm not sure how the first hunk helps. Maybe the commit\nmessage should be expanded a bit ?\n\nThe change itself is fine,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\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 | 5 ++---\n>  1 file changed, 2 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index 7fc61e3e4da7..3630e87e8814 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -1216,7 +1216,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n>  \t\tstream->priv = static_cast<void *>(&streams_[i]);\n>  \n>  \t\t/* Defer handling of MJPEG streams until all others are known. */\n> -\t\tif (format == formats::MJPEG)\n> +\t\tif (stream->format == HAL_PIXEL_FORMAT_BLOB)\n>  \t\t\tcontinue;\n>  \n>  \t\tStreamConfiguration streamConfiguration;\n> @@ -1230,10 +1230,9 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n>  \t/* Now handle MJPEG streams, adding a new stream if required. */\n>  \tfor (unsigned int i = 0; i < stream_list->num_streams; ++i) {\n>  \t\tcamera3_stream_t *stream = stream_list->streams[i];\n> -\t\tPixelFormat format = toPixelFormat(stream->format);\n>  \t\tbool match = false;\n>  \n> -\t\tif (format != formats::MJPEG)\n> +\t\tif (stream->format != HAL_PIXEL_FORMAT_BLOB)\n>  \t\t\tcontinue;\n>  \n>  \t\t/* Search for a compatible stream */","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 E1DADBDB1D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  5 Sep 2020 21:42:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id ABF7A62B5B;\n\tSat,  5 Sep 2020 23:42:57 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C71AB62901\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  5 Sep 2020 23:42:56 +0200 (CEST)","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 4C544335;\n\tSat,  5 Sep 2020 23:42:56 +0200 (CEST)"],"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=\"iC8afXcg\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1599342176;\n\tbh=SxUIK7ICUYd+NAgkjBxIReIF3VfZSVyIS1+xz19WUWM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=iC8afXcg6+xAfpqh6oMOeeuHLyu5fojmG9mc2un7J4f8CxBEAWwJTtMPDMb0mmtEZ\n\tg7Ho98Iq6/rDHNBfBNUsAKyF3u6RcWwI82K1w8caCHKauLoCus3zyoAGUV2ynYT/Yd\n\tXQ08H3VzRfgZW7JUKIoCfK57TPa/RR3nJs7OFTYc=","Date":"Sun, 6 Sep 2020 00:42:32 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20200905214232.GL6319@pendragon.ideasonboard.com>","References":"<20200902152236.69770-1-jacopo@jmondi.org>\n\t<20200902152236.69770-10-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200902152236.69770-10-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v2 09/12] android: camera_device: Use\n\tAndroid format","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"tfiga@google.com, libcamera-devel@lists.libcamera.org, hiroh@google.com","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":12348,"web_url":"https://patchwork.libcamera.org/comment/12348/","msgid":"<20200907084425.4rtzpucxxutxpazi@uno.localdomain>","date":"2020-09-07T08:44:25","subject":"Re: [libcamera-devel] [PATCH v2 09/12] android: camera_device: Use\n\tAndroid format","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent,\n\nOn Sun, Sep 06, 2020 at 12:42:32AM +0300, Laurent Pinchart wrote:\n> Hi Jacopo,\n>\n> Thank you for the patch.\n>\n> On Wed, Sep 02, 2020 at 05:22:33PM +0200, Jacopo Mondi wrote:\n> > We assumed HAL_PIXEL_FORMAT_BLOB is always mapped to libcamera::MJPEG\n> > and at the moment this is true. To protect against future changes in the\n> > mapping, inspect the Android format instead of the libcamera one.\n>\n> I'm not sure what you want to protest against. The second hunk is a\n\nAgainst the fact we assume _BLOB -> MJPEG. Going forward I presume\nthere will be more available JPEG mappings, right ? To my\nunderstanding MJPEG != JPEG, in example.\n\n> small optimization, so I think that's good (and could be squashed with\n> 08/12), but I'm not sure how the first hunk helps. Maybe the commit\n> message should be expanded a bit ?\n>\n> The change itself is fine,\n>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\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 | 5 ++---\n> >  1 file changed, 2 insertions(+), 3 deletions(-)\n> >\n> > diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> > index 7fc61e3e4da7..3630e87e8814 100644\n> > --- a/src/android/camera_device.cpp\n> > +++ b/src/android/camera_device.cpp\n> > @@ -1216,7 +1216,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n> >  \t\tstream->priv = static_cast<void *>(&streams_[i]);\n> >\n> >  \t\t/* Defer handling of MJPEG streams until all others are known. */\n> > -\t\tif (format == formats::MJPEG)\n> > +\t\tif (stream->format == HAL_PIXEL_FORMAT_BLOB)\n> >  \t\t\tcontinue;\n> >\n> >  \t\tStreamConfiguration streamConfiguration;\n> > @@ -1230,10 +1230,9 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n> >  \t/* Now handle MJPEG streams, adding a new stream if required. */\n> >  \tfor (unsigned int i = 0; i < stream_list->num_streams; ++i) {\n> >  \t\tcamera3_stream_t *stream = stream_list->streams[i];\n> > -\t\tPixelFormat format = toPixelFormat(stream->format);\n> >  \t\tbool match = false;\n> >\n> > -\t\tif (format != formats::MJPEG)\n> > +\t\tif (stream->format != HAL_PIXEL_FORMAT_BLOB)\n> >  \t\t\tcontinue;\n> >\n> >  \t\t/* Search for a compatible stream */\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 737FFBDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  7 Sep 2020 08:40:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 14CB062B82;\n\tMon,  7 Sep 2020 10:40:39 +0200 (CEST)","from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net\n\t[217.70.183.199])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9E4FE629B6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  7 Sep 2020 10:40:38 +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 relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 91780FF807;\n\tMon,  7 Sep 2020 08:40:37 +0000 (UTC)"],"X-Originating-IP":"93.34.118.233","Date":"Mon, 7 Sep 2020 10:44:25 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20200907084425.4rtzpucxxutxpazi@uno.localdomain>","References":"<20200902152236.69770-1-jacopo@jmondi.org>\n\t<20200902152236.69770-10-jacopo@jmondi.org>\n\t<20200905214232.GL6319@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200905214232.GL6319@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2 09/12] android: camera_device: Use\n\tAndroid format","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"tfiga@google.com, libcamera-devel@lists.libcamera.org, hiroh@google.com","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":12357,"web_url":"https://patchwork.libcamera.org/comment/12357/","msgid":"<20200907132629.GD6047@pendragon.ideasonboard.com>","date":"2020-09-07T13:26:29","subject":"Re: [libcamera-devel] [PATCH v2 09/12] android: camera_device: Use\n\tAndroid format","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Mon, Sep 07, 2020 at 10:44:25AM +0200, Jacopo Mondi wrote:\n> On Sun, Sep 06, 2020 at 12:42:32AM +0300, Laurent Pinchart wrote:\n> > On Wed, Sep 02, 2020 at 05:22:33PM +0200, Jacopo Mondi wrote:\n> > > We assumed HAL_PIXEL_FORMAT_BLOB is always mapped to libcamera::MJPEG\n> > > and at the moment this is true. To protect against future changes in the\n> > > mapping, inspect the Android format instead of the libcamera one.\n> >\n> > I'm not sure what you want to protest against. The second hunk is a\n\nThis should have read \"protect\" of course, not \"protest\" :-)\n\n> Against the fact we assume _BLOB -> MJPEG. Going forward I presume\n> there will be more available JPEG mappings, right ? To my\n> understanding MJPEG != JPEG, in example.\n\nBLOB == JPEG, and I don't foresee pipeline handlers provided anything\nelse than formats::MJPEG (which may well be JFIF images, not MJPEG, but\nthat's another story).\n\n> > small optimization, so I think that's good (and could be squashed with\n> > 08/12), but I'm not sure how the first hunk helps. Maybe the commit\n> > message should be expanded a bit ?\n> >\n> > The change itself is fine,\n> >\n> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\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 | 5 ++---\n> > >  1 file changed, 2 insertions(+), 3 deletions(-)\n> > >\n> > > diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> > > index 7fc61e3e4da7..3630e87e8814 100644\n> > > --- a/src/android/camera_device.cpp\n> > > +++ b/src/android/camera_device.cpp\n> > > @@ -1216,7 +1216,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n> > >  \t\tstream->priv = static_cast<void *>(&streams_[i]);\n> > >\n> > >  \t\t/* Defer handling of MJPEG streams until all others are known. */\n> > > -\t\tif (format == formats::MJPEG)\n> > > +\t\tif (stream->format == HAL_PIXEL_FORMAT_BLOB)\n> > >  \t\t\tcontinue;\n> > >\n> > >  \t\tStreamConfiguration streamConfiguration;\n> > > @@ -1230,10 +1230,9 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n> > >  \t/* Now handle MJPEG streams, adding a new stream if required. */\n> > >  \tfor (unsigned int i = 0; i < stream_list->num_streams; ++i) {\n> > >  \t\tcamera3_stream_t *stream = stream_list->streams[i];\n> > > -\t\tPixelFormat format = toPixelFormat(stream->format);\n> > >  \t\tbool match = false;\n> > >\n> > > -\t\tif (format != formats::MJPEG)\n> > > +\t\tif (stream->format != HAL_PIXEL_FORMAT_BLOB)\n> > >  \t\t\tcontinue;\n> > >\n> > >  \t\t/* Search for a compatible stream */","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 4D5D0BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  7 Sep 2020 13:26:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DAFCF60371;\n\tMon,  7 Sep 2020 15:26:55 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F13146036E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  7 Sep 2020 15:26:53 +0200 (CEST)","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 593FB3E;\n\tMon,  7 Sep 2020 15:26:53 +0200 (CEST)"],"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=\"JDdVNihx\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1599485213;\n\tbh=Ifakp8gzhsI1mOXhjz8kxhXYP2z4PX60fvAob2zqrAc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=JDdVNihxuDy9yBsIRGofrvn3nwlpJcHMiAn0rHfxL4ZBSLWD5lQfX1uBafaidlzaY\n\t4VgsM/89FJgW2fmp1XyyW6HLtbL83CpzqTNoqg6wLthumu2Yw+qIpLHOKLXs1TK6sv\n\t2WvRijBwR0cT4dhh03XqwvHxpGtd2faZMeaope5U=","Date":"Mon, 7 Sep 2020 16:26:29 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20200907132629.GD6047@pendragon.ideasonboard.com>","References":"<20200902152236.69770-1-jacopo@jmondi.org>\n\t<20200902152236.69770-10-jacopo@jmondi.org>\n\t<20200905214232.GL6319@pendragon.ideasonboard.com>\n\t<20200907084425.4rtzpucxxutxpazi@uno.localdomain>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200907084425.4rtzpucxxutxpazi@uno.localdomain>","Subject":"Re: [libcamera-devel] [PATCH v2 09/12] android: camera_device: Use\n\tAndroid format","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"tfiga@google.com, libcamera-devel@lists.libcamera.org, hiroh@google.com","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]