[{"id":19392,"web_url":"https://patchwork.libcamera.org/comment/19392/","msgid":"<de4faf7f-e67e-f054-e686-b550f62e7a26@ideasonboard.com>","date":"2021-09-06T05:39:48","subject":"Re: [libcamera-devel] [PATCH v2 03/27] libcamera: v4l2_videodevice:\n\tDrop toV4L2PixelFormat()","submitter":{"id":75,"url":"https://patchwork.libcamera.org/api/people/75/","name":"Jean-Michel Hautbois","email":"jeanmichel.hautbois@ideasonboard.com"},"content":"Hi Laurent,\n\nOn 06/09/2021 04:00, Laurent Pinchart wrote:\n> The V4L2VideoDevice::toV4L2PixelFormat() function is incorrectly\n> implemented, as it will pick a multi-planar format if the device\n> supports the multi-planar API, even if only single-planar formats are\n> supported. This currently works because the implementation calls\n> V4L2PixelFormat::fromPixelFormat(), which ignores the multiplanar\n> argument and always returns a single-planar format.\n> \n> Fixing this isn't trivial. As we don't need to support multi-planar V4L2\n> formats at this point, drop the function instead of pretending\n> everything is fine, and call V4L2PixelFormat::fromPixelFormat() directly\n> from pipeline handlers. As the single-planar case is the most common,\n> set the multiplanar argument to false by default to avoid long lines.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> ---\n>  include/libcamera/internal/v4l2_pixelformat.h   |  2 +-\n>  include/libcamera/internal/v4l2_videodevice.h   |  2 --\n>  src/libcamera/pipeline/ipu3/imgu.cpp            |  2 +-\n>  .../pipeline/raspberrypi/raspberrypi.cpp        |  8 ++++----\n>  src/libcamera/pipeline/rkisp1/rkisp1_path.cpp   |  6 +++---\n>  src/libcamera/pipeline/simple/converter.cpp     |  8 ++++----\n>  src/libcamera/pipeline/simple/simple.cpp        |  4 ++--\n>  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp    |  6 +++---\n>  src/libcamera/pipeline/vimc/vimc.cpp            |  8 ++++----\n>  src/libcamera/v4l2_videodevice.cpp              | 17 -----------------\n>  test/libtest/buffer_source.cpp                  |  3 +--\n>  11 files changed, 23 insertions(+), 43 deletions(-)\n> \n> diff --git a/include/libcamera/internal/v4l2_pixelformat.h b/include/libcamera/internal/v4l2_pixelformat.h\n> index 9bfd81ad6651..560c5c53c0c3 100644\n> --- a/include/libcamera/internal/v4l2_pixelformat.h\n> +++ b/include/libcamera/internal/v4l2_pixelformat.h\n> @@ -38,7 +38,7 @@ public:\n>  \n>  \tPixelFormat toPixelFormat() const;\n>  \tstatic V4L2PixelFormat fromPixelFormat(const PixelFormat &pixelFormat,\n> -\t\t\t\t\t       bool multiplanar);\n> +\t\t\t\t\t       bool multiplanar = false);\n>  \n>  private:\n>  \tuint32_t fourcc_;\n> diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h\n> index 7a145f608a5b..087ad067e37e 100644\n> --- a/include/libcamera/internal/v4l2_videodevice.h\n> +++ b/include/libcamera/internal/v4l2_videodevice.h\n> @@ -212,8 +212,6 @@ public:\n>  \tstatic std::unique_ptr<V4L2VideoDevice>\n>  \tfromEntityName(const MediaDevice *media, const std::string &entity);\n>  \n> -\tV4L2PixelFormat toV4L2PixelFormat(const PixelFormat &pixelFormat);\n> -\n>  protected:\n>  \tstd::string logPrefix() const override;\n>  \n> diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp\n> index 317e482a1498..3e1ef645ec93 100644\n> --- a/src/libcamera/pipeline/ipu3/imgu.cpp\n> +++ b/src/libcamera/pipeline/ipu3/imgu.cpp\n> @@ -575,7 +575,7 @@ int ImgUDevice::configureVideoDevice(V4L2VideoDevice *dev, unsigned int pad,\n>  \t\treturn 0;\n>  \n>  \t*outputFormat = {};\n> -\toutputFormat->fourcc = dev->toV4L2PixelFormat(formats::NV12);\n> +\toutputFormat->fourcc = V4L2PixelFormat::fromPixelFormat(formats::NV12);\n>  \toutputFormat->size = cfg.size;\n>  \toutputFormat->planesCount = 2;\n>  \n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index b2674ac02109..0bdfa7273ce0 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -440,14 +440,14 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()\n>  \n>  \t\tV4L2VideoDevice::Formats fmts = dev->formats();\n>  \n> -\t\tif (fmts.find(V4L2PixelFormat::fromPixelFormat(cfgPixFmt, false)) == fmts.end()) {\n> +\t\tif (fmts.find(V4L2PixelFormat::fromPixelFormat(cfgPixFmt)) == fmts.end()) {\n>  \t\t\t/* If we cannot find a native format, use a default one. */\n>  \t\t\tcfgPixFmt = formats::NV12;\n>  \t\t\tstatus = Adjusted;\n>  \t\t}\n>  \n>  \t\tV4L2DeviceFormat format;\n> -\t\tformat.fourcc = dev->toV4L2PixelFormat(cfg.pixelFormat);\n> +\t\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n>  \t\tformat.size = cfg.size;\n>  \n>  \t\tint ret = dev->tryFormat(&format);\n> @@ -647,7 +647,7 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n>  \t\tRPi::Stream *stream = i == maxIndex ? &data->isp_[Isp::Output0]\n>  \t\t\t\t\t\t    : &data->isp_[Isp::Output1];\n>  \n> -\t\tV4L2PixelFormat fourcc = stream->dev()->toV4L2PixelFormat(cfg.pixelFormat);\n> +\t\tV4L2PixelFormat fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n>  \t\tformat.size = cfg.size;\n>  \t\tformat.fourcc = fourcc;\n>  \n> @@ -688,7 +688,7 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n>  \t\tmaxSize = Size(320, 240);\n>  \t\tformat = {};\n>  \t\tformat.size = maxSize;\n> -\t\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(formats::YUV420, false);\n> +\t\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(formats::YUV420);\n>  \t\tret = data->isp_[Isp::Output0].dev()->setFormat(&format);\n>  \t\tif (ret) {\n>  \t\t\tLOG(RPI, Error)\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> index 25f482eb8d8e..f8d471204d2e 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> @@ -80,7 +80,7 @@ CameraConfiguration::Status RkISP1Path::validate(StreamConfiguration *cfg)\n>  \tcfg->bufferCount = RKISP1_BUFFER_COUNT;\n>  \n>  \tV4L2DeviceFormat format;\n> -\tformat.fourcc = video_->toV4L2PixelFormat(cfg->pixelFormat);\n> +\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(cfg->pixelFormat);\n>  \tformat.size = cfg->size;\n>  \n>  \tint ret = video_->tryFormat(&format);\n> @@ -146,7 +146,7 @@ int RkISP1Path::configure(const StreamConfiguration &config,\n>  \n>  \tconst PixelFormatInfo &info = PixelFormatInfo::info(config.pixelFormat);\n>  \tV4L2DeviceFormat outputFormat;\n> -\toutputFormat.fourcc = video_->toV4L2PixelFormat(config.pixelFormat);\n> +\toutputFormat.fourcc = V4L2PixelFormat::fromPixelFormat(config.pixelFormat);\n>  \toutputFormat.size = config.size;\n>  \toutputFormat.planesCount = info.numPlanes();\n>  \n> @@ -155,7 +155,7 @@ int RkISP1Path::configure(const StreamConfiguration &config,\n>  \t\treturn ret;\n>  \n>  \tif (outputFormat.size != config.size ||\n> -\t    outputFormat.fourcc != video_->toV4L2PixelFormat(config.pixelFormat)) {\n> +\t    outputFormat.fourcc != V4L2PixelFormat::fromPixelFormat(config.pixelFormat)) {\n>  \t\tLOG(RkISP1, Error)\n>  \t\t\t<< \"Unable to configure capture in \" << config.toString();\n>  \t\treturn -EINVAL;\n> diff --git a/src/libcamera/pipeline/simple/converter.cpp b/src/libcamera/pipeline/simple/converter.cpp\n> index b5e34c4cd0c5..9cbc6ee30ce4 100644\n> --- a/src/libcamera/pipeline/simple/converter.cpp\n> +++ b/src/libcamera/pipeline/simple/converter.cpp\n> @@ -46,7 +46,7 @@ int SimpleConverter::Stream::configure(const StreamConfiguration &inputCfg,\n>  \t\t\t\t       const StreamConfiguration &outputCfg)\n>  {\n>  \tV4L2PixelFormat videoFormat =\n> -\t\tm2m_->output()->toV4L2PixelFormat(inputCfg.pixelFormat);\n> +\t\tV4L2PixelFormat::fromPixelFormat(inputCfg.pixelFormat);\n>  \n>  \tV4L2DeviceFormat format;\n>  \tformat.fourcc = videoFormat;\n> @@ -71,7 +71,7 @@ int SimpleConverter::Stream::configure(const StreamConfiguration &inputCfg,\n>  \t}\n>  \n>  \t/* Set the pixel format and size on the output. */\n> -\tvideoFormat = m2m_->capture()->toV4L2PixelFormat(outputCfg.pixelFormat);\n> +\tvideoFormat = V4L2PixelFormat::fromPixelFormat(outputCfg.pixelFormat);\n>  \tformat = {};\n>  \tformat.fourcc = videoFormat;\n>  \tformat.size = outputCfg.size;\n> @@ -210,7 +210,7 @@ std::vector<PixelFormat> SimpleConverter::formats(PixelFormat input)\n>  \t * enumerate the conversion capabilities on its output (V4L2 capture).\n>  \t */\n>  \tV4L2DeviceFormat v4l2Format;\n> -\tv4l2Format.fourcc = m2m_->output()->toV4L2PixelFormat(input);\n> +\tv4l2Format.fourcc = V4L2PixelFormat::fromPixelFormat(input);\n>  \tv4l2Format.size = { 1, 1 };\n>  \n>  \tint ret = m2m_->output()->setFormat(&v4l2Format);\n> @@ -281,7 +281,7 @@ SimpleConverter::strideAndFrameSize(const PixelFormat &pixelFormat,\n>  \t\t\t\t    const Size &size)\n>  {\n>  \tV4L2DeviceFormat format;\n> -\tformat.fourcc = m2m_->capture()->toV4L2PixelFormat(pixelFormat);\n> +\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(pixelFormat);\n>  \tformat.size = size;\n>  \n>  \tint ret = m2m_->capture()->tryFormat(&format);\n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index cadaf5d030ab..701fb4be0b71 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -826,7 +826,7 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate()\n>  \t\t\t\treturn Invalid;\n>  \t\t} else {\n>  \t\t\tV4L2DeviceFormat format;\n> -\t\t\tformat.fourcc = data_->video_->toV4L2PixelFormat(cfg.pixelFormat);\n> +\t\t\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n>  \t\t\tformat.size = cfg.size;\n>  \n>  \t\t\tint ret = data_->video_->tryFormat(&format);\n> @@ -915,7 +915,7 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n>  \t\treturn ret;\n>  \n>  \t/* Configure the video node. */\n> -\tV4L2PixelFormat videoFormat = video->toV4L2PixelFormat(pipeConfig->captureFormat);\n> +\tV4L2PixelFormat videoFormat = V4L2PixelFormat::fromPixelFormat(pipeConfig->captureFormat);\n>  \n>  \tV4L2DeviceFormat captureFormat;\n>  \tcaptureFormat.fourcc = videoFormat;\n> diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> index 973ecd5b835e..264f5370cf32 100644\n> --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> @@ -151,7 +151,7 @@ CameraConfiguration::Status UVCCameraConfiguration::validate()\n>  \tcfg.bufferCount = 4;\n>  \n>  \tV4L2DeviceFormat format;\n> -\tformat.fourcc = data_->video_->toV4L2PixelFormat(cfg.pixelFormat);\n> +\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n>  \tformat.size = cfg.size;\n>  \n>  \tint ret = data_->video_->tryFormat(&format);\n> @@ -207,7 +207,7 @@ int PipelineHandlerUVC::configure(Camera *camera, CameraConfiguration *config)\n>  \tint ret;\n>  \n>  \tV4L2DeviceFormat format;\n> -\tformat.fourcc = data->video_->toV4L2PixelFormat(cfg.pixelFormat);\n> +\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n>  \tformat.size = cfg.size;\n>  \n>  \tret = data->video_->setFormat(&format);\n> @@ -215,7 +215,7 @@ int PipelineHandlerUVC::configure(Camera *camera, CameraConfiguration *config)\n>  \t\treturn ret;\n>  \n>  \tif (format.size != cfg.size ||\n> -\t    format.fourcc != data->video_->toV4L2PixelFormat(cfg.pixelFormat))\n> +\t    format.fourcc != V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat))\n>  \t\treturn -EINVAL;\n>  \n>  \tcfg.setStream(&data->stream_);\n> diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\n> index baeb6a7e6fa6..e453091da4b2 100644\n> --- a/src/libcamera/pipeline/vimc/vimc.cpp\n> +++ b/src/libcamera/pipeline/vimc/vimc.cpp\n> @@ -170,7 +170,7 @@ CameraConfiguration::Status VimcCameraConfiguration::validate()\n>  \tcfg.bufferCount = 4;\n>  \n>  \tV4L2DeviceFormat format;\n> -\tformat.fourcc = data_->video_->toV4L2PixelFormat(cfg.pixelFormat);\n> +\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n>  \tformat.size = cfg.size;\n>  \n>  \tint ret = data_->video_->tryFormat(&format);\n> @@ -274,7 +274,7 @@ int PipelineHandlerVimc::configure(Camera *camera, CameraConfiguration *config)\n>  \t\treturn ret;\n>  \n>  \tV4L2DeviceFormat format;\n> -\tformat.fourcc = data->video_->toV4L2PixelFormat(cfg.pixelFormat);\n> +\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n>  \tformat.size = cfg.size;\n>  \n>  \tret = data->video_->setFormat(&format);\n> @@ -282,7 +282,7 @@ int PipelineHandlerVimc::configure(Camera *camera, CameraConfiguration *config)\n>  \t\treturn ret;\n>  \n>  \tif (format.size != cfg.size ||\n> -\t    format.fourcc != data->video_->toV4L2PixelFormat(cfg.pixelFormat))\n> +\t    format.fourcc != V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat))\n>  \t\treturn -EINVAL;\n>  \n>  \t/*\n> @@ -597,7 +597,7 @@ int VimcCameraData::allocateMockIPABuffers()\n>  \tconstexpr unsigned int kBufCount = 2;\n>  \n>  \tV4L2DeviceFormat format;\n> -\tformat.fourcc = video_->toV4L2PixelFormat(formats::BGR888);\n> +\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(formats::BGR888);\n>  \tformat.size = Size (160, 120);\n>  \n>  \tint ret = video_->setFormat(&format);\n> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> index 4e1c2b7cef5e..84ccb97495f5 100644\n> --- a/src/libcamera/v4l2_videodevice.cpp\n> +++ b/src/libcamera/v4l2_videodevice.cpp\n> @@ -1687,23 +1687,6 @@ V4L2VideoDevice::fromEntityName(const MediaDevice *media,\n>  \treturn std::make_unique<V4L2VideoDevice>(mediaEntity);\n>  }\n>  \n> -/**\n> - * \\brief Convert \\a PixelFormat to its corresponding V4L2 FourCC\n> - * \\param[in] pixelFormat The PixelFormat to convert\n> - *\n> - * For multiplanar formats, the V4L2 format variant (contiguous or\n> - * non-contiguous planes) is selected automatically based on the capabilities\n> - * of the video device. If the video device supports the V4L2 multiplanar API,\n> - * non-contiguous formats are preferred.\n> - *\n> - * \\return The V4L2_PIX_FMT_* pixel format code corresponding to \\a pixelFormat\n> - */\n> -V4L2PixelFormat V4L2VideoDevice::toV4L2PixelFormat(const PixelFormat &pixelFormat)\n> -{\n> -\treturn V4L2PixelFormat::fromPixelFormat(pixelFormat,\n> -\t\t\t\t\t\tcaps_.isMultiplanar());\n> -}\n> -\n>  /**\n>   * \\class V4L2M2MDevice\n>   * \\brief Memory-to-Memory video device\n> diff --git a/test/libtest/buffer_source.cpp b/test/libtest/buffer_source.cpp\n> index 73563f2fc39d..64e7376ad575 100644\n> --- a/test/libtest/buffer_source.cpp\n> +++ b/test/libtest/buffer_source.cpp\n> @@ -70,8 +70,7 @@ int BufferSource::allocate(const StreamConfiguration &config)\n>  \t}\n>  \n>  \tformat.size = config.size;\n> -\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(config.pixelFormat,\n> -\t\t\t\t\t\t\t false);\n> +\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(config.pixelFormat);\n>  \tif (video->setFormat(&format)) {\n>  \t\tstd::cout << \"Failed to set format on output device\" << std::endl;\n>  \t\treturn TestFail;\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 7B981BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Sep 2021 05:39:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EBC166916A;\n\tMon,  6 Sep 2021 07:39:52 +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 B4B8D6024D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Sep 2021 07:39:51 +0200 (CEST)","from tatooine.ideasonboard.com (unknown\n\t[IPv6:2a01:e0a:169:7140:eb18:8e30:9b7:f998])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4F739317;\n\tMon,  6 Sep 2021 07:39:51 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"FyrSQ1Mn\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1630906791;\n\tbh=q/EqqEZj1Qc3ud+DTqyDyvUGNIFAOnH4Z3RWpA3aN94=;\n\th=Subject:To:References:From:Date:In-Reply-To:From;\n\tb=FyrSQ1MnjWPf365ICfxpcZV4nsEf0+vuCR2dqbHWQ2BWQ9lFtyBfYx1u9xSltVTM4\n\tHLwpj0/kLotNlqXezARjDqnSUxmj4DUuPN8reC8A6xja866Rhu7z/3OG33ZhYSznej\n\toiagBz1qgCmrDTN+cDkksSLo7AomwoE2heuIS1Yc=","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20210906020100.14430-1-laurent.pinchart@ideasonboard.com>\n\t<20210906020100.14430-4-laurent.pinchart@ideasonboard.com>","From":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Message-ID":"<de4faf7f-e67e-f054-e686-b550f62e7a26@ideasonboard.com>","Date":"Mon, 6 Sep 2021 07:39:48 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.13.0","MIME-Version":"1.0","In-Reply-To":"<20210906020100.14430-4-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v2 03/27] libcamera: v4l2_videodevice:\n\tDrop toV4L2PixelFormat()","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":19419,"web_url":"https://patchwork.libcamera.org/comment/19419/","msgid":"<eb3d23c3-6161-6a9c-f2a8-9305b995376c@ideasonboard.com>","date":"2021-09-06T10:39:50","subject":"Re: [libcamera-devel] [PATCH v2 03/27] libcamera: v4l2_videodevice:\n\tDrop toV4L2PixelFormat()","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Laurent,\n\nOn 06/09/2021 03:00, Laurent Pinchart wrote:\n> The V4L2VideoDevice::toV4L2PixelFormat() function is incorrectly\n> implemented, as it will pick a multi-planar format if the device\n> supports the multi-planar API, even if only single-planar formats are\n> supported. This currently works because the implementation calls\n> V4L2PixelFormat::fromPixelFormat(), which ignores the multiplanar\n> argument and always returns a single-planar format.\n> \n> Fixing this isn't trivial. As we don't need to support multi-planar V4L2\n> formats at this point, drop the function instead of pretending\n> everything is fine, and call V4L2PixelFormat::fromPixelFormat() directly\n> from pipeline handlers. As the single-planar case is the most common,\n> set the multiplanar argument to false by default to avoid long lines.\n\nSeems fine to me.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  include/libcamera/internal/v4l2_pixelformat.h   |  2 +-\n>  include/libcamera/internal/v4l2_videodevice.h   |  2 --\n>  src/libcamera/pipeline/ipu3/imgu.cpp            |  2 +-\n>  .../pipeline/raspberrypi/raspberrypi.cpp        |  8 ++++----\n>  src/libcamera/pipeline/rkisp1/rkisp1_path.cpp   |  6 +++---\n>  src/libcamera/pipeline/simple/converter.cpp     |  8 ++++----\n>  src/libcamera/pipeline/simple/simple.cpp        |  4 ++--\n>  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp    |  6 +++---\n>  src/libcamera/pipeline/vimc/vimc.cpp            |  8 ++++----\n>  src/libcamera/v4l2_videodevice.cpp              | 17 -----------------\n>  test/libtest/buffer_source.cpp                  |  3 +--\n>  11 files changed, 23 insertions(+), 43 deletions(-)\n> \n> diff --git a/include/libcamera/internal/v4l2_pixelformat.h b/include/libcamera/internal/v4l2_pixelformat.h\n> index 9bfd81ad6651..560c5c53c0c3 100644\n> --- a/include/libcamera/internal/v4l2_pixelformat.h\n> +++ b/include/libcamera/internal/v4l2_pixelformat.h\n> @@ -38,7 +38,7 @@ public:\n>  \n>  \tPixelFormat toPixelFormat() const;\n>  \tstatic V4L2PixelFormat fromPixelFormat(const PixelFormat &pixelFormat,\n> -\t\t\t\t\t       bool multiplanar);\n> +\t\t\t\t\t       bool multiplanar = false);\n>  \n>  private:\n>  \tuint32_t fourcc_;\n> diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h\n> index 7a145f608a5b..087ad067e37e 100644\n> --- a/include/libcamera/internal/v4l2_videodevice.h\n> +++ b/include/libcamera/internal/v4l2_videodevice.h\n> @@ -212,8 +212,6 @@ public:\n>  \tstatic std::unique_ptr<V4L2VideoDevice>\n>  \tfromEntityName(const MediaDevice *media, const std::string &entity);\n>  \n> -\tV4L2PixelFormat toV4L2PixelFormat(const PixelFormat &pixelFormat);\n> -\n>  protected:\n>  \tstd::string logPrefix() const override;\n>  \n> diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp\n> index 317e482a1498..3e1ef645ec93 100644\n> --- a/src/libcamera/pipeline/ipu3/imgu.cpp\n> +++ b/src/libcamera/pipeline/ipu3/imgu.cpp\n> @@ -575,7 +575,7 @@ int ImgUDevice::configureVideoDevice(V4L2VideoDevice *dev, unsigned int pad,\n>  \t\treturn 0;\n>  \n>  \t*outputFormat = {};\n> -\toutputFormat->fourcc = dev->toV4L2PixelFormat(formats::NV12);\n> +\toutputFormat->fourcc = V4L2PixelFormat::fromPixelFormat(formats::NV12);\n>  \toutputFormat->size = cfg.size;\n>  \toutputFormat->planesCount = 2;\n>  \n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index b2674ac02109..0bdfa7273ce0 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -440,14 +440,14 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()\n>  \n>  \t\tV4L2VideoDevice::Formats fmts = dev->formats();\n>  \n> -\t\tif (fmts.find(V4L2PixelFormat::fromPixelFormat(cfgPixFmt, false)) == fmts.end()) {\n> +\t\tif (fmts.find(V4L2PixelFormat::fromPixelFormat(cfgPixFmt)) == fmts.end()) {\n>  \t\t\t/* If we cannot find a native format, use a default one. */\n>  \t\t\tcfgPixFmt = formats::NV12;\n>  \t\t\tstatus = Adjusted;\n>  \t\t}\n>  \n>  \t\tV4L2DeviceFormat format;\n> -\t\tformat.fourcc = dev->toV4L2PixelFormat(cfg.pixelFormat);\n> +\t\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n>  \t\tformat.size = cfg.size;\n>  \n>  \t\tint ret = dev->tryFormat(&format);\n> @@ -647,7 +647,7 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n>  \t\tRPi::Stream *stream = i == maxIndex ? &data->isp_[Isp::Output0]\n>  \t\t\t\t\t\t    : &data->isp_[Isp::Output1];\n>  \n> -\t\tV4L2PixelFormat fourcc = stream->dev()->toV4L2PixelFormat(cfg.pixelFormat);\n> +\t\tV4L2PixelFormat fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n>  \t\tformat.size = cfg.size;\n>  \t\tformat.fourcc = fourcc;\n>  \n> @@ -688,7 +688,7 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n>  \t\tmaxSize = Size(320, 240);\n>  \t\tformat = {};\n>  \t\tformat.size = maxSize;\n> -\t\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(formats::YUV420, false);\n> +\t\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(formats::YUV420);\n>  \t\tret = data->isp_[Isp::Output0].dev()->setFormat(&format);\n>  \t\tif (ret) {\n>  \t\t\tLOG(RPI, Error)\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> index 25f482eb8d8e..f8d471204d2e 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> @@ -80,7 +80,7 @@ CameraConfiguration::Status RkISP1Path::validate(StreamConfiguration *cfg)\n>  \tcfg->bufferCount = RKISP1_BUFFER_COUNT;\n>  \n>  \tV4L2DeviceFormat format;\n> -\tformat.fourcc = video_->toV4L2PixelFormat(cfg->pixelFormat);\n> +\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(cfg->pixelFormat);\n>  \tformat.size = cfg->size;\n>  \n>  \tint ret = video_->tryFormat(&format);\n> @@ -146,7 +146,7 @@ int RkISP1Path::configure(const StreamConfiguration &config,\n>  \n>  \tconst PixelFormatInfo &info = PixelFormatInfo::info(config.pixelFormat);\n>  \tV4L2DeviceFormat outputFormat;\n> -\toutputFormat.fourcc = video_->toV4L2PixelFormat(config.pixelFormat);\n> +\toutputFormat.fourcc = V4L2PixelFormat::fromPixelFormat(config.pixelFormat);\n>  \toutputFormat.size = config.size;\n>  \toutputFormat.planesCount = info.numPlanes();\n>  \n> @@ -155,7 +155,7 @@ int RkISP1Path::configure(const StreamConfiguration &config,\n>  \t\treturn ret;\n>  \n>  \tif (outputFormat.size != config.size ||\n> -\t    outputFormat.fourcc != video_->toV4L2PixelFormat(config.pixelFormat)) {\n> +\t    outputFormat.fourcc != V4L2PixelFormat::fromPixelFormat(config.pixelFormat)) {\n>  \t\tLOG(RkISP1, Error)\n>  \t\t\t<< \"Unable to configure capture in \" << config.toString();\n>  \t\treturn -EINVAL;\n> diff --git a/src/libcamera/pipeline/simple/converter.cpp b/src/libcamera/pipeline/simple/converter.cpp\n> index b5e34c4cd0c5..9cbc6ee30ce4 100644\n> --- a/src/libcamera/pipeline/simple/converter.cpp\n> +++ b/src/libcamera/pipeline/simple/converter.cpp\n> @@ -46,7 +46,7 @@ int SimpleConverter::Stream::configure(const StreamConfiguration &inputCfg,\n>  \t\t\t\t       const StreamConfiguration &outputCfg)\n>  {\n>  \tV4L2PixelFormat videoFormat =\n> -\t\tm2m_->output()->toV4L2PixelFormat(inputCfg.pixelFormat);\n> +\t\tV4L2PixelFormat::fromPixelFormat(inputCfg.pixelFormat);\n>  \n>  \tV4L2DeviceFormat format;\n>  \tformat.fourcc = videoFormat;\n> @@ -71,7 +71,7 @@ int SimpleConverter::Stream::configure(const StreamConfiguration &inputCfg,\n>  \t}\n>  \n>  \t/* Set the pixel format and size on the output. */\n> -\tvideoFormat = m2m_->capture()->toV4L2PixelFormat(outputCfg.pixelFormat);\n> +\tvideoFormat = V4L2PixelFormat::fromPixelFormat(outputCfg.pixelFormat);\n>  \tformat = {};\n>  \tformat.fourcc = videoFormat;\n>  \tformat.size = outputCfg.size;\n> @@ -210,7 +210,7 @@ std::vector<PixelFormat> SimpleConverter::formats(PixelFormat input)\n>  \t * enumerate the conversion capabilities on its output (V4L2 capture).\n>  \t */\n>  \tV4L2DeviceFormat v4l2Format;\n> -\tv4l2Format.fourcc = m2m_->output()->toV4L2PixelFormat(input);\n> +\tv4l2Format.fourcc = V4L2PixelFormat::fromPixelFormat(input);\n>  \tv4l2Format.size = { 1, 1 };\n>  \n>  \tint ret = m2m_->output()->setFormat(&v4l2Format);\n> @@ -281,7 +281,7 @@ SimpleConverter::strideAndFrameSize(const PixelFormat &pixelFormat,\n>  \t\t\t\t    const Size &size)\n>  {\n>  \tV4L2DeviceFormat format;\n> -\tformat.fourcc = m2m_->capture()->toV4L2PixelFormat(pixelFormat);\n> +\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(pixelFormat);\n>  \tformat.size = size;\n>  \n>  \tint ret = m2m_->capture()->tryFormat(&format);\n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index cadaf5d030ab..701fb4be0b71 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -826,7 +826,7 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate()\n>  \t\t\t\treturn Invalid;\n>  \t\t} else {\n>  \t\t\tV4L2DeviceFormat format;\n> -\t\t\tformat.fourcc = data_->video_->toV4L2PixelFormat(cfg.pixelFormat);\n> +\t\t\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n>  \t\t\tformat.size = cfg.size;\n>  \n>  \t\t\tint ret = data_->video_->tryFormat(&format);\n> @@ -915,7 +915,7 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n>  \t\treturn ret;\n>  \n>  \t/* Configure the video node. */\n> -\tV4L2PixelFormat videoFormat = video->toV4L2PixelFormat(pipeConfig->captureFormat);\n> +\tV4L2PixelFormat videoFormat = V4L2PixelFormat::fromPixelFormat(pipeConfig->captureFormat);\n>  \n>  \tV4L2DeviceFormat captureFormat;\n>  \tcaptureFormat.fourcc = videoFormat;\n> diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> index 973ecd5b835e..264f5370cf32 100644\n> --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> @@ -151,7 +151,7 @@ CameraConfiguration::Status UVCCameraConfiguration::validate()\n>  \tcfg.bufferCount = 4;\n>  \n>  \tV4L2DeviceFormat format;\n> -\tformat.fourcc = data_->video_->toV4L2PixelFormat(cfg.pixelFormat);\n> +\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n>  \tformat.size = cfg.size;\n>  \n>  \tint ret = data_->video_->tryFormat(&format);\n> @@ -207,7 +207,7 @@ int PipelineHandlerUVC::configure(Camera *camera, CameraConfiguration *config)\n>  \tint ret;\n>  \n>  \tV4L2DeviceFormat format;\n> -\tformat.fourcc = data->video_->toV4L2PixelFormat(cfg.pixelFormat);\n> +\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n>  \tformat.size = cfg.size;\n>  \n>  \tret = data->video_->setFormat(&format);\n> @@ -215,7 +215,7 @@ int PipelineHandlerUVC::configure(Camera *camera, CameraConfiguration *config)\n>  \t\treturn ret;\n>  \n>  \tif (format.size != cfg.size ||\n> -\t    format.fourcc != data->video_->toV4L2PixelFormat(cfg.pixelFormat))\n> +\t    format.fourcc != V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat))\n>  \t\treturn -EINVAL;\n>  \n>  \tcfg.setStream(&data->stream_);\n> diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\n> index baeb6a7e6fa6..e453091da4b2 100644\n> --- a/src/libcamera/pipeline/vimc/vimc.cpp\n> +++ b/src/libcamera/pipeline/vimc/vimc.cpp\n> @@ -170,7 +170,7 @@ CameraConfiguration::Status VimcCameraConfiguration::validate()\n>  \tcfg.bufferCount = 4;\n>  \n>  \tV4L2DeviceFormat format;\n> -\tformat.fourcc = data_->video_->toV4L2PixelFormat(cfg.pixelFormat);\n> +\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n>  \tformat.size = cfg.size;\n>  \n>  \tint ret = data_->video_->tryFormat(&format);\n> @@ -274,7 +274,7 @@ int PipelineHandlerVimc::configure(Camera *camera, CameraConfiguration *config)\n>  \t\treturn ret;\n>  \n>  \tV4L2DeviceFormat format;\n> -\tformat.fourcc = data->video_->toV4L2PixelFormat(cfg.pixelFormat);\n> +\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n>  \tformat.size = cfg.size;\n>  \n>  \tret = data->video_->setFormat(&format);\n> @@ -282,7 +282,7 @@ int PipelineHandlerVimc::configure(Camera *camera, CameraConfiguration *config)\n>  \t\treturn ret;\n>  \n>  \tif (format.size != cfg.size ||\n> -\t    format.fourcc != data->video_->toV4L2PixelFormat(cfg.pixelFormat))\n> +\t    format.fourcc != V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat))\n>  \t\treturn -EINVAL;\n>  \n>  \t/*\n> @@ -597,7 +597,7 @@ int VimcCameraData::allocateMockIPABuffers()\n>  \tconstexpr unsigned int kBufCount = 2;\n>  \n>  \tV4L2DeviceFormat format;\n> -\tformat.fourcc = video_->toV4L2PixelFormat(formats::BGR888);\n> +\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(formats::BGR888);\n>  \tformat.size = Size (160, 120);\n>  \n>  \tint ret = video_->setFormat(&format);\n> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> index 4e1c2b7cef5e..84ccb97495f5 100644\n> --- a/src/libcamera/v4l2_videodevice.cpp\n> +++ b/src/libcamera/v4l2_videodevice.cpp\n> @@ -1687,23 +1687,6 @@ V4L2VideoDevice::fromEntityName(const MediaDevice *media,\n>  \treturn std::make_unique<V4L2VideoDevice>(mediaEntity);\n>  }\n>  \n> -/**\n> - * \\brief Convert \\a PixelFormat to its corresponding V4L2 FourCC\n> - * \\param[in] pixelFormat The PixelFormat to convert\n> - *\n> - * For multiplanar formats, the V4L2 format variant (contiguous or\n> - * non-contiguous planes) is selected automatically based on the capabilities\n> - * of the video device. If the video device supports the V4L2 multiplanar API,\n> - * non-contiguous formats are preferred.\n> - *\n> - * \\return The V4L2_PIX_FMT_* pixel format code corresponding to \\a pixelFormat\n> - */\n> -V4L2PixelFormat V4L2VideoDevice::toV4L2PixelFormat(const PixelFormat &pixelFormat)\n> -{\n> -\treturn V4L2PixelFormat::fromPixelFormat(pixelFormat,\n> -\t\t\t\t\t\tcaps_.isMultiplanar());\n> -}\n> -\n>  /**\n>   * \\class V4L2M2MDevice\n>   * \\brief Memory-to-Memory video device\n> diff --git a/test/libtest/buffer_source.cpp b/test/libtest/buffer_source.cpp\n> index 73563f2fc39d..64e7376ad575 100644\n> --- a/test/libtest/buffer_source.cpp\n> +++ b/test/libtest/buffer_source.cpp\n> @@ -70,8 +70,7 @@ int BufferSource::allocate(const StreamConfiguration &config)\n>  \t}\n>  \n>  \tformat.size = config.size;\n> -\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(config.pixelFormat,\n> -\t\t\t\t\t\t\t false);\n> +\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(config.pixelFormat);\n>  \tif (video->setFormat(&format)) {\n>  \t\tstd::cout << \"Failed to set format on output device\" << std::endl;\n>  \t\treturn TestFail;\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 E1202BD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Sep 2021 10:39:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5258D6916C;\n\tMon,  6 Sep 2021 12:39:55 +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 1AA9F60137\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Sep 2021 12:39:54 +0200 (CEST)","from [192.168.0.20]\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 739F58AD;\n\tMon,  6 Sep 2021 12:39:53 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"BprE7lF5\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1630924793;\n\tbh=SzTzqs1GfnZ7K5aKbCseQNoQQyD6rjh9HqHnP0f33K8=;\n\th=To:References:From:Subject:Date:In-Reply-To:From;\n\tb=BprE7lF5ylCOQZU6rbhlZ/JgTouzz4olFvpaT/xHYt5w4W1uAwX10ZrgN3YdYDDfO\n\tTTbUDuKnpjRZbkPF+E3U8xiA/jt/4oM9mf5upJLveCfwHq2zRvaJhBMTdVYYEcNza/\n\tI0cq93+gmQYQ9QfxOlPMa1v6AI//tyTG97rDB964=","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20210906020100.14430-1-laurent.pinchart@ideasonboard.com>\n\t<20210906020100.14430-4-laurent.pinchart@ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<eb3d23c3-6161-6a9c-f2a8-9305b995376c@ideasonboard.com>","Date":"Mon, 6 Sep 2021 11:39:50 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.11.0","MIME-Version":"1.0","In-Reply-To":"<20210906020100.14430-4-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH v2 03/27] libcamera: v4l2_videodevice:\n\tDrop toV4L2PixelFormat()","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":19436,"web_url":"https://patchwork.libcamera.org/comment/19436/","msgid":"<CAO5uPHNOE7G1AiM9EKbbfjC4QvPy-8Wc=STFPTsRnQM60N-pLQ@mail.gmail.com>","date":"2021-09-06T12:32:04","subject":"Re: [libcamera-devel] [PATCH v2 03/27] libcamera: v4l2_videodevice:\n\tDrop toV4L2PixelFormat()","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Hi Laurent, thank you for the patch.\n\nOn Mon, Sep 6, 2021 at 7:39 PM Kieran Bingham\n<kieran.bingham@ideasonboard.com> wrote:\n>\n> Hi Laurent,\n>\n> On 06/09/2021 03:00, Laurent Pinchart wrote:\n> > The V4L2VideoDevice::toV4L2PixelFormat() function is incorrectly\n> > implemented, as it will pick a multi-planar format if the device\n> > supports the multi-planar API, even if only single-planar formats are\n> > supported. This currently works because the implementation calls\n> > V4L2PixelFormat::fromPixelFormat(), which ignores the multiplanar\n> > argument and always returns a single-planar format.\n> >\n> > Fixing this isn't trivial. As we don't need to support multi-planar V4L2\n> > formats at this point, drop the function instead of pretending\n> > everything is fine, and call V4L2PixelFormat::fromPixelFormat() directly\n> > from pipeline handlers. As the single-planar case is the most common,\n> > set the multiplanar argument to false by default to avoid long lines.\n>\n> Seems fine to me.\n>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>\n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n\nReviewed-by: Hirokazu Honda <hiroh@chromium.org>\n\n> > ---\n> >  include/libcamera/internal/v4l2_pixelformat.h   |  2 +-\n> >  include/libcamera/internal/v4l2_videodevice.h   |  2 --\n> >  src/libcamera/pipeline/ipu3/imgu.cpp            |  2 +-\n> >  .../pipeline/raspberrypi/raspberrypi.cpp        |  8 ++++----\n> >  src/libcamera/pipeline/rkisp1/rkisp1_path.cpp   |  6 +++---\n> >  src/libcamera/pipeline/simple/converter.cpp     |  8 ++++----\n> >  src/libcamera/pipeline/simple/simple.cpp        |  4 ++--\n> >  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp    |  6 +++---\n> >  src/libcamera/pipeline/vimc/vimc.cpp            |  8 ++++----\n> >  src/libcamera/v4l2_videodevice.cpp              | 17 -----------------\n> >  test/libtest/buffer_source.cpp                  |  3 +--\n> >  11 files changed, 23 insertions(+), 43 deletions(-)\n> >\n> > diff --git a/include/libcamera/internal/v4l2_pixelformat.h b/include/libcamera/internal/v4l2_pixelformat.h\n> > index 9bfd81ad6651..560c5c53c0c3 100644\n> > --- a/include/libcamera/internal/v4l2_pixelformat.h\n> > +++ b/include/libcamera/internal/v4l2_pixelformat.h\n> > @@ -38,7 +38,7 @@ public:\n> >\n> >       PixelFormat toPixelFormat() const;\n> >       static V4L2PixelFormat fromPixelFormat(const PixelFormat &pixelFormat,\n> > -                                            bool multiplanar);\n> > +                                            bool multiplanar = false);\n> >\n> >  private:\n> >       uint32_t fourcc_;\n> > diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h\n> > index 7a145f608a5b..087ad067e37e 100644\n> > --- a/include/libcamera/internal/v4l2_videodevice.h\n> > +++ b/include/libcamera/internal/v4l2_videodevice.h\n> > @@ -212,8 +212,6 @@ public:\n> >       static std::unique_ptr<V4L2VideoDevice>\n> >       fromEntityName(const MediaDevice *media, const std::string &entity);\n> >\n> > -     V4L2PixelFormat toV4L2PixelFormat(const PixelFormat &pixelFormat);\n> > -\n> >  protected:\n> >       std::string logPrefix() const override;\n> >\n> > diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp\n> > index 317e482a1498..3e1ef645ec93 100644\n> > --- a/src/libcamera/pipeline/ipu3/imgu.cpp\n> > +++ b/src/libcamera/pipeline/ipu3/imgu.cpp\n> > @@ -575,7 +575,7 @@ int ImgUDevice::configureVideoDevice(V4L2VideoDevice *dev, unsigned int pad,\n> >               return 0;\n> >\n> >       *outputFormat = {};\n> > -     outputFormat->fourcc = dev->toV4L2PixelFormat(formats::NV12);\n> > +     outputFormat->fourcc = V4L2PixelFormat::fromPixelFormat(formats::NV12);\n> >       outputFormat->size = cfg.size;\n> >       outputFormat->planesCount = 2;\n> >\n> > diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > index b2674ac02109..0bdfa7273ce0 100644\n> > --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > @@ -440,14 +440,14 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()\n> >\n> >               V4L2VideoDevice::Formats fmts = dev->formats();\n> >\n> > -             if (fmts.find(V4L2PixelFormat::fromPixelFormat(cfgPixFmt, false)) == fmts.end()) {\n> > +             if (fmts.find(V4L2PixelFormat::fromPixelFormat(cfgPixFmt)) == fmts.end()) {\n> >                       /* If we cannot find a native format, use a default one. */\n> >                       cfgPixFmt = formats::NV12;\n> >                       status = Adjusted;\n> >               }\n> >\n> >               V4L2DeviceFormat format;\n> > -             format.fourcc = dev->toV4L2PixelFormat(cfg.pixelFormat);\n> > +             format.fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n> >               format.size = cfg.size;\n> >\n> >               int ret = dev->tryFormat(&format);\n> > @@ -647,7 +647,7 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n> >               RPi::Stream *stream = i == maxIndex ? &data->isp_[Isp::Output0]\n> >                                                   : &data->isp_[Isp::Output1];\n> >\n> > -             V4L2PixelFormat fourcc = stream->dev()->toV4L2PixelFormat(cfg.pixelFormat);\n> > +             V4L2PixelFormat fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n> >               format.size = cfg.size;\n> >               format.fourcc = fourcc;\n> >\n> > @@ -688,7 +688,7 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n> >               maxSize = Size(320, 240);\n> >               format = {};\n> >               format.size = maxSize;\n> > -             format.fourcc = V4L2PixelFormat::fromPixelFormat(formats::YUV420, false);\n> > +             format.fourcc = V4L2PixelFormat::fromPixelFormat(formats::YUV420);\n> >               ret = data->isp_[Isp::Output0].dev()->setFormat(&format);\n> >               if (ret) {\n> >                       LOG(RPI, Error)\n> > diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> > index 25f482eb8d8e..f8d471204d2e 100644\n> > --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> > +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> > @@ -80,7 +80,7 @@ CameraConfiguration::Status RkISP1Path::validate(StreamConfiguration *cfg)\n> >       cfg->bufferCount = RKISP1_BUFFER_COUNT;\n> >\n> >       V4L2DeviceFormat format;\n> > -     format.fourcc = video_->toV4L2PixelFormat(cfg->pixelFormat);\n> > +     format.fourcc = V4L2PixelFormat::fromPixelFormat(cfg->pixelFormat);\n> >       format.size = cfg->size;\n> >\n> >       int ret = video_->tryFormat(&format);\n> > @@ -146,7 +146,7 @@ int RkISP1Path::configure(const StreamConfiguration &config,\n> >\n> >       const PixelFormatInfo &info = PixelFormatInfo::info(config.pixelFormat);\n> >       V4L2DeviceFormat outputFormat;\n> > -     outputFormat.fourcc = video_->toV4L2PixelFormat(config.pixelFormat);\n> > +     outputFormat.fourcc = V4L2PixelFormat::fromPixelFormat(config.pixelFormat);\n> >       outputFormat.size = config.size;\n> >       outputFormat.planesCount = info.numPlanes();\n> >\n> > @@ -155,7 +155,7 @@ int RkISP1Path::configure(const StreamConfiguration &config,\n> >               return ret;\n> >\n> >       if (outputFormat.size != config.size ||\n> > -         outputFormat.fourcc != video_->toV4L2PixelFormat(config.pixelFormat)) {\n> > +         outputFormat.fourcc != V4L2PixelFormat::fromPixelFormat(config.pixelFormat)) {\n> >               LOG(RkISP1, Error)\n> >                       << \"Unable to configure capture in \" << config.toString();\n> >               return -EINVAL;\n> > diff --git a/src/libcamera/pipeline/simple/converter.cpp b/src/libcamera/pipeline/simple/converter.cpp\n> > index b5e34c4cd0c5..9cbc6ee30ce4 100644\n> > --- a/src/libcamera/pipeline/simple/converter.cpp\n> > +++ b/src/libcamera/pipeline/simple/converter.cpp\n> > @@ -46,7 +46,7 @@ int SimpleConverter::Stream::configure(const StreamConfiguration &inputCfg,\n> >                                      const StreamConfiguration &outputCfg)\n> >  {\n> >       V4L2PixelFormat videoFormat =\n> > -             m2m_->output()->toV4L2PixelFormat(inputCfg.pixelFormat);\n> > +             V4L2PixelFormat::fromPixelFormat(inputCfg.pixelFormat);\n> >\n> >       V4L2DeviceFormat format;\n> >       format.fourcc = videoFormat;\n> > @@ -71,7 +71,7 @@ int SimpleConverter::Stream::configure(const StreamConfiguration &inputCfg,\n> >       }\n> >\n> >       /* Set the pixel format and size on the output. */\n> > -     videoFormat = m2m_->capture()->toV4L2PixelFormat(outputCfg.pixelFormat);\n> > +     videoFormat = V4L2PixelFormat::fromPixelFormat(outputCfg.pixelFormat);\n> >       format = {};\n> >       format.fourcc = videoFormat;\n> >       format.size = outputCfg.size;\n> > @@ -210,7 +210,7 @@ std::vector<PixelFormat> SimpleConverter::formats(PixelFormat input)\n> >        * enumerate the conversion capabilities on its output (V4L2 capture).\n> >        */\n> >       V4L2DeviceFormat v4l2Format;\n> > -     v4l2Format.fourcc = m2m_->output()->toV4L2PixelFormat(input);\n> > +     v4l2Format.fourcc = V4L2PixelFormat::fromPixelFormat(input);\n> >       v4l2Format.size = { 1, 1 };\n> >\n> >       int ret = m2m_->output()->setFormat(&v4l2Format);\n> > @@ -281,7 +281,7 @@ SimpleConverter::strideAndFrameSize(const PixelFormat &pixelFormat,\n> >                                   const Size &size)\n> >  {\n> >       V4L2DeviceFormat format;\n> > -     format.fourcc = m2m_->capture()->toV4L2PixelFormat(pixelFormat);\n> > +     format.fourcc = V4L2PixelFormat::fromPixelFormat(pixelFormat);\n> >       format.size = size;\n> >\n> >       int ret = m2m_->capture()->tryFormat(&format);\n> > diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> > index cadaf5d030ab..701fb4be0b71 100644\n> > --- a/src/libcamera/pipeline/simple/simple.cpp\n> > +++ b/src/libcamera/pipeline/simple/simple.cpp\n> > @@ -826,7 +826,7 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate()\n> >                               return Invalid;\n> >               } else {\n> >                       V4L2DeviceFormat format;\n> > -                     format.fourcc = data_->video_->toV4L2PixelFormat(cfg.pixelFormat);\n> > +                     format.fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n> >                       format.size = cfg.size;\n> >\n> >                       int ret = data_->video_->tryFormat(&format);\n> > @@ -915,7 +915,7 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n> >               return ret;\n> >\n> >       /* Configure the video node. */\n> > -     V4L2PixelFormat videoFormat = video->toV4L2PixelFormat(pipeConfig->captureFormat);\n> > +     V4L2PixelFormat videoFormat = V4L2PixelFormat::fromPixelFormat(pipeConfig->captureFormat);\n> >\n> >       V4L2DeviceFormat captureFormat;\n> >       captureFormat.fourcc = videoFormat;\n> > diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > index 973ecd5b835e..264f5370cf32 100644\n> > --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > @@ -151,7 +151,7 @@ CameraConfiguration::Status UVCCameraConfiguration::validate()\n> >       cfg.bufferCount = 4;\n> >\n> >       V4L2DeviceFormat format;\n> > -     format.fourcc = data_->video_->toV4L2PixelFormat(cfg.pixelFormat);\n> > +     format.fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n> >       format.size = cfg.size;\n> >\n> >       int ret = data_->video_->tryFormat(&format);\n> > @@ -207,7 +207,7 @@ int PipelineHandlerUVC::configure(Camera *camera, CameraConfiguration *config)\n> >       int ret;\n> >\n> >       V4L2DeviceFormat format;\n> > -     format.fourcc = data->video_->toV4L2PixelFormat(cfg.pixelFormat);\n> > +     format.fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n> >       format.size = cfg.size;\n> >\n> >       ret = data->video_->setFormat(&format);\n> > @@ -215,7 +215,7 @@ int PipelineHandlerUVC::configure(Camera *camera, CameraConfiguration *config)\n> >               return ret;\n> >\n> >       if (format.size != cfg.size ||\n> > -         format.fourcc != data->video_->toV4L2PixelFormat(cfg.pixelFormat))\n> > +         format.fourcc != V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat))\n> >               return -EINVAL;\n> >\n> >       cfg.setStream(&data->stream_);\n> > diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\n> > index baeb6a7e6fa6..e453091da4b2 100644\n> > --- a/src/libcamera/pipeline/vimc/vimc.cpp\n> > +++ b/src/libcamera/pipeline/vimc/vimc.cpp\n> > @@ -170,7 +170,7 @@ CameraConfiguration::Status VimcCameraConfiguration::validate()\n> >       cfg.bufferCount = 4;\n> >\n> >       V4L2DeviceFormat format;\n> > -     format.fourcc = data_->video_->toV4L2PixelFormat(cfg.pixelFormat);\n> > +     format.fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n> >       format.size = cfg.size;\n> >\n> >       int ret = data_->video_->tryFormat(&format);\n> > @@ -274,7 +274,7 @@ int PipelineHandlerVimc::configure(Camera *camera, CameraConfiguration *config)\n> >               return ret;\n> >\n> >       V4L2DeviceFormat format;\n> > -     format.fourcc = data->video_->toV4L2PixelFormat(cfg.pixelFormat);\n> > +     format.fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n> >       format.size = cfg.size;\n> >\n> >       ret = data->video_->setFormat(&format);\n> > @@ -282,7 +282,7 @@ int PipelineHandlerVimc::configure(Camera *camera, CameraConfiguration *config)\n> >               return ret;\n> >\n> >       if (format.size != cfg.size ||\n> > -         format.fourcc != data->video_->toV4L2PixelFormat(cfg.pixelFormat))\n> > +         format.fourcc != V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat))\n> >               return -EINVAL;\n> >\n> >       /*\n> > @@ -597,7 +597,7 @@ int VimcCameraData::allocateMockIPABuffers()\n> >       constexpr unsigned int kBufCount = 2;\n> >\n> >       V4L2DeviceFormat format;\n> > -     format.fourcc = video_->toV4L2PixelFormat(formats::BGR888);\n> > +     format.fourcc = V4L2PixelFormat::fromPixelFormat(formats::BGR888);\n> >       format.size = Size (160, 120);\n> >\n> >       int ret = video_->setFormat(&format);\n> > diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> > index 4e1c2b7cef5e..84ccb97495f5 100644\n> > --- a/src/libcamera/v4l2_videodevice.cpp\n> > +++ b/src/libcamera/v4l2_videodevice.cpp\n> > @@ -1687,23 +1687,6 @@ V4L2VideoDevice::fromEntityName(const MediaDevice *media,\n> >       return std::make_unique<V4L2VideoDevice>(mediaEntity);\n> >  }\n> >\n> > -/**\n> > - * \\brief Convert \\a PixelFormat to its corresponding V4L2 FourCC\n> > - * \\param[in] pixelFormat The PixelFormat to convert\n> > - *\n> > - * For multiplanar formats, the V4L2 format variant (contiguous or\n> > - * non-contiguous planes) is selected automatically based on the capabilities\n> > - * of the video device. If the video device supports the V4L2 multiplanar API,\n> > - * non-contiguous formats are preferred.\n> > - *\n> > - * \\return The V4L2_PIX_FMT_* pixel format code corresponding to \\a pixelFormat\n> > - */\n> > -V4L2PixelFormat V4L2VideoDevice::toV4L2PixelFormat(const PixelFormat &pixelFormat)\n> > -{\n> > -     return V4L2PixelFormat::fromPixelFormat(pixelFormat,\n> > -                                             caps_.isMultiplanar());\n> > -}\n> > -\n> >  /**\n> >   * \\class V4L2M2MDevice\n> >   * \\brief Memory-to-Memory video device\n> > diff --git a/test/libtest/buffer_source.cpp b/test/libtest/buffer_source.cpp\n> > index 73563f2fc39d..64e7376ad575 100644\n> > --- a/test/libtest/buffer_source.cpp\n> > +++ b/test/libtest/buffer_source.cpp\n> > @@ -70,8 +70,7 @@ int BufferSource::allocate(const StreamConfiguration &config)\n> >       }\n> >\n> >       format.size = config.size;\n> > -     format.fourcc = V4L2PixelFormat::fromPixelFormat(config.pixelFormat,\n> > -                                                      false);\n> > +     format.fourcc = V4L2PixelFormat::fromPixelFormat(config.pixelFormat);\n> >       if (video->setFormat(&format)) {\n> >               std::cout << \"Failed to set format on output device\" << std::endl;\n> >               return TestFail;\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 3AD02BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Sep 2021 12:32:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A00306916A;\n\tMon,  6 Sep 2021 14:32:16 +0200 (CEST)","from mail-ej1-x632.google.com (mail-ej1-x632.google.com\n\t[IPv6:2a00:1450:4864:20::632])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C067A60137\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Sep 2021 14:32:15 +0200 (CEST)","by mail-ej1-x632.google.com with SMTP id x11so13301246ejv.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 06 Sep 2021 05:32:15 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"QgvKwlq2\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=GeX3xYMrOu9iMiHdS7hoU8EfA/xfZdMtEAIoVv9fKjw=;\n\tb=QgvKwlq2H0nZqgiwFk0jU/7x29HhoDTTy38EQyLEByg2ylzw1SPVUsRcvPcLwsB7oZ\n\tRTG0sVh7WJo9i1b/1Oeq9QsaLACSjeqjNYB+Q/s3gQo8CH76AD4CPtPBMJNAEu27Sz+C\n\tkvyO2f0VAEeDUmb19ezBuxS5t6ZHNicehmd9A=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=GeX3xYMrOu9iMiHdS7hoU8EfA/xfZdMtEAIoVv9fKjw=;\n\tb=J8SfaiItlmfj9kZ/NAXl2qYz8Hrh3CCKJ8XVv2aC2OcRqY0ncU+pqi9D8YInT5p7ZV\n\t2fPDP/JVfNHsbQ1zDmGpyeq5DpefZzPICWKfbDuPtxRFcNbCo9Zqu1kVglpVpCUvziOr\n\toJAmNaThtmsTfyadPs5t9MEQG7qq3a3hMdH7K7Iowx3dJpcYQ2bo56XdRffYYxGwMTMi\n\tA9v2fUVnCZXAWG07nUki4ERlXRfOylAepvmbn+9ZZbtg8m0+Ja9MwmkNX0VTjf7rYBPl\n\tnmwTnZedRUUhu7Ynp0o3IVGYIpvxVt+RmhaA49QPFX4B2dL9vDyTgm8xS53GckiZvAjD\n\t+Fow==","X-Gm-Message-State":"AOAM532dKk+N2MAS2qNJI2moScMQyu/JUdWCeQv9eD0rliCxRn/qz7hg\n\tUYJt1Oyg3ywFlSpDLHs0a3lutF3I/Qx7pzgWQCXDahAiA78=","X-Google-Smtp-Source":"ABdhPJwAWRra2bmON10NAqu0gpn6MnAcn7AIpaNSjouNgdkXQARRXujOcMsmxz+R8Qr2cAWmsQYAdkMFns1F5eOK93E=","X-Received":"by 2002:a17:906:32c9:: with SMTP id\n\tk9mr13575831ejk.218.1630931535049; \n\tMon, 06 Sep 2021 05:32:15 -0700 (PDT)","MIME-Version":"1.0","References":"<20210906020100.14430-1-laurent.pinchart@ideasonboard.com>\n\t<20210906020100.14430-4-laurent.pinchart@ideasonboard.com>\n\t<eb3d23c3-6161-6a9c-f2a8-9305b995376c@ideasonboard.com>","In-Reply-To":"<eb3d23c3-6161-6a9c-f2a8-9305b995376c@ideasonboard.com>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Mon, 6 Sep 2021 21:32:04 +0900","Message-ID":"<CAO5uPHNOE7G1AiM9EKbbfjC4QvPy-8Wc=STFPTsRnQM60N-pLQ@mail.gmail.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v2 03/27] libcamera: v4l2_videodevice:\n\tDrop toV4L2PixelFormat()","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":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]