A stream outlet to publish data on the network. More...
#include <stream_outlet.h>
Public Member Functions | |
| stream_outlet (const stream_info &info) | |
| ~stream_outlet () | |
| void | push_sample (const std::vector< float > &sample) |
| void | push_chunk (const std::vector< std::vector< float > > &chunk) |
| stream_info | info () const |
| bool | have_consumers () const |
A stream outlet to publish data on the network.
A stream_outlet creates a TCP server that stream_inlet instances can connect to, and periodically broadcasts its stream_info via UDP multicast so that resolve_streams() can discover it.
Data is pushed to connected inlets via push_sample() or push_chunk().
This class is API-compatible with the liblsl stream_outlet to serve as a drop-in replacement.
Definition at line 75 of file stream_outlet.h.
|
explicit |
Construct a stream_outlet for the given stream_info.
This immediately starts the TCP data server and begins UDP discovery broadcasts.
| [in] | info | The stream_info describing this outlet's stream. |
Definition at line 293 of file stream_outlet.cpp.
| stream_outlet::~stream_outlet | ( | ) |
Destructor. Stops broadcasting and closes all connections.
Definition at line 301 of file stream_outlet.cpp.
| bool stream_outlet::have_consumers | ( | ) | const |
Check whether any consumers are currently connected.
Definition at line 329 of file stream_outlet.cpp.
| stream_info stream_outlet::info | ( | ) | const |
Get the stream_info associated with this outlet (including the assigned data port).
Definition at line 322 of file stream_outlet.cpp.
| void stream_outlet::push_chunk | ( | const std::vector< std::vector< float > > & | chunk | ) |
Push a chunk of multichannel samples into the outlet.
| [in] | chunk | A vector of samples, where each sample is a vector of channel values. |
Definition at line 315 of file stream_outlet.cpp.
| void stream_outlet::push_sample | ( | const std::vector< float > & | sample | ) |
Push a single multichannel sample into the outlet.
| [in] | sample | A vector of channel values (must match the stream's channel_count). |
Definition at line 308 of file stream_outlet.cpp.