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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user