TSDuck v3.46-4964
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::DSMCCModuleAssembler Class Reference

#include <tsDSMCCModuleAssembler.h>

Classes

struct  ModuleContext

Public Types

using DiscoveryHandler = std::function<void(uint32_t download_id, uint16_t module_id)>
using ModuleHandler = std::function<void(const ModuleContext&)>
using ModuleKey = std::pair<uint32_t, uint16_t>

Public Member Functions

 DSMCCModuleAssembler (DuckContext &duck)
void clear ()
void feedDownloadData (DSMCCDownloadDataMessage &ddm)
void feedUserToNetwork (const DSMCCUserToNetworkMessage &unm)
const ModuleContext * module (uint32_t download_id, uint16_t module_id) const
const std::map< ModuleKey, ModuleContext > & modules () const
void setModuleCompletedHandler (ModuleHandler handler)
void setModuleDiscoveredHandler (DiscoveryHandler handler)

Static Public Attributes

static constexpr uint16_t DEFAULT_BLOCK_SIZE = 4066

Detailed Description

Assembles DSM-CC Object Carousel modules from DSI/DII/DDB messages.

Demux-agnostic: callers feed already-parsed DSM-CC messages via feedUserToNetwork() and feedDownloadData(). A callback is invoked when a module is fully assembled.

Member Typedef Documentation

◆ ModuleKey

using ts::DSMCCModuleAssembler::ModuleKey = std::pair<uint32_t, uint16_t>

Composite key used internally for tracking modules.

◆ ModuleHandler

using ts::DSMCCModuleAssembler::ModuleHandler = std::function<void(const ModuleContext&)>

Callback type for module completion events. Parameters: The completed ModuleContext.

◆ DiscoveryHandler

using ts::DSMCCModuleAssembler::DiscoveryHandler = std::function<void(uint32_t download_id, uint16_t module_id)>

Callback type for module discovery events. Fired once per (download_id, module_id) pair when its DII is first parsed. Not fired on version bumps of an already-known module, nor on orphan-DDB replay (the discovery already happened when the DII that announced the module arrived).

Constructor & Destructor Documentation

◆ DSMCCModuleAssembler()

ts::DSMCCModuleAssembler::DSMCCModuleAssembler ( DuckContext & duck)
explicit

Constructor.

Parameters
[in,out]duckTSDuck execution context.

Member Function Documentation

◆ clear()

void ts::DSMCCModuleAssembler::clear ( )

Clear the state of the assembler.

◆ feedUserToNetwork()

void ts::DSMCCModuleAssembler::feedUserToNetwork ( const DSMCCUserToNetworkMessage & unm)

Feed a DSM-CC User-to-Network Message (DSI or DII).

Parameters
[in]unmThe parsed message.

◆ feedDownloadData()

void ts::DSMCCModuleAssembler::feedDownloadData ( DSMCCDownloadDataMessage & ddm)

Feed a DSM-CC Download Data Message (DDB).

Parameters
[in,out]ddmThe parsed message. Payload may be moved out.

◆ modules()

const std::map< ModuleKey, ModuleContext > & ts::DSMCCModuleAssembler::modules ( ) const
inline

Snapshot of all known modules, keyed by (download_id, module_id).

Returns
The internal module map.

◆ module()

const ModuleContext * ts::DSMCCModuleAssembler::module ( uint32_t download_id,
uint16_t module_id ) const

Look up a module by (download_id, module_id).

Parameters
[in]download_idThe download_id.
[in]module_idThe module_id.
Returns
Pointer to the module context, or nullptr if not found.

◆ setModuleCompletedHandler()

void ts::DSMCCModuleAssembler::setModuleCompletedHandler ( ModuleHandler handler)
inline

Set a callback to be invoked when a module is fully loaded.

Parameters
[in]handlerThe callback function.

◆ setModuleDiscoveredHandler()

void ts::DSMCCModuleAssembler::setModuleDiscoveredHandler ( DiscoveryHandler handler)
inline

Set a callback to be invoked when a new module is announced via DII.

Parameters
[in]handlerThe callback function.

Member Data Documentation

◆ DEFAULT_BLOCK_SIZE

uint16_t ts::DSMCCModuleAssembler::DEFAULT_BLOCK_SIZE = 4066
staticconstexpr

Default block_size when the DII announces 0 (the spec forbids it but malformed carousels show up and we must not divide by zero).


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