libcamera: Use the Size class through libcamera
Several of our structures include width and height fields that model a size while we have a Size class for that purpose. Use the Size class through libcamera, and give it a toString() method like other geometry and format classes. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
@@ -92,9 +92,8 @@ PipelineHandlerVimc::streamConfiguration(Camera *camera,
|
||||
CameraConfiguration configs;
|
||||
StreamConfiguration config{};
|
||||
|
||||
config.width = 640;
|
||||
config.height = 480;
|
||||
config.pixelFormat = V4L2_PIX_FMT_RGB24;
|
||||
config.size = { 640, 480 };
|
||||
config.bufferCount = 4;
|
||||
|
||||
configs[&data->stream_] = config;
|
||||
@@ -110,16 +109,14 @@ int PipelineHandlerVimc::configureStreams(Camera *camera,
|
||||
int ret;
|
||||
|
||||
V4L2DeviceFormat format = {};
|
||||
format.width = cfg->width;
|
||||
format.height = cfg->height;
|
||||
format.fourcc = cfg->pixelFormat;
|
||||
format.size = cfg->size;
|
||||
|
||||
ret = data->video_->setFormat(&format);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (format.width != cfg->width ||
|
||||
format.height != cfg->height ||
|
||||
if (format.size != cfg->size ||
|
||||
format.fourcc != cfg->pixelFormat)
|
||||
return -EINVAL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user