diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/pipeline/simple/converter.cpp | 12 | ||||
-rw-r--r-- | src/libcamera/pipeline/simple/converter.h | 2 | ||||
-rw-r--r-- | src/libcamera/pipeline/simple/simple.cpp | 7 |
3 files changed, 13 insertions, 8 deletions
diff --git a/src/libcamera/pipeline/simple/converter.cpp b/src/libcamera/pipeline/simple/converter.cpp index 8f54caac..6f4e41db 100644 --- a/src/libcamera/pipeline/simple/converter.cpp +++ b/src/libcamera/pipeline/simple/converter.cpp @@ -148,15 +148,17 @@ SimpleConverter::strideAndFrameSize(const PixelFormat &pixelFormat, return std::make_tuple(format.planes[0].bpl, format.planes[0].size); } -int SimpleConverter::configure(PixelFormat inputFormat, const Size &inputSize, +int SimpleConverter::configure(const StreamConfiguration &inputCfg, const StreamConfiguration &outputCfg) { - V4L2DeviceFormat format; int ret; - V4L2PixelFormat videoFormat = m2m_->output()->toV4L2PixelFormat(inputFormat); + V4L2PixelFormat videoFormat = + m2m_->output()->toV4L2PixelFormat(inputCfg.pixelFormat); + + V4L2DeviceFormat format; format.fourcc = videoFormat; - format.size = inputSize; + format.size = inputCfg.size; ret = m2m_->output()->setFormat(&format); if (ret < 0) { @@ -165,7 +167,7 @@ int SimpleConverter::configure(PixelFormat inputFormat, const Size &inputSize, return ret; } - if (format.fourcc != videoFormat || format.size != inputSize) { + if (format.fourcc != videoFormat || format.size != inputCfg.size) { LOG(SimplePipeline, Error) << "Input format not supported"; return -EINVAL; diff --git a/src/libcamera/pipeline/simple/converter.h b/src/libcamera/pipeline/simple/converter.h index dce3143c..8d2afe36 100644 --- a/src/libcamera/pipeline/simple/converter.h +++ b/src/libcamera/pipeline/simple/converter.h @@ -39,7 +39,7 @@ public: std::tuple<unsigned int, unsigned int> strideAndFrameSize(const PixelFormat &pixelFormat, const Size &size); - int configure(PixelFormat inputFormat, const Size &inputSize, + int configure(const StreamConfiguration &inputCfg, const StreamConfiguration &outputCfg); int exportBuffers(unsigned int count, std::vector<std::unique_ptr<FrameBuffer>> *buffers); diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index 4afc5aa7..cb8309ca 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -603,8 +603,11 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c) useConverter_ = config->needConversion(); if (useConverter_) { - ret = converter_->configure(pipeConfig.pixelFormat, - pipeConfig.captureSize, cfg); + StreamConfiguration inputCfg; + inputCfg.pixelFormat = pipeConfig.pixelFormat; + inputCfg.size = pipeConfig.captureSize; + + ret = converter_->configure(inputCfg, cfg); if (ret < 0) { LOG(SimplePipeline, Error) << "Unable to configure converter"; |