TSDuck v3.40-3963
MPEG Transport Stream Toolkit
|
A DVB-ECMG client which acts as a DVB-SCS. More...
#include <tsECMGClient.h>
Public Member Functions | |
ECMGClient (const ecmgscs::Protocol &protocol, size_t extra_handler_stack_size=0) | |
Constructor. | |
virtual | ~ECMGClient () override |
Destructor. | |
bool | connect (const ECMGClientArgs &args, ecmgscs::ChannelStatus &channel_status, ecmgscs::StreamStatus &stream_status, const AbortInterface *abort, const tlv::Logger &logger) |
Connect to a remote ECMG. | |
bool | disconnect () |
Disconnect from remote ECMG. | |
bool | generateECM (uint16_t cp_number, const ByteBlock ¤t_cw, const ByteBlock &next_cw, const ByteBlock &ac, const ts::deciseconds &cp_duration, ecmgscs::ECMResponse &response) |
Synchronously generate an ECM. | |
bool | isConnected () const |
Check if the ECMG is connected. | |
bool | submitECM (uint16_t cp_number, const ByteBlock ¤t_cw, const ByteBlock &next_cw, const ByteBlock &ac, const ts::deciseconds &cp_duration, ECMGClientHandlerInterface *handler) |
Asynchronously generate an ECM. | |
A DVB-ECMG client which acts as a DVB-SCS.
Restriction: The target ECMG shall support only current or current/next control words in ECM, meaning CW_per_msg = 1 or 2 and lead_CW = 0 or 1.
ts::ECMGClient::ECMGClient | ( | const ecmgscs::Protocol & | protocol, |
size_t | extra_handler_stack_size = 0 |
||
) |
Constructor.
[in] | protocol | Instance of ECMG <=> SCS protocol to use. A reference to the protocol instance is kept inside the object. |
[in] | extra_handler_stack_size | If asynchronous ECM notification is used, an internal thread is created. This parameter gives the minimum amount of stack size for the execution of the handler. Zero for defaults. |
bool ts::ECMGClient::connect | ( | const ECMGClientArgs & | args, |
ecmgscs::ChannelStatus & | channel_status, | ||
ecmgscs::StreamStatus & | stream_status, | ||
const AbortInterface * | abort, | ||
const tlv::Logger & | logger | ||
) |
Connect to a remote ECMG.
Perform all initial channel and stream negotiation.
[in] | args | Set of ECMG parameters. |
[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. |
bool ts::ECMGClient::generateECM | ( | uint16_t | cp_number, |
const ByteBlock & | current_cw, | ||
const ByteBlock & | next_cw, | ||
const ByteBlock & | ac, | ||
const ts::deciseconds & | cp_duration, | ||
ecmgscs::ECMResponse & | response | ||
) |
Synchronously generate an ECM.
[in] | cp_number | Current crypto-period number. |
[in] | current_cw | Control word for current crypto-period. |
[in] | next_cw | Control word for next crypto-period. If empty, the ECMG must work with CW_per_msg = 1. |
[in] | ac | Access criteria, can be empty. |
[in] | cp_duration | Crypto-period in 100 ms units, unspecified if zero. |
[out] | response | Returned ECM. |
bool ts::ECMGClient::submitECM | ( | uint16_t | cp_number, |
const ByteBlock & | current_cw, | ||
const ByteBlock & | next_cw, | ||
const ByteBlock & | ac, | ||
const ts::deciseconds & | cp_duration, | ||
ECMGClientHandlerInterface * | handler | ||
) |
Asynchronously generate an ECM.
Submit the ECM request and return immediately. The notification of the ECM generation or error is performed through the specified handler.
[in] | cp_number | Current crypto-period number. |
[in] | current_cw | Control word for current crypto-period. |
[in] | next_cw | Control word for next crypto-period. If empty, the ECMG must work with CW_per_msg = 1. |
[in] | ac | Access criteria, can be empty. |
[in] | cp_duration | Crypto-period in 100 ms units, unspecified if zero. |
[in] | handler | Object which will be notified of the returned ECM. |
bool ts::ECMGClient::disconnect | ( | ) |
Disconnect from remote ECMG.
Close stream and channel.
bool ts::ECMGClient::isConnected | ( | ) | const |
Check if the ECMG is connected.