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

#include <tsECMGClient.h>

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

Public Member Functions

 ECMGClient (tlv::Logger &logger, const ecmgscs::Protocol &protocol, size_t extra_handler_stack_size=0)
virtual ~ECMGClient () override
bool connect (const ECMGClientArgs &args, ecmgscs::ChannelStatus &channel_status, ecmgscs::StreamStatus &stream_status, const AbortInterface *abort=nullptr)
bool disconnect ()
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)
bool isConnected () const
bool submitECM (uint16_t cp_number, const ByteBlock &current_cw, const ByteBlock &next_cw, const ByteBlock &ac, const ts::deciseconds &cp_duration, ECMGClientHandlerInterface *handler)

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 ( tlv::Logger & logger,
const ecmgscs::Protocol & protocol,
size_t extra_handler_stack_size = 0 )

Constructor.

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

◆ ~ECMGClient()

virtual ts::ECMGClient::~ECMGClient ( )
overridevirtual

Destructor.

Member Function Documentation

◆ connect()

bool ts::ECMGClient::connect ( const ECMGClientArgs & args,
ecmgscs::ChannelStatus & channel_status,
ecmgscs::StreamStatus & stream_status,
const AbortInterface * abort = nullptr )

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

Check if the ECMG is connected.

Returns
True if the ECMG is connected.

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