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:
Niklas Söderlund 2019-02-05 12:47:59 +01:00 committed by Laurent Pinchart
parent 31bb25ae8d
commit 98edf29e01
2 changed files with 15 additions and 1 deletions

View file

@ -55,6 +55,7 @@ private:
std::shared_ptr<PipelineHandler> pipe_; std::shared_ptr<PipelineHandler> pipe_;
std::string name_; std::string name_;
std::vector<Stream *> streams_; std::vector<Stream *> streams_;
std::vector<Stream *> activeStreams_;
bool acquired_; bool acquired_;
bool disconnected_; bool disconnected_;

View file

@ -253,7 +253,20 @@ int Camera::configureStreams(std::map<Stream *, StreamConfiguration> &config)
return -EINVAL; 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() int Camera::exclusiveAccess()