TSDuck v3.46-4965
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches

#include <tsEMMGClient.h>

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

Public Member Functions

 EMMGClient (const DuckContext &duck, tlv::Logger &logger, const emmgmux::Protocol &protocol)
virtual ~EMMGClient () override
uint16_t allocatedBandwidth ()
bool connect (const IPSocketAddress &mux, const IPSocketAddress &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=nullptr)
bool dataProvision (const ByteBlockPtr &data)
bool dataProvision (const SectionPtrVector &sections)
bool dataProvision (const std::vector< ByteBlockPtr > &data)
bool dataProvision (const void *data, size_t size)
bool disconnect ()
void getLastErrorResponse (std::vector< uint16_t > &error_status, std::vector< uint16_t > &error_information)
bool isConnected () const
bool requestBandwidth (uint16_t bandwidth, bool synchronous=false)
void resetTotalBytes ()
uint64_t totalBytes () const

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,
tlv::Logger & logger,
const emmgmux::Protocol & protocol )

Constructor.

Parameters
[in]duckTSDuck execution context. The reference is kept inside the packetizer.
[in,out]loggerWhere to report errors and messages. An internal reference is kept. The logger object must remain valid as long as this object exists.
[in]protocolInstance of EMMG/PDG <=> SCS protocol to use. A reference to the protocol instance is kept inside the object.

◆ ~EMMGClient()

virtual ts::EMMGClient::~EMMGClient ( )
overridevirtual

Destructor.

Member Function Documentation

◆ connect()

bool ts::EMMGClient::connect ( const IPSocketAddress & mux,
const IPSocketAddress & 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 = nullptr )

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.
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

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.

◆ resetTotalBytes()

void ts::EMMGClient::resetTotalBytes ( )
inline

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


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