ifw-rtmslib 1.0.0
 
Loading...
Searching...
No Matches
RtmsReceiver Class Referenceabstract

RtmsReceiver class. More...

#include <rtmsReceiver.hpp>

Public Member Functions

 RtmsReceiver (const std::string &receiver_ip, const std::string &interface_name, const int port, const ifw::fnd::datatype::DataType data_type, const ReceiverConfig &rcv_cfg=ReceiverConfig())
 RTMS Receiver class.
 
virtual ~RtmsReceiver ()
 
void ReceiveLoop ()
 Receiver loop running until RtmsReceiver::StopReceiver() is invoked.
 
virtual void StopReceiver ()
 Signal to RTMS receiver to stop execution.
 
bool ReceiveSample (SampleExtInfo &ext_info, std::vector< uint8_t > &sample_payload, std::chrono::nanoseconds timeout)
 Receives one sample. Returns true if a sample received within the timeout.
 
virtual void HandleSampleUser (SampleExtInfo &ext_info, std::vector< uint8_t > &sample_payload)=0
 User provided method to handle an RTMS Sample received.
 
int64_t GetLostFramesCount () const
 

Static Public Attributes

static std::atomic< bool > s_execute = true
 

Protected Member Functions

int64_t GetSampleId () const
 
ifw::fnd::datatype::DataType GetDataType () const
 
ReceiverConfig GetConfig () const
 
void RequestStop ()
 

Detailed Description

RtmsReceiver class.

This class is used to receive RTMS samples. It is based on the llnetio library. The extended leader header is decoded with SampleExtInfo (timestamp, datatype, width, height, offset-x, offset-y). Only valid packed sizes (0, 8, or the full SampleExtInfo block) are accepted.

Constructor & Destructor Documentation

◆ RtmsReceiver()

ifw::rtmslib::RtmsReceiver::RtmsReceiver ( const std::string & receiver_ip,
const std::string & interface_name,
const int port,
const ifw::fnd::datatype::DataType data_type,
const ReceiverConfig & rcv_cfg = ReceiverConfig() )

RTMS Receiver class.

Parameters
receiver_ipIp where the data is received (unicast or multicast address)
interface_nameName of the network interface where the packets are received when using multicast address.
portPort used for the UDP socket.
data_typeType of data received.
rcv_cfgAdditional configuration data for the receiver.

◆ ~RtmsReceiver()

ifw::rtmslib::RtmsReceiver::~RtmsReceiver ( )
virtual

Member Function Documentation

◆ GetConfig()

ReceiverConfig ifw::rtmslib::RtmsReceiver::GetConfig ( ) const
protected

◆ GetDataType()

ifw::fnd::datatype::DataType ifw::rtmslib::RtmsReceiver::GetDataType ( ) const
protected

◆ GetLostFramesCount()

int64_t ifw::rtmslib::RtmsReceiver::GetLostFramesCount ( ) const

◆ GetSampleId()

int64_t ifw::rtmslib::RtmsReceiver::GetSampleId ( ) const
protected

◆ HandleSampleUser()

virtual void ifw::rtmslib::RtmsReceiver::HandleSampleUser ( SampleExtInfo & ext_info,
std::vector< uint8_t > & sample_payload )
pure virtual

User provided method to handle an RTMS Sample received.

Parameters
ext_infoExtended Header Info.
sample_payloadImage data pixels.

◆ ReceiveLoop()

void ifw::rtmslib::RtmsReceiver::ReceiveLoop ( )

Receiver loop running until RtmsReceiver::StopReceiver() is invoked.

◆ ReceiveSample()

bool ifw::rtmslib::RtmsReceiver::ReceiveSample ( SampleExtInfo & ext_info,
std::vector< uint8_t > & sample_payload,
std::chrono::nanoseconds timeout )

Receives one sample. Returns true if a sample received within the timeout.

Parameters
ext_infoExtended Header Info decoded via SampleExtInfo::Unpack().
sample_payloadImage data pixels.
timeoutTimeout in seconds to apply, waiting for the next image.
Returns
Returns true if a sample was received.

◆ RequestStop()

void ifw::rtmslib::RtmsReceiver::RequestStop ( )
protected

◆ StopReceiver()

void ifw::rtmslib::RtmsReceiver::StopReceiver ( )
virtual

Signal to RTMS receiver to stop execution.

Member Data Documentation

◆ s_execute

std::atomic< bool > ifw::rtmslib::RtmsReceiver::s_execute = true
static

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