![]() |
TSDuck v3.46-4965
MPEG Transport Stream Toolkit
|
#include <tsEMMGClient.h>


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 §ions) |
| 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 |
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.
| ts::EMMGClient::EMMGClient | ( | const DuckContext & | duck, |
| tlv::Logger & | logger, | ||
| const emmgmux::Protocol & | protocol ) |
Constructor.
| [in] | duck | TSDuck execution context. The reference is kept inside the packetizer. |
| [in,out] | logger | Where to report errors and messages. An internal reference is kept. The logger object must remain valid as long as this object exists. |
| [in] | protocol | Instance of EMMG/PDG <=> SCS protocol to use. A reference to the protocol instance is kept inside the object. |
|
overridevirtual |
Destructor.
| 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.
| [in] | mux | IP address and TCP port of the MUX. |
| [in] | udp | If 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_id | Client id, see EMMG/PDG <=> MUX protocol. |
| [in] | data_channel_id | Data_channel_id, see EMMG/PDG <=> MUX protocol. |
| [in] | data_stream_id | Data_stream_id, see EMMG/PDG <=> MUX protocol. |
| [in] | data_id | Data_id, see EMMG/PDG <=> MUX protocol. |
| [in] | data_type | Data_type, see EMMG/PDG <=> MUX protocol. |
| [in] | section_format | If true, send data in section format. If false, send data in TS packet format. |
| [out] | channel_status | Initial response to channel_setup |
| [out] | stream_status | Initial response to stream_setup |
| [in] | abort | An interface to check if the application is interrupted. |
| bool ts::EMMGClient::requestBandwidth | ( | uint16_t | bandwidth, |
| bool | synchronous = false ) |
Send a bandwidth request.
| [in] | bandwidth | Requested bandwidth in kbits/second. |
| [in] | synchronous | If true, wait for the MUX to return either an error or a bandwidth allocation. |
| uint16_t ts::EMMGClient::allocatedBandwidth | ( | ) |
Get the last allocated bandwidth as returned by the MUX.
| void ts::EMMGClient::getLastErrorResponse | ( | std::vector< uint16_t > & | error_status, |
| std::vector< uint16_t > & | error_information ) |
Get the last error response.
| [out] | error_status | Error code. |
| [out] | error_information | Error information. |
| bool ts::EMMGClient::dataProvision | ( | const ByteBlockPtr & | data | ) |
Send data provision.
| [in] | data | Data to send. |
| bool ts::EMMGClient::dataProvision | ( | const std::vector< ByteBlockPtr > & | data | ) |
Send data provision.
| [in] | data | Data to send in several chunks. |
| bool ts::EMMGClient::dataProvision | ( | const void * | data, |
| size_t | size ) |
Send data provision.
| [in] | data | Address of data to send. |
| [in] | size | Size in bytes of data to send. |
| bool ts::EMMGClient::dataProvision | ( | const SectionPtrVector & | sections | ) |
Send data provision in section format.
| [in] | sections | Sections to send. If section_format was false during connect(), the sections are packetized first. |
| bool ts::EMMGClient::disconnect | ( | ) |
Disconnect from remote MUX. Close stream and channel.
| bool ts::EMMGClient::isConnected | ( | ) | const |
Check if the EMMG is connected.
|
inline |
Get the total number of data bytes which were sent so far.
|
inline |
Reset the total number of data bytes which were sent so far.