From 98edf29e012cce6a3c0a428e3d78490780c1a824 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Tue, 5 Feb 2019 12:47:59 +0100 Subject: libcamera: camera: Cache the stream configuration in the stream object MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The API towards the application and pipeline handler can be simplified if the camera caches which streams have been selected and their respective configuration. Signed-off-by: Niklas Söderlund Signed-off-by: Jacopo Mondi Signed-off-by: Kieran Bingham Signed-off-by: Laurent Pinchart --- src/libcamera/camera.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp index 62291d2c..3f7b805b 100644 --- a/src/libcamera/camera.cpp +++ b/src/libcamera/camera.cpp @@ -253,7 +253,20 @@ int Camera::configureStreams(std::map &config) return -EINVAL; } - return pipe_->configureStreams(this, config); + ret = pipe_->configureStreams(this, config); + if (ret) + return ret; + + activeStreams_.clear(); + for (auto const &iter : config) { + Stream *stream = iter.first; + const StreamConfiguration &cfg = iter.second; + + stream->configuration_ = cfg; + activeStreams_.push_back(stream); + } + + return 0; } int Camera::exclusiveAccess() -- cgit v1.2.1