ifw-rtmstools 3.0.0
|
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 |
RtmsReceiver class.
This class is used to receive RTMS samples. It is based on the llnetio library. It is expected that the Extended Info of the Leader packet contains the following information:
<ext info> ::= <offset_x><offset_y><width><height>
All fields shall have type int32_t.
ifw::rtmstools::rtmslib_llnetio::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.
receiver_ip | Ip where the data is received (unicast or multicast address) |
interface_name | Name of the network interface where the packets are received when using multicast address. |
port | Port used for the UDP socket. |
data_type | Type of data received. |
rcv_cfg | Additional configuration data for the receiver. |
|
virtual |
|
protected |
|
protected |
int64_t ifw::rtmstools::rtmslib_llnetio::RtmsReceiver::GetLostFramesCount | ( | ) | const |
|
protected |
|
pure virtual |
User provided method to handle an RTMS Sample received.
ext_info | Extended Header Info. |
sample_payload | Image data pixels. |
Implemented in ifw::rtmstools::rtms2ddtlib_llnetio::Rtms2DdtGateway, and ifw::rtmstools::llnetio::RtmsReceiverTool.
void ifw::rtmstools::rtmslib_llnetio::RtmsReceiver::ReceiveLoop | ( | ) |
Receiver loop running until RtmsReceiver::StopReceiver() is invoked.
bool ifw::rtmstools::rtmslib_llnetio::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.
ext_info | Extended Header Info. |
sample_payload | Image data pixels. |
timeout | Timeout in seconds to apply, waiting for the next image. |
|
virtual |
Signal to RTMS receiver to stop execution.
|
static |