diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-04-30 21:16:28 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-04-30 22:18:42 +0300 |
commit | a2dddf7c26df3307b9d4554c25387a00687a6234 (patch) | |
tree | be4004bb072d39d471ee790069e3f74d1cd5bbe0 /src/libcamera/pipeline/uvcvideo.cpp | |
parent | baad55d00975f8931d51c333def20472457dc943 (diff) |
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>
Diffstat (limited to 'src/libcamera/pipeline/uvcvideo.cpp')
-rw-r--r-- | src/libcamera/pipeline/uvcvideo.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp index fd1d6df1..358e247b 100644 --- a/src/libcamera/pipeline/uvcvideo.cpp +++ b/src/libcamera/pipeline/uvcvideo.cpp @@ -92,9 +92,8 @@ PipelineHandlerUVC::streamConfiguration(Camera *camera, CameraConfiguration configs; StreamConfiguration config{}; - config.width = 640; - config.height = 480; config.pixelFormat = V4L2_PIX_FMT_YUYV; + config.size = { 640, 480 }; config.bufferCount = 4; configs[&data->stream_] = config; @@ -110,16 +109,14 @@ int PipelineHandlerUVC::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; |