summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/vimc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcamera/pipeline/vimc.cpp')
-rw-r--r--src/libcamera/pipeline/vimc.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp
index 17e2491e..af6b6f21 100644
--- a/src/libcamera/pipeline/vimc.cpp
+++ b/src/libcamera/pipeline/vimc.cpp
@@ -27,8 +27,7 @@ public:
CameraConfiguration
generateConfiguration(Camera *camera, const StreamRoles &roles) override;
- int configure(Camera *camera,
- const CameraConfiguration &config) override;
+ int configure(Camera *camera, CameraConfiguration &config) override;
int allocateBuffers(Camera *camera,
const std::set<Stream *> &streams) override;
@@ -78,38 +77,38 @@ CameraConfiguration
PipelineHandlerVimc::generateConfiguration(Camera *camera,
const StreamRoles &roles)
{
- VimcCameraData *data = cameraData(camera);
CameraConfiguration config;
- StreamConfiguration cfg{};
+ StreamConfiguration cfg;
cfg.pixelFormat = V4L2_PIX_FMT_RGB24;
cfg.size = { 640, 480 };
cfg.bufferCount = 4;
- config[&data->stream_] = cfg;
+ config.addConfiguration(cfg);
return config;
}
-int PipelineHandlerVimc::configure(Camera *camera,
- const CameraConfiguration &config)
+int PipelineHandlerVimc::configure(Camera *camera, CameraConfiguration &config)
{
VimcCameraData *data = cameraData(camera);
- const StreamConfiguration *cfg = &config[&data->stream_];
+ StreamConfiguration &cfg = config[0];
int ret;
V4L2DeviceFormat format = {};
- format.fourcc = cfg->pixelFormat;
- format.size = cfg->size;
+ format.fourcc = cfg.pixelFormat;
+ format.size = cfg.size;
ret = data->video_->setFormat(&format);
if (ret)
return ret;
- if (format.size != cfg->size ||
- format.fourcc != cfg->pixelFormat)
+ if (format.size != cfg.size ||
+ format.fourcc != cfg.pixelFormat)
return -EINVAL;
+ cfg.setStream(&data->stream_);
+
return 0;
}