v2.0.0
Loading...
Searching...
No Matches
LSLLIB::stream_outlet Class Reference

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ stream_outlet()

stream_outlet::stream_outlet ( const stream_info & info)
explicit

Construct a stream_outlet for the given stream_info.

This immediately starts the TCP data server and begins UDP discovery broadcasts.

Parameters
[in]infoThe stream_info describing this outlet's stream.

Definition at line 293 of file stream_outlet.cpp.

◆ ~stream_outlet()

stream_outlet::~stream_outlet ( )

Destructor. Stops broadcasting and closes all connections.

Definition at line 301 of file stream_outlet.cpp.

Member Function Documentation

◆ have_consumers()

bool stream_outlet::have_consumers ( ) const

Check whether any consumers are currently connected.

Returns
True if at least one inlet is connected.

Definition at line 329 of file stream_outlet.cpp.

◆ info()

stream_info stream_outlet::info ( ) const

Get the stream_info associated with this outlet (including the assigned data port).

Returns
The stream_info for this outlet.

Definition at line 322 of file stream_outlet.cpp.

◆ push_chunk()

void stream_outlet::push_chunk ( const std::vector< std::vector< float > > & chunk)

Push a chunk of multichannel samples into the outlet.

Parameters
[in]chunkA vector of samples, where each sample is a vector of channel values.

Definition at line 315 of file stream_outlet.cpp.

◆ push_sample()

void stream_outlet::push_sample ( const std::vector< float > & sample)

Push a single multichannel sample into the outlet.

Parameters
[in]sampleA vector of channel values (must match the stream's channel_count).

Definition at line 308 of file stream_outlet.cpp.


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