summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/pipeline/vimc.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp
index a93a7589..812777cf 100644
--- a/src/libcamera/pipeline/vimc.cpp
+++ b/src/libcamera/pipeline/vimc.cpp
@@ -83,6 +83,7 @@ int PipelineHandlerVimc::configureStreams(Camera *camera,
std::map<Stream *, StreamConfiguration> &config)
{
StreamConfiguration *cfg = &config[&stream_];
+ int ret;
LOG(VIMC, Debug) << "Configure the camera for resolution "
<< cfg->width << "x" << cfg->height;
@@ -92,7 +93,16 @@ int PipelineHandlerVimc::configureStreams(Camera *camera,
format.height = cfg->height;
format.fourcc = cfg->pixelFormat;
- return video_->setFormat(&format);
+ ret = video_->setFormat(&format);
+ if (ret)
+ return ret;
+
+ if (format.width != cfg->width ||
+ format.height != cfg->height ||
+ format.fourcc != cfg->pixelFormat)
+ return -EINVAL;
+
+ return 0;
}
int PipelineHandlerVimc::allocateBuffers(Camera *camera, Stream *stream)