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>
This commit is contained in:
parent
a7f24a8d9a
commit
6015d9702e
7 changed files with 16 additions and 15 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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_);
|
||||
|
|
|
@ -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;
|
||||
|
||||
/*
|
||||
|
|
|
@ -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. */
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue