summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/simple/converter.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-12-26 23:45:04 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-03-03 00:59:02 +0200
commit3e743ee8ebb13cadbc18175ced0462e99054d0d0 (patch)
tree6172ca90c536fb457a36803d29fd12aeafd467ad /src/libcamera/pipeline/simple/converter.cpp
parentad12f09a6237818cea9f2ff765ccaf8eb993d147 (diff)
libcamera: pipeline: simple: converter: Configure input stride
Use the stride of the video capture device to configure the converter input. This ensures that no stride mismatch occurs inadvertently along the pipeline. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Phi-Bang Nguyen <pnguyen@baylibre.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/libcamera/pipeline/simple/converter.cpp')
-rw-r--r--src/libcamera/pipeline/simple/converter.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libcamera/pipeline/simple/converter.cpp b/src/libcamera/pipeline/simple/converter.cpp
index 6f4e41db..550b2bcf 100644
--- a/src/libcamera/pipeline/simple/converter.cpp
+++ b/src/libcamera/pipeline/simple/converter.cpp
@@ -159,6 +159,8 @@ int SimpleConverter::configure(const StreamConfiguration &inputCfg,
V4L2DeviceFormat format;
format.fourcc = videoFormat;
format.size = inputCfg.size;
+ format.planesCount = 1;
+ format.planes[0].bpl = inputCfg.stride;
ret = m2m_->output()->setFormat(&format);
if (ret < 0) {
@@ -167,7 +169,8 @@ int SimpleConverter::configure(const StreamConfiguration &inputCfg,
return ret;
}
- if (format.fourcc != videoFormat || format.size != inputCfg.size) {
+ if (format.fourcc != videoFormat || format.size != inputCfg.size ||
+ format.planes[0].bpl != inputCfg.stride) {
LOG(SimplePipeline, Error)
<< "Input format not supported";
return -EINVAL;