From 132ce9c1cf6951d8cba8ff6ff5fbccadead385c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Tue, 26 Feb 2019 02:46:33 +0100 Subject: libcamera: store stream pointers in sets instead of a vectors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- include/libcamera/camera.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'include/libcamera/camera.h') diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h index bf70255a..9c8ae01e 100644 --- a/include/libcamera/camera.h +++ b/include/libcamera/camera.h @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -27,7 +28,7 @@ class Camera final public: static std::shared_ptr create(PipelineHandler *pipe, const std::string &name, - const std::vector &streams); + const std::set &streams); Camera(const Camera &) = delete; Camera &operator=(const Camera &) = delete; @@ -40,9 +41,9 @@ public: int acquire(); void release(); - const std::vector &streams() const; + const std::set &streams() const; std::map - streamConfiguration(std::vector &streams); + streamConfiguration(std::set &streams); int configureStreams(std::map &config); int allocateBuffers(); @@ -64,8 +65,8 @@ private: std::shared_ptr pipe_; std::string name_; - std::vector streams_; - std::vector activeStreams_; + std::set streams_; + std::set activeStreams_; bool acquired_; bool disconnected_; -- cgit v1.2.1