[libcamera-devel] [PATCH v3 2/3] libcamera: v4l2_videodevice: Rename toV4L2Fourcc to toV4L2PixelFormat
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Thu Mar 19 14:29:18 CET 2020
Now that the functions return a V4L2PixelFormat, adapt their name
accordingly.
Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
src/libcamera/include/v4l2_videodevice.h | 6 +++---
src/libcamera/pipeline/ipu3/ipu3.cpp | 2 +-
src/libcamera/pipeline/rkisp1/rkisp1.cpp | 4 ++--
src/libcamera/pipeline/uvcvideo.cpp | 4 ++--
src/libcamera/pipeline/vimc.cpp | 4 ++--
src/libcamera/v4l2_videodevice.cpp | 8 ++++----
test/libtest/buffer_source.cpp | 3 ++-
7 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/src/libcamera/include/v4l2_videodevice.h b/src/libcamera/include/v4l2_videodevice.h
index 2a380c0e61cd..5e40c0c57df9 100644
--- a/src/libcamera/include/v4l2_videodevice.h
+++ b/src/libcamera/include/v4l2_videodevice.h
@@ -229,9 +229,9 @@ public:
const std::string &entity);
static PixelFormat toPixelFormat(V4L2PixelFormat v4l2Fourcc);
- V4L2PixelFormat toV4L2Fourcc(const PixelFormat &pixelFormat);
- static V4L2PixelFormat toV4L2Fourcc(const PixelFormat &pixelFormat,
- bool multiplanar);
+ V4L2PixelFormat toV4L2PixelFormat(const PixelFormat &pixelFormat);
+ static V4L2PixelFormat toV4L2PixelFormat(const PixelFormat &pixelFormat,
+ bool multiplanar);
protected:
std::string logPrefix() const;
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index 55ce8fa16af1..e9085f2f0c7e 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -1078,7 +1078,7 @@ int ImgUDevice::configureOutput(ImgUOutput *output,
return 0;
V4L2DeviceFormat outputFormat = {};
- outputFormat.fourcc = dev->toV4L2Fourcc(PixelFormat(DRM_FORMAT_NV12));
+ outputFormat.fourcc = dev->toV4L2PixelFormat(PixelFormat(DRM_FORMAT_NV12));
outputFormat.size = cfg.size;
outputFormat.planesCount = 2;
diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index 737e331459f3..07d837abe1ac 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -626,7 +626,7 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)
LOG(RkISP1, Debug) << "Resizer output pad configured with " << format.toString();
V4L2DeviceFormat outputFormat = {};
- outputFormat.fourcc = video_->toV4L2Fourcc(cfg.pixelFormat);
+ outputFormat.fourcc = video_->toV4L2PixelFormat(cfg.pixelFormat);
outputFormat.size = cfg.size;
outputFormat.planesCount = 2;
@@ -635,7 +635,7 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)
return ret;
if (outputFormat.size != cfg.size ||
- outputFormat.fourcc != video_->toV4L2Fourcc(cfg.pixelFormat)) {
+ outputFormat.fourcc != video_->toV4L2PixelFormat(cfg.pixelFormat)) {
LOG(RkISP1, Error)
<< "Unable to configure capture in " << cfg.toString();
return -EINVAL;
diff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp
index 67750fbc7c0c..15c8baef1a24 100644
--- a/src/libcamera/pipeline/uvcvideo.cpp
+++ b/src/libcamera/pipeline/uvcvideo.cpp
@@ -187,7 +187,7 @@ int PipelineHandlerUVC::configure(Camera *camera, CameraConfiguration *config)
int ret;
V4L2DeviceFormat format = {};
- format.fourcc = data->video_->toV4L2Fourcc(cfg.pixelFormat);
+ format.fourcc = data->video_->toV4L2PixelFormat(cfg.pixelFormat);
format.size = cfg.size;
ret = data->video_->setFormat(&format);
@@ -195,7 +195,7 @@ int PipelineHandlerUVC::configure(Camera *camera, CameraConfiguration *config)
return ret;
if (format.size != cfg.size ||
- format.fourcc != data->video_->toV4L2Fourcc(cfg.pixelFormat))
+ format.fourcc != data->video_->toV4L2PixelFormat(cfg.pixelFormat))
return -EINVAL;
cfg.setStream(&data->stream_);
diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp
index cbf330614bd6..1097eea243a1 100644
--- a/src/libcamera/pipeline/vimc.cpp
+++ b/src/libcamera/pipeline/vimc.cpp
@@ -229,7 +229,7 @@ int PipelineHandlerVimc::configure(Camera *camera, CameraConfiguration *config)
return ret;
V4L2DeviceFormat format = {};
- format.fourcc = data->video_->toV4L2Fourcc(cfg.pixelFormat);
+ format.fourcc = data->video_->toV4L2PixelFormat(cfg.pixelFormat);
format.size = cfg.size;
ret = data->video_->setFormat(&format);
@@ -237,7 +237,7 @@ int PipelineHandlerVimc::configure(Camera *camera, CameraConfiguration *config)
return ret;
if (format.size != cfg.size ||
- format.fourcc != data->video_->toV4L2Fourcc(cfg.pixelFormat))
+ format.fourcc != data->video_->toV4L2PixelFormat(cfg.pixelFormat))
return -EINVAL;
/*
diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index 1c60014caa6f..496bc56b6f89 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -1689,9 +1689,9 @@ PixelFormat V4L2VideoDevice::toPixelFormat(V4L2PixelFormat v4l2Fourcc)
*
* \return The V4L2_PIX_FMT_* pixel format code corresponding to \a pixelFormat
*/
-V4L2PixelFormat V4L2VideoDevice::toV4L2Fourcc(const PixelFormat &pixelFormat)
+V4L2PixelFormat V4L2VideoDevice::toV4L2PixelFormat(const PixelFormat &pixelFormat)
{
- return V4L2VideoDevice::toV4L2Fourcc(pixelFormat, caps_.isMultiplanar());
+ return toV4L2PixelFormat(pixelFormat, caps_.isMultiplanar());
}
/**
@@ -1707,8 +1707,8 @@ V4L2PixelFormat V4L2VideoDevice::toV4L2Fourcc(const PixelFormat &pixelFormat)
*
* \return The V4L2_PIX_FMT_* pixel format code corresponding to \a pixelFormat
*/
-V4L2PixelFormat V4L2VideoDevice::toV4L2Fourcc(const PixelFormat &pixelFormat,
- bool multiplanar)
+V4L2PixelFormat V4L2VideoDevice::toV4L2PixelFormat(const PixelFormat &pixelFormat,
+ bool multiplanar)
{
switch (pixelFormat) {
/* RGB formats. */
diff --git a/test/libtest/buffer_source.cpp b/test/libtest/buffer_source.cpp
index 26d2764d5f8f..dae3cb9f7a6c 100644
--- a/test/libtest/buffer_source.cpp
+++ b/test/libtest/buffer_source.cpp
@@ -70,7 +70,8 @@ int BufferSource::allocate(const StreamConfiguration &config)
}
format.size = config.size;
- format.fourcc = V4L2VideoDevice::toV4L2Fourcc(config.pixelFormat, false);
+ format.fourcc = V4L2VideoDevice::toV4L2PixelFormat(config.pixelFormat,
+ false);
if (video->setFormat(&format)) {
std::cout << "Failed to set format on output device" << std::endl;
return TestFail;
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list