A DVB-EMMG client which connects to any MUX to inject data.
More...
#include <tsEMMGClient.h>
|
| 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 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, const tlv::Logger &logger) |
| Connect to a remote MUX.
|
|
bool | dataProvision (const ByteBlockPtr &data) |
| Send data provision.
|
|
bool | dataProvision (const SectionPtrVector §ions) |
| 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.
|
|
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.
◆ EMMGClient()
Constructor.
- Parameters
-
[in] | duck | TSDuck execution context. The reference is kept inside the packetizer. |
[in] | protocol | Instance of EMMG/PDG <=> SCS protocol to use. A reference to the protocol instance is kept inside the object. |
◆ 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, |
|
|
const tlv::Logger & |
logger |
|
) |
| |
Connect to a remote MUX.
Perform all initial channel and stream negotiation.
- Parameters
-
[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. |
[in] | logger | Where 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] | bandwidth | Requested bandwidth in kbits/second. |
[in] | synchronous | If 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_status | Error code. |
[out] | error_information | Error information. |
◆ dataProvision() [1/4]
bool ts::EMMGClient::dataProvision |
( |
const ByteBlockPtr & |
data | ) |
|
Send data provision.
- Parameters
-
- Returns
- True on success, false on error.
◆ dataProvision() [2/4]
bool ts::EMMGClient::dataProvision |
( |
const std::vector< ByteBlockPtr > & |
data | ) |
|
Send data provision.
- Parameters
-
[in] | data | Data 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] | data | Address of data to send. |
[in] | size | Size in bytes of data to send. |
- Returns
- True on success, false on error.
◆ dataProvision() [4/4]
Send data provision in section format.
- Parameters
-
[in] | sections | Sections 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.
The documentation for this class was generated from the following file: