libcamera: store stream pointers in sets instead of a vectors

The arrays that store Stream pointers shall always contain unique
values. Storing them in vectors opens up for the same stream pointer
appearing twice. Remove this possibility by storing them in a set which
guarantees each element is unique.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Niklas Söderlund
2019-02-26 02:46:33 +01:00
parent dc01a5bc43
commit 132ce9c1cf
7 changed files with 25 additions and 24 deletions

View File

@@ -27,7 +27,7 @@ public:
std::map<Stream *, StreamConfiguration>
streamConfiguration(Camera *camera,
std::vector<Stream *> &streams) override;
std::set<Stream *> &streams) override;
int configureStreams(Camera *camera,
std::map<Stream *, StreamConfiguration> &config) override;
@@ -62,7 +62,7 @@ PipelineHandlerVimc::~PipelineHandlerVimc()
std::map<Stream *, StreamConfiguration>
PipelineHandlerVimc::streamConfiguration(Camera *camera,
std::vector<Stream *> &streams)
std::set<Stream *> &streams)
{
std::map<Stream *, StreamConfiguration> configs;
@@ -171,7 +171,7 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)
return false;
}
std::vector<Stream *> streams{ &stream_ };
std::set<Stream *> streams{ &stream_ };
std::shared_ptr<Camera> camera = Camera::create(this, "VIMC Sensor B",
streams);
registerCamera(std::move(camera));