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

A DVB-ECMG client which acts as a DVB-SCS. More...

#include <tsECMGClient.h>

Inheritance diagram for ts::ECMGClient:
Collaboration diagram for ts::ECMGClient:

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 &current_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 &current_cw, const ByteBlock &next_cw, const ByteBlock &ac, const ts::deciseconds &cp_duration, ECMGClientHandlerInterface *handler)
 Asynchronously generate an ECM.
 

Detailed Description

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.

See also
DVB standard ETSI TS 103.197 V1.4.1 for ECMG <=> SCS protocol.

Constructor & Destructor Documentation

◆ ECMGClient()

ts::ECMGClient::ECMGClient ( const ecmgscs::Protocol protocol,
size_t  extra_handler_stack_size = 0 
)

Constructor.

Parameters
[in]protocolInstance of ECMG <=> SCS protocol to use. A reference to the protocol instance is kept inside the object.
[in]extra_handler_stack_sizeIf 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.

Member Function Documentation

◆ connect()

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.

Parameters
[in]argsSet of ECMG parameters.
[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.

◆ generateECM()

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.

Parameters
[in]cp_numberCurrent crypto-period number.
[in]current_cwControl word for current crypto-period.
[in]next_cwControl word for next crypto-period. If empty, the ECMG must work with CW_per_msg = 1.
[in]acAccess criteria, can be empty.
[in]cp_durationCrypto-period in 100 ms units, unspecified if zero.
[out]responseReturned ECM.
Returns
True on success, false on error.

◆ submitECM()

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.

Parameters
[in]cp_numberCurrent crypto-period number.
[in]current_cwControl word for current crypto-period.
[in]next_cwControl word for next crypto-period. If empty, the ECMG must work with CW_per_msg = 1.
[in]acAccess criteria, can be empty.
[in]cp_durationCrypto-period in 100 ms units, unspecified if zero.
[in]handlerObject which will be notified of the returned ECM.
Returns
True on success, false on error.

◆ disconnect()

bool ts::ECMGClient::disconnect ( )

Disconnect from remote ECMG.

Close stream and channel.

Returns
True on success, false on error.

◆ isConnected()

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

Check if the ECMG is connected.

Returns
True if the ECMG is connected.

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