Flyby SDK v0.3.0
Loading...
Searching...
No Matches
flyby::Stream Class Reference

The base stream class. More...

#include <stream.h>

Inheritance diagram for flyby::Stream:
Collaboration diagram for flyby::Stream:

Public Member Functions

 Stream (const std::string &name)
 Creates a new named stream.
 
 Stream (std::string name, unsigned int endpoint_idx, std::string uuid)
 Internal stream constructor.
 
void register_camera (std::shared_ptr< CameraInterface > camera) final
 Register a camera that can publish through this stream.
 
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.
 
void set_active_camera (unsigned int camera_idx) override
 Set the active camera.
 
unsigned int get_endpoint_idx () const final
 Get the stream endpoint index.
 
const std::vector< std::shared_ptr< const CameraInterface > > & get_cameras_const () const final
 Get the stream cameras.
 

Detailed Description

The base stream class.

This class should be extended by overriding the start_stream method.

Constructor & Destructor Documentation

◆ Stream()

flyby::Stream::Stream ( std::string name,
unsigned int endpoint_idx,
std::string uuid )

Internal stream constructor.

Note that this constructor should not be used, since the index will be overwritten. This is only used internally.

Member Function Documentation

◆ get_cameras_const()

const std::vector< std::shared_ptr< const CameraInterface > > & flyby::Stream::get_cameras_const ( ) const
nodiscardfinal

Get the stream cameras.

Returns
A vector of const camera pointers

◆ get_endpoint_idx()

unsigned int flyby::Stream::get_endpoint_idx ( ) const
nodiscardfinal

Get the stream endpoint index.

Returns
The endpoint index

◆ set_active_camera()

void flyby::Stream::set_active_camera ( unsigned int camera_idx)
override

Set the active camera.

This function should be overridden to handle camera switching

◆ start_stream()

void flyby::Stream::start_stream ( unsigned int endpoint_idx,
std::function< void(std::string)> set_alive_callback )
override

Register a camera that can publish through this stream.

This function should be overridden to create and publish a stream to the corresponding stream endpoint of the drone RTSP server.

This function should call the set_alive_callback when the stream is active and publishing.


The documentation for this class was generated from the following file: