diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-03-17 01:17:29 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-03-19 17:14:21 +0200 |
commit | 6015d9702e2920644347d5f497c230f3a7133105 (patch) | |
tree | 3a197dfbf8315c2312ff053fd10feeea68fdefcb | |
parent | a7f24a8d9ab5512abb04b12c1feb6972633961e5 (diff) |
libcamera: v4l2_videodevice: Rename toV4L2Fourcc to toV4L2PixelFormat
Now that the functions return a V4L2PixelFormat, adapt their name
accordingly.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r-- | src/libcamera/include/v4l2_videodevice.h | 6 | ||||
-rw-r--r-- | src/libcamera/pipeline/ipu3/ipu3.cpp | 2 | ||||
-rw-r--r-- | src/libcamera/pipeline/rkisp1/rkisp1.cpp | 4 | ||||
-rw-r--r-- | src/libcamera/pipeline/uvcvideo.cpp | 4 | ||||
-rw-r--r-- | src/libcamera/pipeline/vimc.cpp | 4 | ||||
-rw-r--r-- | src/libcamera/v4l2_videodevice.cpp | 8 | ||||
-rw-r--r-- | 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 2a380c0e..5e40c0c5 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 55ce8fa1..e9085f2f 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 737e3314..07d837ab 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 67750fbc..15c8baef 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 cbf33061..1097eea2 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 1c60014c..496bc56b 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 26d2764d..dae3cb9f 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; |