TSDuck v3.38-3696
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::EMMGClient Class Reference

A DVB-EMMG client which connects to any MUX to inject data. More...

#include <tsEMMGClient.h>

Inheritance diagram for ts::EMMGClient:
Collaboration diagram for ts::EMMGClient:

Public Member Functions

 EMMGClient (const DuckContext &duck, const emmgmux::Protocol &protocol)
 Constructor.
 
virtual ~EMMGClient () override
 Destructor.
 
uint16_t allocatedBandwidth ()
 Get the last allocated bandwidth as returned by the MUX.
 
bool connect (const IPv4SocketAddress &mux, const IPv4SocketAddress &udp, uint32_t client_id, uint16_t data_channel_id, uint16_t data_stream_id, uint16_t data_id, uint8_t data_type, bool section_format, emmgmux::ChannelStatus &channel_status, emmgmux::StreamStatus &stream_status, const AbortInterface *abort, const tlv::Logger &logger)
 Connect to a remote MUX.
 
bool dataProvision (const ByteBlockPtr &data)
 Send data provision.
 
bool dataProvision (const SectionPtrVector &sections)
 Send data provision in section format.
 
bool dataProvision (const std::vector< ByteBlockPtr > &data)
 Send data provision.
 
bool dataProvision (const void *data, size_t size)
 Send data provision.
 
bool disconnect ()
 Disconnect from remote MUX.
 
void getLastErrorResponse (std::vector< uint16_t > &error_status, std::vector< uint16_t > &error_information)
 Get the last error response.
 
bool isConnected () const
 Check if the EMMG is connected.
 
bool requestBandwidth (uint16_t bandwidth, bool synchronous=false)
 Send a bandwidth request.
 
void resetTotalBytes ()
 Reset the total number of data bytes which were sent so far.
 
uint64_t totalBytes () const
 Get the total number of data bytes which were sent so far.
 

Detailed Description

A DVB-EMMG client which connects to any MUX to inject data.

Restriction: Only the TCP version of the EMMG/PDG <=> MUX protocol is supported here. The UDP version is currently unsupported.

See also
DVB standard ETSI TS 103.197 V1.4.1 for EMMG/PDG <=> MUX protocol.

Constructor & Destructor Documentation

◆ EMMGClient()

ts::EMMGClient::EMMGClient ( const DuckContext duck,
const emmgmux::Protocol protocol 
)

Constructor.

Parameters
[in]duckTSDuck execution context. The reference is kept inside the packetizer.
[in]protocolInstance of EMMG/PDG <=> SCS protocol to use. A reference to the protocol instance is kept inside the object.

Member Function Documentation

◆ connect()

bool ts::EMMGClient::connect ( const IPv4SocketAddress mux,
const IPv4SocketAddress udp,
uint32_t  client_id,
uint16_t  data_channel_id,
uint16_t  data_stream_id,
uint16_t  data_id,
uint8_t  data_type,
bool  section_format,
emmgmux::ChannelStatus channel_status,
emmgmux::StreamStatus stream_status,
const AbortInterface abort,
const tlv::Logger logger 
)

Connect to a remote MUX.

Perform all initial channel and stream negotiation.

Parameters
[in]muxIP address and TCP port of the MUX.
[in]udpIf port is specified, then send data_rovision messages using UDP instead of TCP. If the IP address is not specified, use the same one as mux.
[in]client_idClient id, see EMMG/PDG <=> MUX protocol.
[in]data_channel_idData_channel_id, see EMMG/PDG <=> MUX protocol.
[in]data_stream_idData_stream_id, see EMMG/PDG <=> MUX protocol.
[in]data_idData_id, see EMMG/PDG <=> MUX protocol.
[in]data_typeData_type, see EMMG/PDG <=> MUX protocol.
[in]section_formatIf true, send data in section format. If false, send data in TS packet format.
[out]channel_statusInitial response to channel_setup
[out]stream_statusInitial response to stream_setup
[in]abortAn interface to check if the application is interrupted.
[in]loggerWhere to report errors and messages.
Returns
True on success, false on error.

◆ requestBandwidth()

bool ts::EMMGClient::requestBandwidth ( uint16_t  bandwidth,
bool  synchronous = false 
)

Send a bandwidth request.

Parameters
[in]bandwidthRequested bandwidth in kbits/second.
[in]synchronousIf true, wait for the MUX to return either an error or a bandwidth allocation.
Returns
True on success, false on error.

◆ allocatedBandwidth()

uint16_t ts::EMMGClient::allocatedBandwidth ( )

Get the last allocated bandwidth as returned by the MUX.

Returns
The last allocated bandwidth in kbits/second or zero if there was none.

◆ getLastErrorResponse()

void ts::EMMGClient::getLastErrorResponse ( std::vector< uint16_t > &  error_status,
std::vector< uint16_t > &  error_information 
)

Get the last error response.

Parameters
[out]error_statusError code.
[out]error_informationError information.

◆ dataProvision() [1/4]

bool ts::EMMGClient::dataProvision ( const ByteBlockPtr data)

Send data provision.

Parameters
[in]dataData to send.
Returns
True on success, false on error.

◆ dataProvision() [2/4]

bool ts::EMMGClient::dataProvision ( const std::vector< ByteBlockPtr > &  data)

Send data provision.

Parameters
[in]dataData to send in several chunks.
Returns
True on success, false on error.

◆ dataProvision() [3/4]

bool ts::EMMGClient::dataProvision ( const void *  data,
size_t  size 
)

Send data provision.

Parameters
[in]dataAddress of data to send.
[in]sizeSize in bytes of data to send.
Returns
True on success, false on error.

◆ dataProvision() [4/4]

bool ts::EMMGClient::dataProvision ( const SectionPtrVector sections)

Send data provision in section format.

Parameters
[in]sectionsSections to send. If section_format was false during connect(), the sections are packetized first.
Returns
True on success, false on error.

◆ disconnect()

bool ts::EMMGClient::disconnect ( )

Disconnect from remote MUX.

Close stream and channel.

Returns
True on success, false on error.

◆ isConnected()

bool ts::EMMGClient::isConnected ( ) const
inline

Check if the EMMG is connected.

Returns
True if the EMMG is connected.

◆ totalBytes()

uint64_t ts::EMMGClient::totalBytes ( ) const
inline

Get the total number of data bytes which were sent so far.

Returns
The total number of data bytes which were sent so far.

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