23 class StreamInterface :
public Component {
25 friend class ComponentHandler;
27 virtual void register_camera(std::shared_ptr<CameraInterface> camera) = 0;
29 virtual void start_stream(
unsigned int endpoint_idx, std::function<
void(std::string)> set_alive_callback) = 0;
31 [[nodiscard]]
virtual unsigned int get_active_camera_idx() = 0;
33 virtual void set_active_camera(
unsigned int camera_idx) = 0;
35 [[nodiscard]]
virtual unsigned int get_endpoint_idx()
const = 0;
37 [[nodiscard]]
virtual const std::vector<std::shared_ptr<const CameraInterface>>& get_cameras_const()
const = 0;
43 virtual void set_endpoint_idx(
unsigned int endpoint_idx) = 0;
44 virtual void set_active_camera_idx(
unsigned int camera_idx) = 0;
45 virtual std::shared_ptr<CameraInterface> get_active_camera() = 0;
46 virtual std::vector<std::shared_ptr<CameraInterface>>& get_cameras() = 0;
55 class Stream :
public StreamInterface {
60 explicit Stream(
const std::string& name);
68 Stream(std::string name,
unsigned int endpoint_idx, std::string uuid);
86 void start_stream(
unsigned int endpoint_idx, std::function<
void(std::string)> set_alive_callback)
override;
107 [[nodiscard]] const std::vector<std::shared_ptr<const CameraInterface>>&
get_cameras_const() const final;
110 void set_endpoint_idx(
unsigned int endpoint_idx) final;
111 std::shared_ptr<CameraInterface> get_active_camera() final;
112 unsigned int get_active_camera_idx() final;
113 void set_active_camera_idx(
unsigned int camera_idx) final;
114 std::vector<std::shared_ptr<CameraInterface>>& get_cameras() final;
116 unsigned int m_endpoint_idx;
117 unsigned int m_active_camera_idx;
118 std::vector<std::shared_ptr<CameraInterface>> m_cameras;
Component()=default
The default constructor.
The base stream class.
Definition stream.h:55
unsigned int get_endpoint_idx() const final
Get the stream endpoint index.
void register_camera(std::shared_ptr< CameraInterface > camera) final
Register a camera that can publish through this stream.
const std::vector< std::shared_ptr< const CameraInterface > > & get_cameras_const() const final
Get the stream cameras.
void start_stream(unsigned int endpoint_idx, std::function< void(std::string)> set_alive_callback) override
Register a camera that can publish through this stream.
Stream(std::string name, unsigned int endpoint_idx, std::string uuid)
Internal stream constructor.
void set_active_camera(unsigned int camera_idx) override
Set the active camera.
Stream(const std::string &name)
Creates a new named stream.