diff options
author | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2019-02-05 12:47:59 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-02-06 07:41:51 +0200 |
commit | 98edf29e012cce6a3c0a428e3d78490780c1a824 (patch) | |
tree | 9e6f850bde8b19cfd3611076e983fe6d9968525d /src | |
parent | 31bb25ae8d6dc669dddabf47d18c517ce9070578 (diff) |
libcamera: camera: Cache the stream configuration in the stream object
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 <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/camera.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
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<Stream *, StreamConfiguration> &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() |