summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libcamera/pipeline/simple/converter.cpp10
-rw-r--r--src/libcamera/pipeline/simple/converter.h2
-rw-r--r--src/libcamera/pipeline/simple/simple.cpp2
3 files changed, 6 insertions, 8 deletions
diff --git a/src/libcamera/pipeline/simple/converter.cpp b/src/libcamera/pipeline/simple/converter.cpp
index a6a8e139..87d15c78 100644
--- a/src/libcamera/pipeline/simple/converter.cpp
+++ b/src/libcamera/pipeline/simple/converter.cpp
@@ -134,7 +134,7 @@ SizeRange SimpleConverter::sizes(const Size &input)
}
int SimpleConverter::configure(PixelFormat inputFormat, const Size &inputSize,
- StreamConfiguration *cfg)
+ const StreamConfiguration &outputCfg)
{
V4L2DeviceFormat format;
int ret;
@@ -157,10 +157,10 @@ int SimpleConverter::configure(PixelFormat inputFormat, const Size &inputSize,
}
/* Set the pixel format and size on the output. */
- videoFormat = m2m_->capture()->toV4L2PixelFormat(cfg->pixelFormat);
+ videoFormat = m2m_->capture()->toV4L2PixelFormat(outputCfg.pixelFormat);
format = {};
format.fourcc = videoFormat;
- format.size = cfg->size;
+ format.size = outputCfg.size;
ret = m2m_->capture()->setFormat(&format);
if (ret < 0) {
@@ -169,14 +169,12 @@ int SimpleConverter::configure(PixelFormat inputFormat, const Size &inputSize,
return ret;
}
- if (format.fourcc != videoFormat || format.size != cfg->size) {
+ if (format.fourcc != videoFormat || format.size != outputCfg.size) {
LOG(SimplePipeline, Error)
<< "Output format not supported";
return -EINVAL;
}
- cfg->stride = format.planes[0].bpl;
-
return 0;
}
diff --git a/src/libcamera/pipeline/simple/converter.h b/src/libcamera/pipeline/simple/converter.h
index a3c4d899..06d66f8c 100644
--- a/src/libcamera/pipeline/simple/converter.h
+++ b/src/libcamera/pipeline/simple/converter.h
@@ -37,7 +37,7 @@ public:
SizeRange sizes(const Size &input);
int configure(PixelFormat inputFormat, const Size &inputSize,
- StreamConfiguration *cfg);
+ 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 ea1a2314..1f396612 100644
--- a/src/libcamera/pipeline/simple/simple.cpp
+++ b/src/libcamera/pipeline/simple/simple.cpp
@@ -604,7 +604,7 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)
if (useConverter_) {
ret = converter_->configure(pipeConfig.pixelFormat,
- pipeConfig.captureSize, &cfg);
+ pipeConfig.captureSize, cfg);
if (ret < 0) {
LOG(SimplePipeline, Error)
<< "Unable to configure converter";