[{"id":5080,"web_url":"https://patchwork.libcamera.org/comment/5080/","msgid":"<20200605233357.GT26752@pendragon.ideasonboard.com>","date":"2020-06-05T23:33:57","subject":"Re: [libcamera-devel] [PATCH 5/5] libcamera: v4l2_device: Rename\n\tformats() method","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:35PM +0200, Jacopo Mondi wrote:\n> Both the V4L2VideoDevice and V4L2Subdevice classes provide a formats()\n> methods which returns an ImageFormatMap specialization.\n> \n> The method name formats() collides with ImageFormatsMap::formats() and\n> makes accessing the map or the list of supported format identifiers\n> confusing.\n> \n> Rename the V4L2VideoDevice and V4L2Subdevice methods to imageFormats(),\n> to distinguish the two.\n\nThis makes lines a bit longer, and I don't find the formats() name\nconfusing, but I'm also not opposed to the new name. If you decide to\nkeep this patch (maybe wait a bit to see if you get more review\ncomments ?),\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  include/libcamera/internal/v4l2_subdevice.h        |  2 +-\n>  include/libcamera/internal/v4l2_videodevice.h      |  2 +-\n>  src/libcamera/camera_sensor.cpp                    |  2 +-\n>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 10 +++++-----\n>  src/libcamera/pipeline/simple/simple.cpp           |  2 +-\n>  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp       |  2 +-\n>  src/libcamera/v4l2_subdevice.cpp                   |  2 +-\n>  src/libcamera/v4l2_videodevice.cpp                 |  2 +-\n>  test/v4l2_subdevice/list_formats.cpp               |  6 +++---\n>  9 files changed, 15 insertions(+), 15 deletions(-)\n> \n> diff --git a/include/libcamera/internal/v4l2_subdevice.h b/include/libcamera/internal/v4l2_subdevice.h\n> index 06f10d7b4c5d..2218e90c1da6 100644\n> --- a/include/libcamera/internal/v4l2_subdevice.h\n> +++ b/include/libcamera/internal/v4l2_subdevice.h\n> @@ -53,7 +53,7 @@ public:\n>  \tint setSelection(unsigned int pad, unsigned int target,\n>  \t\t\t Rectangle *rect);\n>  \n> -\tformatsMap formats(unsigned int pad);\n> +\tformatsMap imageFormats(unsigned int pad);\n>  \n>  \tint getFormat(unsigned int pad, V4L2SubdeviceFormat *format,\n>  \t\t      Whence whence = ActiveFormat);\n> diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h\n> index 9632ad71b988..2d968797ee86 100644\n> --- a/include/libcamera/internal/v4l2_videodevice.h\n> +++ b/include/libcamera/internal/v4l2_videodevice.h\n> @@ -189,7 +189,7 @@ public:\n>  \n>  \tint getFormat(V4L2DeviceFormat *format);\n>  \tint setFormat(V4L2DeviceFormat *format);\n> -\tformatsMap formats(uint32_t code = 0);\n> +\tformatsMap imageFormats(uint32_t code = 0);\n>  \n>  \tint setSelection(unsigned int target, Rectangle *rect);\n>  \n> diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\n> index b14b4051dca6..8aafdfe76299 100644\n> --- a/src/libcamera/camera_sensor.cpp\n> +++ b/src/libcamera/camera_sensor.cpp\n> @@ -244,7 +244,7 @@ int CameraSensor::init()\n>  \tproperties_.set(properties::Rotation, propertyValue);\n>  \n>  \t/* Enumerate, sort and cache media bus codes and sizes. */\n> -\tformats_ = subdev_->formats(pad_);\n> +\tformats_ = subdev_->imageFormats(pad_);\n>  \tif (formats_.isEmpty()) {\n>  \t\tLOG(CameraSensor, Error) << \"No image format found\";\n>  \t\treturn -EINVAL;\n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index 7dd579090ec6..a407945819be 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -425,7 +425,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()\n>  \t\t\t * the user request.\n>  \t\t\t */\n>  \t\t\tV4L2VideoDevice::formatsMap fmts =\n> -\t\t\t\tdata_->unicam_[Unicam::Image].dev()->formats();\n> +\t\t\t\tdata_->unicam_[Unicam::Image].dev()->imageFormats();\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> @@ -482,9 +482,9 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()\n>  \t\tV4L2VideoDevice::formatsMap fmts;\n>  \n>  \t\tif (i == maxIndex)\n> -\t\t\tfmts = data_->isp_[Isp::Output0].dev()->formats();\n> +\t\t\tfmts = data_->isp_[Isp::Output0].dev()->imageFormats();\n>  \t\telse\n> -\t\t\tfmts = data_->isp_[Isp::Output1].dev()->formats();\n> +\t\t\tfmts = data_->isp_[Isp::Output1].dev()->imageFormats();\n>  \n>  \t\tif (fmts.find(V4L2PixelFormat::fromPixelFormat(cfgPixFmt, false)) == fmts.end()) {\n>  \t\t\t/* If we cannot find a native format, use a default one. */\n> @@ -527,7 +527,7 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>  \t\tswitch (role) {\n>  \t\tcase StreamRole::StillCaptureRaw:\n>  \t\t\tcfg.size = data->sensor_->resolution();\n> -\t\t\tfmts = data->unicam_[Unicam::Image].dev()->formats();\n> +\t\t\tfmts = data->unicam_[Unicam::Image].dev()->imageFormats();\n>  \t\t\tsensorFormat = findBestMode(fmts, cfg.size);\n>  \t\t\tcfg.pixelFormat = sensorFormat.fourcc.toPixelFormat();\n>  \t\t\tASSERT(cfg.pixelFormat.isValid());\n> @@ -603,7 +603,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> -\tV4L2VideoDevice::formatsMap fmts = data->unicam_[Unicam::Image].dev()->formats();\n> +\tV4L2VideoDevice::formatsMap fmts = data->unicam_[Unicam::Image].dev()->imageFormats();\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 feaa2854f037..6857ec75cb1f 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -275,7 +275,7 @@ int SimpleCameraData::init()\n>  \t\t\treturn ret;\n>  \t\t}\n>  \n> -\t\tV4L2VideoDevice::formatsMap videoFormats = video_->formats(format.mbus_code);\n> +\t\tV4L2VideoDevice::formatsMap videoFormats = video_->imageFormats(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 6250186e9390..39c8353a2adf 100644\n> --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> @@ -159,7 +159,7 @@ CameraConfiguration *PipelineHandlerUVC::generateConfiguration(Camera *camera,\n>  \tif (roles.empty())\n>  \t\treturn config;\n>  \n> -\tV4L2VideoDevice::formatsMap v4l2Formats = data->video_->formats();\n> +\tV4L2VideoDevice::formatsMap v4l2Formats = data->video_->imageFormats();\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_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> index 0dd8e8686967..24ca6d80b27e 100644\n> --- a/src/libcamera/v4l2_subdevice.cpp\n> +++ b/src/libcamera/v4l2_subdevice.cpp\n> @@ -325,7 +325,7 @@ int V4L2Subdevice::setSelection(unsigned int pad, unsigned int target,\n>   *\n>   * \\return A list of the supported device formats\n>   */\n> -V4L2Subdevice::formatsMap V4L2Subdevice::formats(unsigned int pad)\n> +V4L2Subdevice::formatsMap V4L2Subdevice::imageFormats(unsigned int pad)\n>  {\n>  \tformatsMap formats;\n>  \n> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> index 6d48018396c3..08cae92978d4 100644\n> --- a/src/libcamera/v4l2_videodevice.cpp\n> +++ b/src/libcamera/v4l2_videodevice.cpp\n> @@ -930,7 +930,7 @@ int V4L2VideoDevice::setFormatSingleplane(V4L2DeviceFormat *format)\n>   *\n>   * \\return A list of the supported video device formats\n>   */\n> -V4L2VideoDevice::formatsMap V4L2VideoDevice::formats(uint32_t code)\n> +V4L2VideoDevice::formatsMap V4L2VideoDevice::imageFormats(uint32_t code)\n>  {\n>  \tformatsMap formats;\n>  \n> diff --git a/test/v4l2_subdevice/list_formats.cpp b/test/v4l2_subdevice/list_formats.cpp\n> index a32f5c833c28..262362dee3c9 100644\n> --- a/test/v4l2_subdevice/list_formats.cpp\n> +++ b/test/v4l2_subdevice/list_formats.cpp\n> @@ -50,7 +50,7 @@ int ListFormatsTest::run()\n>  \t/* List all formats available on existing \"Scaler\" pads. */\n>  \tV4L2Subdevice::formatsMap formats;\n>  \n> -\tformats = scaler_->formats(0);\n> +\tformats = scaler_->imageFormats(0);\n>  \tif (formats.isEmpty()) {\n>  \t\tcerr << \"Failed to list formats on pad 0 of subdevice \"\n>  \t\t     << scaler_->entity()->name() << endl;\n> @@ -59,7 +59,7 @@ int ListFormatsTest::run()\n>  \tfor (unsigned int code : formats.formats())\n>  \t\tprintFormats(0, code, formats.sizes(code));\n>  \n> -\tformats = scaler_->formats(1);\n> +\tformats = scaler_->imageFormats(1);\n>  \tif (formats.isEmpty()) {\n>  \t\tcerr << \"Failed to list formats on pad 1 of subdevice \"\n>  \t\t     << scaler_->entity()->name() << endl;\n> @@ -69,7 +69,7 @@ int ListFormatsTest::run()\n>  \t\tprintFormats(1, code, formats.sizes(code));\n>  \n>  \t/* List format on a non-existing pad, format vector shall be empty. */\n> -\tformats = scaler_->formats(2);\n> +\tformats = scaler_->imageFormats(2);\n>  \tif (!formats.isEmpty()) {\n>  \t\tcerr << \"Listing formats on non-existing pad 2 of subdevice \"\n>  \t\t     << scaler_->entity()->name()","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["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 2C67F600F7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  6 Jun 2020 01:34:18 +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 74E5D27C;\n\tSat,  6 Jun 2020 01:34:17 +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=\"KWwuf5H4\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1591400057;\n\tbh=tefgOQtYTKqQJsA9lsU494hKx1C2dHoIsm3V2L4ezsk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=KWwuf5H4lMgHF6UxXih3aprYCOalFSXRWuIqbEB+3KKrPMlLXo1C6/idH9J4bL+6H\n\ti4ElGuWfoGfGAOysrxepO05dsYgvmxZ/peK98xdVbStxZdKUumtqAyfdVsgIX71rNb\n\tZCP7F7tHjFx0Jcn54H+xC8+IoSVt+daJCvNa7UKw=","Date":"Sat, 6 Jun 2020 02:33:57 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200605233357.GT26752@pendragon.ideasonboard.com>","References":"<20200529110335.620503-1-jacopo@jmondi.org>\n\t<20200529110335.620503-6-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200529110335.620503-6-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH 5/5] libcamera: v4l2_device: Rename\n\tformats() method","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:34:18 -0000"}},{"id":5122,"web_url":"https://patchwork.libcamera.org/comment/5122/","msgid":"<20200608080457.xa4bkq7w5aufuvsx@uno.localdomain>","date":"2020-06-08T08:04:57","subject":"Re: [libcamera-devel] [PATCH 5/5] libcamera: v4l2_device: Rename\n\tformats() method","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:33:57AM +0300, Laurent Pinchart wrote:\n> Hi Jacopo,\n>\n> Thank you for the patch.\n>\n> On Fri, May 29, 2020 at 01:03:35PM +0200, Jacopo Mondi wrote:\n> > Both the V4L2VideoDevice and V4L2Subdevice classes provide a formats()\n> > methods which returns an ImageFormatMap specialization.\n> >\n> > The method name formats() collides with ImageFormatsMap::formats() and\n> > makes accessing the map or the list of supported format identifiers\n> > confusing.\n> >\n> > Rename the V4L2VideoDevice and V4L2Subdevice methods to imageFormats(),\n> > to distinguish the two.\n>\n> This makes lines a bit longer, and I don't find the formats() name\n> confusing, but I'm also not opposed to the new name. If you decide to\n> keep this patch (maybe wait a bit to see if you get more review\n> comments ?),\n\nA bit longer, yes, but having to call .formats() on something you just\nobtained by calling a different .formats() method it's really not nice\nto me.\n\nI'll keep this one at the end of the series and see how it is received\nin v2.\n\n\n>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>\n> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > ---\n> >  include/libcamera/internal/v4l2_subdevice.h        |  2 +-\n> >  include/libcamera/internal/v4l2_videodevice.h      |  2 +-\n> >  src/libcamera/camera_sensor.cpp                    |  2 +-\n> >  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 10 +++++-----\n> >  src/libcamera/pipeline/simple/simple.cpp           |  2 +-\n> >  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp       |  2 +-\n> >  src/libcamera/v4l2_subdevice.cpp                   |  2 +-\n> >  src/libcamera/v4l2_videodevice.cpp                 |  2 +-\n> >  test/v4l2_subdevice/list_formats.cpp               |  6 +++---\n> >  9 files changed, 15 insertions(+), 15 deletions(-)\n> >\n> > diff --git a/include/libcamera/internal/v4l2_subdevice.h b/include/libcamera/internal/v4l2_subdevice.h\n> > index 06f10d7b4c5d..2218e90c1da6 100644\n> > --- a/include/libcamera/internal/v4l2_subdevice.h\n> > +++ b/include/libcamera/internal/v4l2_subdevice.h\n> > @@ -53,7 +53,7 @@ public:\n> >  \tint setSelection(unsigned int pad, unsigned int target,\n> >  \t\t\t Rectangle *rect);\n> >\n> > -\tformatsMap formats(unsigned int pad);\n> > +\tformatsMap imageFormats(unsigned int pad);\n> >\n> >  \tint getFormat(unsigned int pad, V4L2SubdeviceFormat *format,\n> >  \t\t      Whence whence = ActiveFormat);\n> > diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h\n> > index 9632ad71b988..2d968797ee86 100644\n> > --- a/include/libcamera/internal/v4l2_videodevice.h\n> > +++ b/include/libcamera/internal/v4l2_videodevice.h\n> > @@ -189,7 +189,7 @@ public:\n> >\n> >  \tint getFormat(V4L2DeviceFormat *format);\n> >  \tint setFormat(V4L2DeviceFormat *format);\n> > -\tformatsMap formats(uint32_t code = 0);\n> > +\tformatsMap imageFormats(uint32_t code = 0);\n> >\n> >  \tint setSelection(unsigned int target, Rectangle *rect);\n> >\n> > diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\n> > index b14b4051dca6..8aafdfe76299 100644\n> > --- a/src/libcamera/camera_sensor.cpp\n> > +++ b/src/libcamera/camera_sensor.cpp\n> > @@ -244,7 +244,7 @@ int CameraSensor::init()\n> >  \tproperties_.set(properties::Rotation, propertyValue);\n> >\n> >  \t/* Enumerate, sort and cache media bus codes and sizes. */\n> > -\tformats_ = subdev_->formats(pad_);\n> > +\tformats_ = subdev_->imageFormats(pad_);\n> >  \tif (formats_.isEmpty()) {\n> >  \t\tLOG(CameraSensor, Error) << \"No image format found\";\n> >  \t\treturn -EINVAL;\n> > diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > index 7dd579090ec6..a407945819be 100644\n> > --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > @@ -425,7 +425,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()\n> >  \t\t\t * the user request.\n> >  \t\t\t */\n> >  \t\t\tV4L2VideoDevice::formatsMap fmts =\n> > -\t\t\t\tdata_->unicam_[Unicam::Image].dev()->formats();\n> > +\t\t\t\tdata_->unicam_[Unicam::Image].dev()->imageFormats();\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> > @@ -482,9 +482,9 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()\n> >  \t\tV4L2VideoDevice::formatsMap fmts;\n> >\n> >  \t\tif (i == maxIndex)\n> > -\t\t\tfmts = data_->isp_[Isp::Output0].dev()->formats();\n> > +\t\t\tfmts = data_->isp_[Isp::Output0].dev()->imageFormats();\n> >  \t\telse\n> > -\t\t\tfmts = data_->isp_[Isp::Output1].dev()->formats();\n> > +\t\t\tfmts = data_->isp_[Isp::Output1].dev()->imageFormats();\n> >\n> >  \t\tif (fmts.find(V4L2PixelFormat::fromPixelFormat(cfgPixFmt, false)) == fmts.end()) {\n> >  \t\t\t/* If we cannot find a native format, use a default one. */\n> > @@ -527,7 +527,7 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n> >  \t\tswitch (role) {\n> >  \t\tcase StreamRole::StillCaptureRaw:\n> >  \t\t\tcfg.size = data->sensor_->resolution();\n> > -\t\t\tfmts = data->unicam_[Unicam::Image].dev()->formats();\n> > +\t\t\tfmts = data->unicam_[Unicam::Image].dev()->imageFormats();\n> >  \t\t\tsensorFormat = findBestMode(fmts, cfg.size);\n> >  \t\t\tcfg.pixelFormat = sensorFormat.fourcc.toPixelFormat();\n> >  \t\t\tASSERT(cfg.pixelFormat.isValid());\n> > @@ -603,7 +603,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> > -\tV4L2VideoDevice::formatsMap fmts = data->unicam_[Unicam::Image].dev()->formats();\n> > +\tV4L2VideoDevice::formatsMap fmts = data->unicam_[Unicam::Image].dev()->imageFormats();\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 feaa2854f037..6857ec75cb1f 100644\n> > --- a/src/libcamera/pipeline/simple/simple.cpp\n> > +++ b/src/libcamera/pipeline/simple/simple.cpp\n> > @@ -275,7 +275,7 @@ int SimpleCameraData::init()\n> >  \t\t\treturn ret;\n> >  \t\t}\n> >\n> > -\t\tV4L2VideoDevice::formatsMap videoFormats = video_->formats(format.mbus_code);\n> > +\t\tV4L2VideoDevice::formatsMap videoFormats = video_->imageFormats(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 6250186e9390..39c8353a2adf 100644\n> > --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > @@ -159,7 +159,7 @@ CameraConfiguration *PipelineHandlerUVC::generateConfiguration(Camera *camera,\n> >  \tif (roles.empty())\n> >  \t\treturn config;\n> >\n> > -\tV4L2VideoDevice::formatsMap v4l2Formats = data->video_->formats();\n> > +\tV4L2VideoDevice::formatsMap v4l2Formats = data->video_->imageFormats();\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_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> > index 0dd8e8686967..24ca6d80b27e 100644\n> > --- a/src/libcamera/v4l2_subdevice.cpp\n> > +++ b/src/libcamera/v4l2_subdevice.cpp\n> > @@ -325,7 +325,7 @@ int V4L2Subdevice::setSelection(unsigned int pad, unsigned int target,\n> >   *\n> >   * \\return A list of the supported device formats\n> >   */\n> > -V4L2Subdevice::formatsMap V4L2Subdevice::formats(unsigned int pad)\n> > +V4L2Subdevice::formatsMap V4L2Subdevice::imageFormats(unsigned int pad)\n> >  {\n> >  \tformatsMap formats;\n> >\n> > diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> > index 6d48018396c3..08cae92978d4 100644\n> > --- a/src/libcamera/v4l2_videodevice.cpp\n> > +++ b/src/libcamera/v4l2_videodevice.cpp\n> > @@ -930,7 +930,7 @@ int V4L2VideoDevice::setFormatSingleplane(V4L2DeviceFormat *format)\n> >   *\n> >   * \\return A list of the supported video device formats\n> >   */\n> > -V4L2VideoDevice::formatsMap V4L2VideoDevice::formats(uint32_t code)\n> > +V4L2VideoDevice::formatsMap V4L2VideoDevice::imageFormats(uint32_t code)\n> >  {\n> >  \tformatsMap formats;\n> >\n> > diff --git a/test/v4l2_subdevice/list_formats.cpp b/test/v4l2_subdevice/list_formats.cpp\n> > index a32f5c833c28..262362dee3c9 100644\n> > --- a/test/v4l2_subdevice/list_formats.cpp\n> > +++ b/test/v4l2_subdevice/list_formats.cpp\n> > @@ -50,7 +50,7 @@ int ListFormatsTest::run()\n> >  \t/* List all formats available on existing \"Scaler\" pads. */\n> >  \tV4L2Subdevice::formatsMap formats;\n> >\n> > -\tformats = scaler_->formats(0);\n> > +\tformats = scaler_->imageFormats(0);\n> >  \tif (formats.isEmpty()) {\n> >  \t\tcerr << \"Failed to list formats on pad 0 of subdevice \"\n> >  \t\t     << scaler_->entity()->name() << endl;\n> > @@ -59,7 +59,7 @@ int ListFormatsTest::run()\n> >  \tfor (unsigned int code : formats.formats())\n> >  \t\tprintFormats(0, code, formats.sizes(code));\n> >\n> > -\tformats = scaler_->formats(1);\n> > +\tformats = scaler_->imageFormats(1);\n> >  \tif (formats.isEmpty()) {\n> >  \t\tcerr << \"Failed to list formats on pad 1 of subdevice \"\n> >  \t\t     << scaler_->entity()->name() << endl;\n> > @@ -69,7 +69,7 @@ int ListFormatsTest::run()\n> >  \t\tprintFormats(1, code, formats.sizes(code));\n> >\n> >  \t/* List format on a non-existing pad, format vector shall be empty. */\n> > -\tformats = scaler_->formats(2);\n> > +\tformats = scaler_->imageFormats(2);\n> >  \tif (!formats.isEmpty()) {\n> >  \t\tcerr << \"Listing formats on non-existing pad 2 of subdevice \"\n> >  \t\t     << scaler_->entity()->name()\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net\n\t[217.70.183.198])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DB274603C7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  8 Jun 2020 10:01:33 +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 relay6-d.mail.gandi.net (Postfix) with ESMTPSA id B9647C0020;\n\tMon,  8 Jun 2020 08:01:32 +0000 (UTC)"],"X-Originating-IP":"2.224.242.101","Date":"Mon, 8 Jun 2020 10:04:57 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200608080457.xa4bkq7w5aufuvsx@uno.localdomain>","References":"<20200529110335.620503-1-jacopo@jmondi.org>\n\t<20200529110335.620503-6-jacopo@jmondi.org>\n\t<20200605233357.GT26752@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200605233357.GT26752@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 5/5] libcamera: v4l2_device: Rename\n\tformats() method","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 08:01:34 -0000"}}]