[{"id":22822,"web_url":"https://patchwork.libcamera.org/comment/22822/","msgid":"<20220503070414.omrvs5awuovxk7ff@uno.localdomain>","date":"2022-05-03T07:04:14","subject":"Re: [libcamera-devel] [PATCH 0/5] libcamera: More operator<<() for\n\tstream output","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent,\n\nOn Sat, Apr 30, 2022 at 12:23:43AM +0300, Laurent Pinchart via libcamera-devel wrote:\n> Hello,\n>\n> This patch series extends Han-Lin's operator<<() implementation for\n> geometry classes to format classes. There isn't much else to mention in\n> the cover letter, please see individual patches for details.\n>\n\nWe now have both .toString() and operator<< for printing. Is this\nintentional ? Shouldn't we stabilize on only one of the two ?\n\n> Laurent Pinchart (5):\n>   libcamera: geometry: Add missing ostream header in geometry.h\n>   libcamera: Add operator<<() for pixel format classes\n>   libcamera: bayer_format: Add operator<<()\n>   libcamera: Add operator<<() for V4L2 format classes\n>   libcamera: Replace toString with operator<<() for format classes\n>\n>  include/libcamera/geometry.h                  |  1 +\n>  include/libcamera/internal/bayer_format.h     |  3 +\n>  include/libcamera/internal/v4l2_pixelformat.h |  3 +\n>  include/libcamera/internal/v4l2_subdevice.h   |  3 +\n>  include/libcamera/internal/v4l2_videodevice.h |  3 +\n>  include/libcamera/pixel_format.h              |  3 +\n>  src/android/camera_capabilities.cpp           |  6 +-\n>  src/android/camera_device.cpp                 |  4 +-\n>  src/android/jpeg/encoder_libjpeg.cpp          |  2 +-\n>  src/android/jpeg/thumbnailer.cpp              |  2 +-\n>  src/android/mm/generic_camera_buffer.cpp      |  3 +-\n>  src/android/yuv/post_processor_yuv.cpp        |  4 +-\n>  src/cam/camera_session.cpp                    |  2 +-\n>  src/cam/kms_sink.cpp                          |  2 +-\n>  src/libcamera/bayer_format.cpp                | 57 ++++++++++++-------\n>  src/libcamera/pipeline/ipu3/cio2.cpp          |  2 +-\n>  src/libcamera/pipeline/ipu3/imgu.cpp          |  6 +-\n>  .../pipeline/raspberrypi/raspberrypi.cpp      | 20 +++----\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp      | 10 ++--\n>  src/libcamera/pipeline/rkisp1/rkisp1_path.cpp |  6 +-\n>  src/libcamera/pipeline/simple/converter.cpp   |  4 +-\n>  src/libcamera/pipeline/simple/simple.cpp      |  9 ++-\n>  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp  |  5 +-\n>  src/libcamera/pipeline/vimc/vimc.cpp          |  2 +-\n>  src/libcamera/pixel_format.cpp                | 12 ++++\n>  src/libcamera/v4l2_pixelformat.cpp            | 13 +++++\n>  src/libcamera/v4l2_subdevice.cpp              | 36 ++++++++----\n>  src/libcamera/v4l2_videodevice.cpp            | 16 +++++-\n>  src/qcam/viewfinder_qt.cpp                    |  3 +-\n>  src/v4l2/v4l2_camera_proxy.cpp                |  2 +-\n>  test/bayer-format.cpp                         | 24 ++++----\n>  test/camera-sensor.cpp                        |  2 +-\n>  32 files changed, 175 insertions(+), 95 deletions(-)\n>\n> --\n> Regards,\n>\n> Laurent Pinchart\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 B09F3C0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  3 May 2022 07:04:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 00FC765644;\n\tTue,  3 May 2022 09:04:18 +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 BE793604A4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  3 May 2022 09:04:16 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 32161240005;\n\tTue,  3 May 2022 07:04:15 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1651561458;\n\tbh=7ZewBf/eHE/qLtHElEM3wr2NopgamMiTL0ojDbRp7x0=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=0+sbL034K5LILSFvMqEBDFPo5Hk2krjAsaaW6LTe6bdzo9IYrUzj3zQjC1af214zL\n\tmwbYCu+bjMyQD1EO8p7mQth/aipYSMtT+wIE+mPebDH64VEjzZ6YANqSD7zAnvXVEf\n\ti4FzkG4h6BYIojzHyc/APkF2m2x1wvVIJLtJlLsoQhgeNGP9Cb3+LsZB0NMJ6y9usm\n\toMqVJOqGDZBy60zuhO+cP6q9VGejdx1XQl0frDrXsb+1jjFdVtAV9D6Oj1BkfzXxc6\n\tEggdIP8yMEKfQwmSJyqVhddEN63RFPYXc+q4nM/Hse4Kxe34+LZ3gygEt0xH8JOk/J\n\tKefJPtXDauD0A==","Date":"Tue, 3 May 2022 09:04:14 +0200","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20220503070414.omrvs5awuovxk7ff@uno.localdomain>","References":"<20220429212348.18063-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220429212348.18063-1-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 0/5] libcamera: More operator<<() for\n\tstream output","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>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22826,"web_url":"https://patchwork.libcamera.org/comment/22826/","msgid":"<YnE+sI2G76a5ckvs@pendragon.ideasonboard.com>","date":"2022-05-03T14:39:44","subject":"Re: [libcamera-devel] [PATCH 0/5] libcamera: More operator<<() for\n\tstream output","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Tue, May 03, 2022 at 09:04:14AM +0200, Jacopo Mondi wrote:\n> Hi Laurent,\n> \n> On Sat, Apr 30, 2022 at 12:23:43AM +0300, Laurent Pinchart via libcamera-devel wrote:\n> > Hello,\n> >\n> > This patch series extends Han-Lin's operator<<() implementation for\n> > geometry classes to format classes. There isn't much else to mention in\n> > the cover letter, please see individual patches for details.\n> \n> We now have both .toString() and operator<< for printing. Is this\n> intentional ? Shouldn't we stabilize on only one of the two ?\n\nI think both make sense (as long as one of the two is implemented based\non the other internally), as they serve different purposes. operator<<()\ncertainly simplifies logging, but not all string representations are\nused in logs. toString() has few users so far, mostly in tests, for\ninstance in\n\n\tif (PixelFormat().toString() != \"<INVALID>\") {\n\t\tcerr << \"Failed to convert default PixelFormat to string\"\n\t\t     << endl;\n\t\treturn TestFail;\n\t}\n\nIt would need to be written as\n\n\tstd::stringstream ss;\n\tss << PixelFormat();\n\tif (ss.str() != \"<INVALID>\") {\n\t\t...\n\t}\n\nwhich isn't very convenient. I can imagine more use cases in\napplications, for instance in qcam where available resolutions could be\ndisplayed in the UI.\n\n> > Laurent Pinchart (5):\n> >   libcamera: geometry: Add missing ostream header in geometry.h\n> >   libcamera: Add operator<<() for pixel format classes\n> >   libcamera: bayer_format: Add operator<<()\n> >   libcamera: Add operator<<() for V4L2 format classes\n> >   libcamera: Replace toString with operator<<() for format classes\n> >\n> >  include/libcamera/geometry.h                  |  1 +\n> >  include/libcamera/internal/bayer_format.h     |  3 +\n> >  include/libcamera/internal/v4l2_pixelformat.h |  3 +\n> >  include/libcamera/internal/v4l2_subdevice.h   |  3 +\n> >  include/libcamera/internal/v4l2_videodevice.h |  3 +\n> >  include/libcamera/pixel_format.h              |  3 +\n> >  src/android/camera_capabilities.cpp           |  6 +-\n> >  src/android/camera_device.cpp                 |  4 +-\n> >  src/android/jpeg/encoder_libjpeg.cpp          |  2 +-\n> >  src/android/jpeg/thumbnailer.cpp              |  2 +-\n> >  src/android/mm/generic_camera_buffer.cpp      |  3 +-\n> >  src/android/yuv/post_processor_yuv.cpp        |  4 +-\n> >  src/cam/camera_session.cpp                    |  2 +-\n> >  src/cam/kms_sink.cpp                          |  2 +-\n> >  src/libcamera/bayer_format.cpp                | 57 ++++++++++++-------\n> >  src/libcamera/pipeline/ipu3/cio2.cpp          |  2 +-\n> >  src/libcamera/pipeline/ipu3/imgu.cpp          |  6 +-\n> >  .../pipeline/raspberrypi/raspberrypi.cpp      | 20 +++----\n> >  src/libcamera/pipeline/rkisp1/rkisp1.cpp      | 10 ++--\n> >  src/libcamera/pipeline/rkisp1/rkisp1_path.cpp |  6 +-\n> >  src/libcamera/pipeline/simple/converter.cpp   |  4 +-\n> >  src/libcamera/pipeline/simple/simple.cpp      |  9 ++-\n> >  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp  |  5 +-\n> >  src/libcamera/pipeline/vimc/vimc.cpp          |  2 +-\n> >  src/libcamera/pixel_format.cpp                | 12 ++++\n> >  src/libcamera/v4l2_pixelformat.cpp            | 13 +++++\n> >  src/libcamera/v4l2_subdevice.cpp              | 36 ++++++++----\n> >  src/libcamera/v4l2_videodevice.cpp            | 16 +++++-\n> >  src/qcam/viewfinder_qt.cpp                    |  3 +-\n> >  src/v4l2/v4l2_camera_proxy.cpp                |  2 +-\n> >  test/bayer-format.cpp                         | 24 ++++----\n> >  test/camera-sensor.cpp                        |  2 +-\n> >  32 files changed, 175 insertions(+), 95 deletions(-)","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 0895CC0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  3 May 2022 14:39:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4A0A065646;\n\tTue,  3 May 2022 16:39:48 +0200 (CEST)","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 37ED265640\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  3 May 2022 16:39:46 +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 9A6673E4;\n\tTue,  3 May 2022 16:39:45 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1651588788;\n\tbh=pPSLULMzDDgdwC2mxBkV5P2DwceBoMJMV5G6UisCFrg=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=z6IF/LLgCJ5JTcmZrknJkxN21S9a8M0lRBGdpVkPG/gmo6Kkf9Gbil62mj3KZ2+xC\n\twgMsJrb5Lg1x2zdwR/BFyG53abRf5uruUe9uFQsMSRJG3Xk/CtfbxMcIJfwMdQV5e6\n\tnBCgrHux0k0cNXMew8Pgm9E8ZHMZx1QJresDZ+C1eivQwfiUnuUuI1I70s+xKWELt+\n\tUlgMJuP+OyWUsrzXvArA4Phvb1Cuju304DoDivoWkSsm75QtvFY8diWA10KA4mIy/u\n\tRKaC5ZFz3ImKvZcZ8HCsq58QZ7uWUYX5tTKaZpG3Qjlm7h/4EEljUuieAm752hxGqD\n\t4d3DSkaBlLMvA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1651588785;\n\tbh=pPSLULMzDDgdwC2mxBkV5P2DwceBoMJMV5G6UisCFrg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=B74rRTris0KQQNZMWtFelQsNE3qQnPPE4zuH/kyZsxoxyOFBrRkdvYNO94ofich9J\n\t6po83z8v4Yw6PIpqQMl3BvXluYhtK9gaHhu+bo3g6t6FWEN56/Hv9HFqT4hjvtbuik\n\t4rKWrzkkcdsMPBzTCxNKl5/GVhDoUKPfaSbCBHBQ="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"B74rRTri\"; dkim-atps=neutral","Date":"Tue, 3 May 2022 17:39:44 +0300","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YnE+sI2G76a5ckvs@pendragon.ideasonboard.com>","References":"<20220429212348.18063-1-laurent.pinchart@ideasonboard.com>\n\t<20220503070414.omrvs5awuovxk7ff@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220503070414.omrvs5awuovxk7ff@uno.localdomain>","Subject":"Re: [libcamera-devel] [PATCH 0/5] libcamera: More operator<<() for\n\tstream output","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22839,"web_url":"https://patchwork.libcamera.org/comment/22839/","msgid":"<165165537429.4076486.10243354095940146027@Monstersaurus>","date":"2022-05-04T09:09:34","subject":"Re: [libcamera-devel] [PATCH 0/5] libcamera: More operator<<() for\n\tstream output","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart via libcamera-devel (2022-05-03 15:39:44)\n> Hi Jacopo,\n> \n> On Tue, May 03, 2022 at 09:04:14AM +0200, Jacopo Mondi wrote:\n> > Hi Laurent,\n> > \n> > On Sat, Apr 30, 2022 at 12:23:43AM +0300, Laurent Pinchart via libcamera-devel wrote:\n> > > Hello,\n> > >\n> > > This patch series extends Han-Lin's operator<<() implementation for\n> > > geometry classes to format classes. There isn't much else to mention in\n> > > the cover letter, please see individual patches for details.\n> > \n> > We now have both .toString() and operator<< for printing. Is this\n> > intentional ? Shouldn't we stabilize on only one of the two ?\n> \n> I think both make sense (as long as one of the two is implemented based\n> on the other internally), as they serve different purposes. operator<<()\n> certainly simplifies logging, but not all string representations are\n> used in logs. toString() has few users so far, mostly in tests, for\n> instance in\n> \n>         if (PixelFormat().toString() != \"<INVALID>\") {\n>                 cerr << \"Failed to convert default PixelFormat to string\"\n>                      << endl;\n>                 return TestFail;\n>         }\n> \n> It would need to be written as\n> \n>         std::stringstream ss;\n>         ss << PixelFormat();\n>         if (ss.str() != \"<INVALID>\") {\n>                 ...\n>         }\n> \n> which isn't very convenient. I can imagine more use cases in\n> applications, for instance in qcam where available resolutions could be\n> displayed in the UI.\n\nYes, I agree/think both are useful in different situations - So I'm glad\nwe're updating to have both.\n\n--\nKieran\n\n\n> \n> > > Laurent Pinchart (5):\n> > >   libcamera: geometry: Add missing ostream header in geometry.h\n> > >   libcamera: Add operator<<() for pixel format classes\n> > >   libcamera: bayer_format: Add operator<<()\n> > >   libcamera: Add operator<<() for V4L2 format classes\n> > >   libcamera: Replace toString with operator<<() for format classes\n> > >\n> > >  include/libcamera/geometry.h                  |  1 +\n> > >  include/libcamera/internal/bayer_format.h     |  3 +\n> > >  include/libcamera/internal/v4l2_pixelformat.h |  3 +\n> > >  include/libcamera/internal/v4l2_subdevice.h   |  3 +\n> > >  include/libcamera/internal/v4l2_videodevice.h |  3 +\n> > >  include/libcamera/pixel_format.h              |  3 +\n> > >  src/android/camera_capabilities.cpp           |  6 +-\n> > >  src/android/camera_device.cpp                 |  4 +-\n> > >  src/android/jpeg/encoder_libjpeg.cpp          |  2 +-\n> > >  src/android/jpeg/thumbnailer.cpp              |  2 +-\n> > >  src/android/mm/generic_camera_buffer.cpp      |  3 +-\n> > >  src/android/yuv/post_processor_yuv.cpp        |  4 +-\n> > >  src/cam/camera_session.cpp                    |  2 +-\n> > >  src/cam/kms_sink.cpp                          |  2 +-\n> > >  src/libcamera/bayer_format.cpp                | 57 ++++++++++++-------\n> > >  src/libcamera/pipeline/ipu3/cio2.cpp          |  2 +-\n> > >  src/libcamera/pipeline/ipu3/imgu.cpp          |  6 +-\n> > >  .../pipeline/raspberrypi/raspberrypi.cpp      | 20 +++----\n> > >  src/libcamera/pipeline/rkisp1/rkisp1.cpp      | 10 ++--\n> > >  src/libcamera/pipeline/rkisp1/rkisp1_path.cpp |  6 +-\n> > >  src/libcamera/pipeline/simple/converter.cpp   |  4 +-\n> > >  src/libcamera/pipeline/simple/simple.cpp      |  9 ++-\n> > >  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp  |  5 +-\n> > >  src/libcamera/pipeline/vimc/vimc.cpp          |  2 +-\n> > >  src/libcamera/pixel_format.cpp                | 12 ++++\n> > >  src/libcamera/v4l2_pixelformat.cpp            | 13 +++++\n> > >  src/libcamera/v4l2_subdevice.cpp              | 36 ++++++++----\n> > >  src/libcamera/v4l2_videodevice.cpp            | 16 +++++-\n> > >  src/qcam/viewfinder_qt.cpp                    |  3 +-\n> > >  src/v4l2/v4l2_camera_proxy.cpp                |  2 +-\n> > >  test/bayer-format.cpp                         | 24 ++++----\n> > >  test/camera-sensor.cpp                        |  2 +-\n> > >  32 files changed, 175 insertions(+), 95 deletions(-)\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 55BBAC3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  4 May 2022 09:09:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0A88A65641;\n\tWed,  4 May 2022 11:09:38 +0200 (CEST)","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 8542265641\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  4 May 2022 11:09:36 +0200 (CEST)","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 30F03E5;\n\tWed,  4 May 2022 11:09:36 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1651655378;\n\tbh=QNgcI0ZzwL+CLSjN2Yc04NuIQbk+V1finx7sceGEXHA=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=gAls0Vc7oj7w4EHsf03RlGRLoqbQgu2y08Jw1YUbsMPMfEghyDBZdnmfkpsIeYyU+\n\tq/2PSjN8EDLgHxhUSpKeHbhx4Kr0UQQi497Pt4Dmo4Xmud2ClSohC+jhhY+V+JSC94\n\tnjt7H5rVy4qOv8MeM7SNC140iHYkoi/B5GqxpPBcQaVl/lntI8//GlyDNmDxVB9jEM\n\tMT5wA24RmgX6hKqD71L+uwWkKK3bd2ycG+VP3tZkvbN3N2JYfb1BgnDFq43BL6WMPR\n\tgod9+qaase+b/1zFDBv4tSlqDSCn9XaB7z0cIeYil/8H8kf/Zm6AHVfQ/bVzM7KPxs\n\tCopCQTGR1oaYA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1651655376;\n\tbh=QNgcI0ZzwL+CLSjN2Yc04NuIQbk+V1finx7sceGEXHA=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=PGFFhiSl3aA8EHj6dVB57WOokzdFzqUISv053ue5gmTmBrRWEQ/4lxQSzVt2BLo8d\n\tjy/6geMWuSRkajTqbRUSx2SApMQ30URXpAvWAXk6y2Pp6oiPczTIRy3y1Zpqckx26v\n\tmlG7thXa0DSpDL5S3Svm12yK1TfudZpZHWoxEx0s="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"PGFFhiSl\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<YnE+sI2G76a5ckvs@pendragon.ideasonboard.com>","References":"<20220429212348.18063-1-laurent.pinchart@ideasonboard.com>\n\t<20220503070414.omrvs5awuovxk7ff@uno.localdomain>\n\t<YnE+sI2G76a5ckvs@pendragon.ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tLaurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Date":"Wed, 04 May 2022 10:09:34 +0100","Message-ID":"<165165537429.4076486.10243354095940146027@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH 0/5] libcamera: More operator<<() for\n\tstream output","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22840,"web_url":"https://patchwork.libcamera.org/comment/22840/","msgid":"<20220504091854.nehjlx7vmn63krwg@uno.localdomain>","date":"2022-05-04T09:18:54","subject":"Re: [libcamera-devel] [PATCH 0/5] libcamera: More operator<<() for\n\tstream output","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Ah, right, different use cases, so having both is fine\n\nFor the series: add Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n  j\n\nOn Tue, May 03, 2022 at 05:39:44PM +0300, Laurent Pinchart wrote:\n> Hi Jacopo,\n>\n> On Tue, May 03, 2022 at 09:04:14AM +0200, Jacopo Mondi wrote:\n> > Hi Laurent,\n> >\n> > On Sat, Apr 30, 2022 at 12:23:43AM +0300, Laurent Pinchart via libcamera-devel wrote:\n> > > Hello,\n> > >\n> > > This patch series extends Han-Lin's operator<<() implementation for\n> > > geometry classes to format classes. There isn't much else to mention in\n> > > the cover letter, please see individual patches for details.\n> >\n> > We now have both .toString() and operator<< for printing. Is this\n> > intentional ? Shouldn't we stabilize on only one of the two ?\n>\n> I think both make sense (as long as one of the two is implemented based\n> on the other internally), as they serve different purposes. operator<<()\n> certainly simplifies logging, but not all string representations are\n> used in logs. toString() has few users so far, mostly in tests, for\n> instance in\n>\n> \tif (PixelFormat().toString() != \"<INVALID>\") {\n> \t\tcerr << \"Failed to convert default PixelFormat to string\"\n> \t\t     << endl;\n> \t\treturn TestFail;\n> \t}\n>\n> It would need to be written as\n>\n> \tstd::stringstream ss;\n> \tss << PixelFormat();\n> \tif (ss.str() != \"<INVALID>\") {\n> \t\t...\n> \t}\n>\n> which isn't very convenient. I can imagine more use cases in\n> applications, for instance in qcam where available resolutions could be\n> displayed in the UI.\n>\n> > > Laurent Pinchart (5):\n> > >   libcamera: geometry: Add missing ostream header in geometry.h\n> > >   libcamera: Add operator<<() for pixel format classes\n> > >   libcamera: bayer_format: Add operator<<()\n> > >   libcamera: Add operator<<() for V4L2 format classes\n> > >   libcamera: Replace toString with operator<<() for format classes\n> > >\n> > >  include/libcamera/geometry.h                  |  1 +\n> > >  include/libcamera/internal/bayer_format.h     |  3 +\n> > >  include/libcamera/internal/v4l2_pixelformat.h |  3 +\n> > >  include/libcamera/internal/v4l2_subdevice.h   |  3 +\n> > >  include/libcamera/internal/v4l2_videodevice.h |  3 +\n> > >  include/libcamera/pixel_format.h              |  3 +\n> > >  src/android/camera_capabilities.cpp           |  6 +-\n> > >  src/android/camera_device.cpp                 |  4 +-\n> > >  src/android/jpeg/encoder_libjpeg.cpp          |  2 +-\n> > >  src/android/jpeg/thumbnailer.cpp              |  2 +-\n> > >  src/android/mm/generic_camera_buffer.cpp      |  3 +-\n> > >  src/android/yuv/post_processor_yuv.cpp        |  4 +-\n> > >  src/cam/camera_session.cpp                    |  2 +-\n> > >  src/cam/kms_sink.cpp                          |  2 +-\n> > >  src/libcamera/bayer_format.cpp                | 57 ++++++++++++-------\n> > >  src/libcamera/pipeline/ipu3/cio2.cpp          |  2 +-\n> > >  src/libcamera/pipeline/ipu3/imgu.cpp          |  6 +-\n> > >  .../pipeline/raspberrypi/raspberrypi.cpp      | 20 +++----\n> > >  src/libcamera/pipeline/rkisp1/rkisp1.cpp      | 10 ++--\n> > >  src/libcamera/pipeline/rkisp1/rkisp1_path.cpp |  6 +-\n> > >  src/libcamera/pipeline/simple/converter.cpp   |  4 +-\n> > >  src/libcamera/pipeline/simple/simple.cpp      |  9 ++-\n> > >  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp  |  5 +-\n> > >  src/libcamera/pipeline/vimc/vimc.cpp          |  2 +-\n> > >  src/libcamera/pixel_format.cpp                | 12 ++++\n> > >  src/libcamera/v4l2_pixelformat.cpp            | 13 +++++\n> > >  src/libcamera/v4l2_subdevice.cpp              | 36 ++++++++----\n> > >  src/libcamera/v4l2_videodevice.cpp            | 16 +++++-\n> > >  src/qcam/viewfinder_qt.cpp                    |  3 +-\n> > >  src/v4l2/v4l2_camera_proxy.cpp                |  2 +-\n> > >  test/bayer-format.cpp                         | 24 ++++----\n> > >  test/camera-sensor.cpp                        |  2 +-\n> > >  32 files changed, 175 insertions(+), 95 deletions(-)\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 E587AC0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  4 May 2022 09:18:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 396DA65644;\n\tWed,  4 May 2022 11:18:58 +0200 (CEST)","from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net\n\t[IPv6:2001:4b98:dc4:8::222])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9D37C604A3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  4 May 2022 11:18:56 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 146F340007;\n\tWed,  4 May 2022 09:18:55 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1651655938;\n\tbh=T07YgxTmvMAQDNU+e7DjbDEzRUSAV5ri7l2oD0S90Ko=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=IjX5r9LkMgGCqRffRoykpeKPGSJJ4rZTDr/TSr38PKdFNCKC/68TrtBlYDF/6Of0F\n\tJYIgJPCT4vZlRpJ0s2cCzFlJ/VQ9oYDlorkuZwk8oRpBt68igqVXlboAMVdtPgUVr1\n\tIoPJ0exeMHJrxbjktLWTw9LCjB0IZTQtk1IZpTpvtC9Q1/xUh1a+jURuo8eW3Zojqo\n\tYu1OlCwaTTFrsV8TN8MV/yxSbpOI/018tMS5EFPSt/TuZvuF/lRucLP0xR85yHekXy\n\tQ17fRm7EnbS+SfMGMcoimX33tR5mX2P8R3MBHRY74bEgp5umG9B4Mj/ZThYqM8IDvA\n\tUG0vntzdCfe0w==","Date":"Wed, 4 May 2022 11:18:54 +0200","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20220504091854.nehjlx7vmn63krwg@uno.localdomain>","References":"<20220429212348.18063-1-laurent.pinchart@ideasonboard.com>\n\t<20220503070414.omrvs5awuovxk7ff@uno.localdomain>\n\t<YnE+sI2G76a5ckvs@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<YnE+sI2G76a5ckvs@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 0/5] libcamera: More operator<<() for\n\tstream output","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>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]