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:03 +0200
commit4502635b721ae5d8c36ab98a04879ae73da51ca3 (patch)
tree345f8933b716e8ad760e25dbf6827c78eec03661 /src/libcamera/pipeline/simple/converter.cpp
parent3e743ee8ebb13cadbc18175ced0462e99054d0d0 (diff)
libcamera: pipeline: simple: converter: Differentiate input and output buffers count
The number of buffers on the input and output of the converter don't necessarily need to match. Use the buffer count from the input and output configuration respectively. This removes the need to pass the buffer count to the start() function, which brings it closer to the pipeline handler API. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Phi-Bang Nguyen <pnguyen@baylibre.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Diffstat (limited to 'src/libcamera/pipeline/simple/converter.cpp')
-rw-r--r--src/libcamera/pipeline/simple/converter.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libcamera/pipeline/simple/converter.cpp b/src/libcamera/pipeline/simple/converter.cpp
index 550b2bcf..6b3249ea 100644
--- a/src/libcamera/pipeline/simple/converter.cpp
+++ b/src/libcamera/pipeline/simple/converter.cpp
@@ -195,6 +195,9 @@ int SimpleConverter::configure(const StreamConfiguration &inputCfg,
return -EINVAL;
}
+ inputBufferCount_ = inputCfg.bufferCount;
+ outputBufferCount_ = outputCfg.bufferCount;
+
return 0;
}
@@ -204,13 +207,13 @@ int SimpleConverter::exportBuffers(unsigned int count,
return m2m_->capture()->exportBuffers(count, buffers);
}
-int SimpleConverter::start(unsigned int count)
+int SimpleConverter::start()
{
- int ret = m2m_->output()->importBuffers(count);
+ int ret = m2m_->output()->importBuffers(inputBufferCount_);
if (ret < 0)
return ret;
- ret = m2m_->capture()->importBuffers(count);
+ ret = m2m_->capture()->importBuffers(outputBufferCount_);
if (ret < 0) {
stop();
return ret;