[{"id":5078,"web_url":"https://patchwork.libcamera.org/comment/5078/","msgid":"<20200605232714.GR26752@pendragon.ideasonboard.com>","date":"2020-06-05T23:27:14","subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: v4l2_videodevice: Use\n\tImageFormats","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 Fri, May 29, 2020 at 01:03:32PM +0200, Jacopo Mondi wrote:\n> ImageFormats was meant to be used not only for V4L2Subdevice but\n> for video devices as well. Since the introduction of of V4L2PixelFormat\n> the V4L2VideoDevice class and its users have been using a raw map to\n> enumerate and inspect the V4L2VideoDevice formats.\n> \n> Use the ImageFormats<V4L2PixelFormat> specialization in place of a raw\n> map and update its usage in pipeline handlers.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  include/libcamera/internal/v4l2_videodevice.h   |  2 +-\n>  .../pipeline/raspberrypi/raspberrypi.cpp        | 17 +++++++----------\n>  src/libcamera/pipeline/simple/simple.cpp        |  3 +--\n>  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp    |  3 +--\n>  src/libcamera/v4l2_videodevice.cpp              |  4 ++--\n>  5 files changed, 12 insertions(+), 17 deletions(-)\n> \n> diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h\n> index dc259523599c..de4745982e94 100644\n> --- a/include/libcamera/internal/v4l2_videodevice.h\n> +++ b/include/libcamera/internal/v4l2_videodevice.h\n> @@ -187,7 +187,7 @@ public:\n>  \n>  \tint getFormat(V4L2DeviceFormat *format);\n>  \tint setFormat(V4L2DeviceFormat *format);\n> -\tstd::map<V4L2PixelFormat, std::vector<SizeRange>> formats(uint32_t code = 0);\n> +\tImageFormats<V4L2PixelFormat> formats(uint32_t code = 0);\n>  \n>  \tint setSelection(unsigned int target, Rectangle *rect);\n>  \n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index e16a9c7f10d3..64364afb3f7e 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -37,8 +37,6 @@ namespace libcamera {\n>  \n>  LOG_DEFINE_CATEGORY(RPI)\n>  \n> -using V4L2PixFmtMap = std::map<V4L2PixelFormat, std::vector<SizeRange>>;\n> -\n>  namespace {\n>  \n>  bool isRaw(PixelFormat &pixFmt)\n> @@ -67,7 +65,7 @@ double scoreFormat(double desired, double actual)\n>  \treturn score;\n>  }\n>  \n> -V4L2DeviceFormat findBestMode(V4L2PixFmtMap &formatsMap, const Size &req)\n> +V4L2DeviceFormat findBestMode(ImageFormats<V4L2PixelFormat> &formatsMap, const Size &req)\n>  {\n>  \tdouble bestScore = 9e9, score;\n>  \tV4L2DeviceFormat bestMode = {};\n> @@ -79,12 +77,11 @@ V4L2DeviceFormat findBestMode(V4L2PixFmtMap &formatsMap, const Size &req)\n>  #define PENALTY_UNPACKED\t 500.0\n>  \n>  \t/* Calculate the closest/best mode from the user requested size. */\n> -\tfor (const auto &iter : formatsMap) {\n> -\t\tV4L2PixelFormat v4l2Format = iter.first;\n> +\tfor (const auto &v4l2Format : formatsMap.formats()) {\n\nThis will impact efficiency, as you will first create a temporary vector\ncalling formats(), with an additional but smaller impact when calling\nsize() below. Is this required ?\n\nIt's also a change that isn't described in the commit message, so I'd\nsplit it to a separate patch if desired.\n\n>  \t\tPixelFormat pixelFormat = v4l2Format.toPixelFormat();\n>  \t\tconst PixelFormatInfo &info = PixelFormatInfo::info(pixelFormat);\n>  \n> -\t\tfor (const SizeRange &sz : iter.second) {\n> +\t\tfor (const SizeRange &sz : formatsMap.sizes(v4l2Format)) {\n>  \t\t\tdouble modeWidth = sz.contains(req) ? req.width : sz.max.width;\n>  \t\t\tdouble modeHeight = sz.contains(req) ? req.height : sz.max.height;\n>  \t\t\tdouble reqAr = static_cast<double>(req.width) / req.height;\n> @@ -427,7 +424,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()\n>  \t\t\t * Calculate the best sensor mode we can use based on\n>  \t\t\t * the user request.\n>  \t\t\t */\n> -\t\t\tV4L2PixFmtMap fmts = data_->unicam_[Unicam::Image].dev()->formats();\n> +\t\t\tImageFormats<V4L2PixelFormat> fmts = data_->unicam_[Unicam::Image].dev()->formats();\n>  \t\t\tV4L2DeviceFormat sensorFormat = findBestMode(fmts, cfg.size);\n>  \t\t\tPixelFormat sensorPixFormat = sensorFormat.fourcc.toPixelFormat();\n>  \t\t\tif (cfg.size != sensorFormat.size ||\n> @@ -481,7 +478,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()\n>  \t\t *\n>  \t\t */\n>  \t\tPixelFormat &cfgPixFmt = config_.at(outSize[i].first).pixelFormat;\n> -\t\tV4L2PixFmtMap fmts;\n> +\t\tImageFormats<V4L2PixelFormat> fmts;\n>  \n>  \t\tif (i == maxIndex)\n>  \t\t\tfmts = data_->isp_[Isp::Output0].dev()->formats();\n> @@ -518,7 +515,7 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>  \tRPiCameraData *data = cameraData(camera);\n>  \tCameraConfiguration *config = new RPiCameraConfiguration(data);\n>  \tV4L2DeviceFormat sensorFormat;\n> -\tV4L2PixFmtMap fmts;\n> +\tImageFormats<V4L2PixelFormat> fmts;\n>  \n>  \tif (roles.empty())\n>  \t\treturn config;\n> @@ -605,7 +602,7 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n>  \t}\n>  \n>  \t/* First calculate the best sensor mode we can use based on the user request. */\n> -\tV4L2PixFmtMap fmts = data->unicam_[Unicam::Image].dev()->formats();\n> +\tImageFormats<V4L2PixelFormat> fmts = data->unicam_[Unicam::Image].dev()->formats();\n>  \tV4L2DeviceFormat sensorFormat = findBestMode(fmts, rawStream ? sensorSize : maxSize);\n>  \n>  \t/*\n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index 1ec8d0f7de03..f3e03ba60196 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -275,8 +275,7 @@ int SimpleCameraData::init()\n>  \t\t\treturn ret;\n>  \t\t}\n>  \n> -\t\tstd::map<V4L2PixelFormat, std::vector<SizeRange>> videoFormats =\n> -\t\t\tvideo_->formats(format.mbus_code);\n> +\t\tImageFormats<V4L2PixelFormat> videoFormats = video_->formats(format.mbus_code);\n>  \n>  \t\tLOG(SimplePipeline, Debug)\n>  \t\t\t<< \"Adding configuration for \" << format.size.toString()\n> diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> index a074909499f1..dbd835f5c5ef 100644\n> --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> @@ -159,8 +159,7 @@ CameraConfiguration *PipelineHandlerUVC::generateConfiguration(Camera *camera,\n>  \tif (roles.empty())\n>  \t\treturn config;\n>  \n> -\tstd::map<V4L2PixelFormat, std::vector<SizeRange>> v4l2Formats =\n> -\t\tdata->video_->formats();\n> +\tImageFormats<V4L2PixelFormat> v4l2Formats = data->video_->formats();\n>  \tstd::map<PixelFormat, std::vector<SizeRange>> deviceFormats;\n>  \tstd::transform(v4l2Formats.begin(), v4l2Formats.end(),\n>  \t\t       std::inserter(deviceFormats, deviceFormats.begin()),\n> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> index 3614b2ed1cbc..ea952444e0ad 100644\n> --- a/src/libcamera/v4l2_videodevice.cpp\n> +++ b/src/libcamera/v4l2_videodevice.cpp\n> @@ -925,9 +925,9 @@ int V4L2VideoDevice::setFormatSingleplane(V4L2DeviceFormat *format)\n>   *\n>   * \\return A list of the supported video device formats\n>   */\n> -std::map<V4L2PixelFormat, std::vector<SizeRange>> V4L2VideoDevice::formats(uint32_t code)\n> +ImageFormats<V4L2PixelFormat> V4L2VideoDevice::formats(uint32_t code)\n>  {\n> -\tstd::map<V4L2PixelFormat, std::vector<SizeRange>> formats;\n> +\tImageFormats<V4L2PixelFormat> formats;\n>  \n>  \tfor (V4L2PixelFormat pixelFormat : enumPixelformats(code)) {\n>  \t\tstd::vector<SizeRange> sizes = enumSizes(pixelFormat);","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CDDB6600F7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  6 Jun 2020 01:27:33 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3348627C;\n\tSat,  6 Jun 2020 01:27:33 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"h6CGOOHD\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1591399653;\n\tbh=N95u02RzvzK8ltf1ujmKwNbhEkVoe1aLhJnbPVrAs14=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=h6CGOOHDhqoiAv9l0dEuNgols5dJbq+NZcWffklcrvrwrGEZPeGyGBHw8ZKOv9z6i\n\tKUa5Du80qGzXOjxtRV4G0a94y7EJ/crIxdSFbiWhEIepRG2izXBrZUWaroXXDpRiGv\n\tzlU89vBm7GLHID5xjwJjVe8ZgFC+XsyJ7jsgB0vk=","Date":"Sat, 6 Jun 2020 02:27:14 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200605232714.GR26752@pendragon.ideasonboard.com>","References":"<20200529110335.620503-1-jacopo@jmondi.org>\n\t<20200529110335.620503-3-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200529110335.620503-3-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: v4l2_videodevice: Use\n\tImageFormats","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>","X-List-Received-Date":"Fri, 05 Jun 2020 23:27:34 -0000"}},{"id":5119,"web_url":"https://patchwork.libcamera.org/comment/5119/","msgid":"<20200608075921.wf637k4jat22y6va@uno.localdomain>","date":"2020-06-08T07:59:21","subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: v4l2_videodevice: Use\n\tImageFormats","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent,\n\nOn Sat, Jun 06, 2020 at 02:27:14AM +0300, Laurent Pinchart wrote:\n> Hi Jacopo,\n>\n> Thank you for the patch.\n>\n> On Fri, May 29, 2020 at 01:03:32PM +0200, Jacopo Mondi wrote:\n> > ImageFormats was meant to be used not only for V4L2Subdevice but\n> > for video devices as well. Since the introduction of of V4L2PixelFormat\n> > the V4L2VideoDevice class and its users have been using a raw map to\n> > enumerate and inspect the V4L2VideoDevice formats.\n> >\n> > Use the ImageFormats<V4L2PixelFormat> specialization in place of a raw\n> > map and update its usage in pipeline handlers.\n> >\n> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > ---\n> >  include/libcamera/internal/v4l2_videodevice.h   |  2 +-\n> >  .../pipeline/raspberrypi/raspberrypi.cpp        | 17 +++++++----------\n> >  src/libcamera/pipeline/simple/simple.cpp        |  3 +--\n> >  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp    |  3 +--\n> >  src/libcamera/v4l2_videodevice.cpp              |  4 ++--\n> >  5 files changed, 12 insertions(+), 17 deletions(-)\n> >\n> > diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h\n> > index dc259523599c..de4745982e94 100644\n> > --- a/include/libcamera/internal/v4l2_videodevice.h\n> > +++ b/include/libcamera/internal/v4l2_videodevice.h\n> > @@ -187,7 +187,7 @@ public:\n> >\n> >  \tint getFormat(V4L2DeviceFormat *format);\n> >  \tint setFormat(V4L2DeviceFormat *format);\n> > -\tstd::map<V4L2PixelFormat, std::vector<SizeRange>> formats(uint32_t code = 0);\n> > +\tImageFormats<V4L2PixelFormat> formats(uint32_t code = 0);\n> >\n> >  \tint setSelection(unsigned int target, Rectangle *rect);\n> >\n> > diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > index e16a9c7f10d3..64364afb3f7e 100644\n> > --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > @@ -37,8 +37,6 @@ namespace libcamera {\n> >\n> >  LOG_DEFINE_CATEGORY(RPI)\n> >\n> > -using V4L2PixFmtMap = std::map<V4L2PixelFormat, std::vector<SizeRange>>;\n> > -\n> >  namespace {\n> >\n> >  bool isRaw(PixelFormat &pixFmt)\n> > @@ -67,7 +65,7 @@ double scoreFormat(double desired, double actual)\n> >  \treturn score;\n> >  }\n> >\n> > -V4L2DeviceFormat findBestMode(V4L2PixFmtMap &formatsMap, const Size &req)\n> > +V4L2DeviceFormat findBestMode(ImageFormats<V4L2PixelFormat> &formatsMap, const Size &req)\n> >  {\n> >  \tdouble bestScore = 9e9, score;\n> >  \tV4L2DeviceFormat bestMode = {};\n> > @@ -79,12 +77,11 @@ V4L2DeviceFormat findBestMode(V4L2PixFmtMap &formatsMap, const Size &req)\n> >  #define PENALTY_UNPACKED\t 500.0\n> >\n> >  \t/* Calculate the closest/best mode from the user requested size. */\n> > -\tfor (const auto &iter : formatsMap) {\n> > -\t\tV4L2PixelFormat v4l2Format = iter.first;\n> > +\tfor (const auto &v4l2Format : formatsMap.formats()) {\n>\n> This will impact efficiency, as you will first create a temporary vector\n> calling formats(), with an additional but smaller impact when calling\n> size() below. Is this required ?\n>\n\nNo, it's for stylistic reasons mostly, and considering we'll usually\nhave no more than 2 or 3 formats to iterate on, I considered this a\nnegligible performance impact.\n\n> It's also a change that isn't described in the commit message, so I'd\n> split it to a separate patch if desired.\n\nI can drop this if it's controversial.\n\nThanks\n   j\n\n>\n> >  \t\tPixelFormat pixelFormat = v4l2Format.toPixelFormat();\n> >  \t\tconst PixelFormatInfo &info = PixelFormatInfo::info(pixelFormat);\n> >\n> > -\t\tfor (const SizeRange &sz : iter.second) {\n> > +\t\tfor (const SizeRange &sz : formatsMap.sizes(v4l2Format)) {\n> >  \t\t\tdouble modeWidth = sz.contains(req) ? req.width : sz.max.width;\n> >  \t\t\tdouble modeHeight = sz.contains(req) ? req.height : sz.max.height;\n> >  \t\t\tdouble reqAr = static_cast<double>(req.width) / req.height;\n> > @@ -427,7 +424,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()\n> >  \t\t\t * Calculate the best sensor mode we can use based on\n> >  \t\t\t * the user request.\n> >  \t\t\t */\n> > -\t\t\tV4L2PixFmtMap fmts = data_->unicam_[Unicam::Image].dev()->formats();\n> > +\t\t\tImageFormats<V4L2PixelFormat> fmts = data_->unicam_[Unicam::Image].dev()->formats();\n> >  \t\t\tV4L2DeviceFormat sensorFormat = findBestMode(fmts, cfg.size);\n> >  \t\t\tPixelFormat sensorPixFormat = sensorFormat.fourcc.toPixelFormat();\n> >  \t\t\tif (cfg.size != sensorFormat.size ||\n> > @@ -481,7 +478,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()\n> >  \t\t *\n> >  \t\t */\n> >  \t\tPixelFormat &cfgPixFmt = config_.at(outSize[i].first).pixelFormat;\n> > -\t\tV4L2PixFmtMap fmts;\n> > +\t\tImageFormats<V4L2PixelFormat> fmts;\n> >\n> >  \t\tif (i == maxIndex)\n> >  \t\t\tfmts = data_->isp_[Isp::Output0].dev()->formats();\n> > @@ -518,7 +515,7 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n> >  \tRPiCameraData *data = cameraData(camera);\n> >  \tCameraConfiguration *config = new RPiCameraConfiguration(data);\n> >  \tV4L2DeviceFormat sensorFormat;\n> > -\tV4L2PixFmtMap fmts;\n> > +\tImageFormats<V4L2PixelFormat> fmts;\n> >\n> >  \tif (roles.empty())\n> >  \t\treturn config;\n> > @@ -605,7 +602,7 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n> >  \t}\n> >\n> >  \t/* First calculate the best sensor mode we can use based on the user request. */\n> > -\tV4L2PixFmtMap fmts = data->unicam_[Unicam::Image].dev()->formats();\n> > +\tImageFormats<V4L2PixelFormat> fmts = data->unicam_[Unicam::Image].dev()->formats();\n> >  \tV4L2DeviceFormat sensorFormat = findBestMode(fmts, rawStream ? sensorSize : maxSize);\n> >\n> >  \t/*\n> > diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> > index 1ec8d0f7de03..f3e03ba60196 100644\n> > --- a/src/libcamera/pipeline/simple/simple.cpp\n> > +++ b/src/libcamera/pipeline/simple/simple.cpp\n> > @@ -275,8 +275,7 @@ int SimpleCameraData::init()\n> >  \t\t\treturn ret;\n> >  \t\t}\n> >\n> > -\t\tstd::map<V4L2PixelFormat, std::vector<SizeRange>> videoFormats =\n> > -\t\t\tvideo_->formats(format.mbus_code);\n> > +\t\tImageFormats<V4L2PixelFormat> videoFormats = video_->formats(format.mbus_code);\n> >\n> >  \t\tLOG(SimplePipeline, Debug)\n> >  \t\t\t<< \"Adding configuration for \" << format.size.toString()\n> > diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > index a074909499f1..dbd835f5c5ef 100644\n> > --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > @@ -159,8 +159,7 @@ CameraConfiguration *PipelineHandlerUVC::generateConfiguration(Camera *camera,\n> >  \tif (roles.empty())\n> >  \t\treturn config;\n> >\n> > -\tstd::map<V4L2PixelFormat, std::vector<SizeRange>> v4l2Formats =\n> > -\t\tdata->video_->formats();\n> > +\tImageFormats<V4L2PixelFormat> v4l2Formats = data->video_->formats();\n> >  \tstd::map<PixelFormat, std::vector<SizeRange>> deviceFormats;\n> >  \tstd::transform(v4l2Formats.begin(), v4l2Formats.end(),\n> >  \t\t       std::inserter(deviceFormats, deviceFormats.begin()),\n> > diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> > index 3614b2ed1cbc..ea952444e0ad 100644\n> > --- a/src/libcamera/v4l2_videodevice.cpp\n> > +++ b/src/libcamera/v4l2_videodevice.cpp\n> > @@ -925,9 +925,9 @@ int V4L2VideoDevice::setFormatSingleplane(V4L2DeviceFormat *format)\n> >   *\n> >   * \\return A list of the supported video device formats\n> >   */\n> > -std::map<V4L2PixelFormat, std::vector<SizeRange>> V4L2VideoDevice::formats(uint32_t code)\n> > +ImageFormats<V4L2PixelFormat> V4L2VideoDevice::formats(uint32_t code)\n> >  {\n> > -\tstd::map<V4L2PixelFormat, std::vector<SizeRange>> formats;\n> > +\tImageFormats<V4L2PixelFormat> formats;\n> >\n> >  \tfor (V4L2PixelFormat pixelFormat : enumPixelformats(code)) {\n> >  \t\tstd::vector<SizeRange> sizes = enumSizes(pixelFormat);\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net\n\t[217.70.183.193])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 69BEB63C5A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  8 Jun 2020 09:55:58 +0200 (CEST)","from uno.localdomain (2-224-242-101.ip172.fastwebnet.it\n\t[2.224.242.101]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 15479240006;\n\tMon,  8 Jun 2020 07:55:56 +0000 (UTC)"],"X-Originating-IP":"2.224.242.101","Date":"Mon, 8 Jun 2020 09:59:21 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200608075921.wf637k4jat22y6va@uno.localdomain>","References":"<20200529110335.620503-1-jacopo@jmondi.org>\n\t<20200529110335.620503-3-jacopo@jmondi.org>\n\t<20200605232714.GR26752@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200605232714.GR26752@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: v4l2_videodevice: Use\n\tImageFormats","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>","X-List-Received-Date":"Mon, 08 Jun 2020 07:55:59 -0000"}}]