mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-21 03:15:06 +03:00
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>
This commit is contained in:
parent
31bb25ae8d
commit
98edf29e01
2 changed files with 15 additions and 1 deletions
|
@ -55,6 +55,7 @@ private:
|
|||
std::shared_ptr<PipelineHandler> pipe_;
|
||||
std::string name_;
|
||||
std::vector<Stream *> streams_;
|
||||
std::vector<Stream *> activeStreams_;
|
||||
|
||||
bool acquired_;
|
||||
bool disconnected_;
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue