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

#include <tsDSMCCCarousel.h>

Classes

struct  GroupContext

Public Types

using GroupHandler = std::function<void(const GroupContext&)>
using GroupMap = std::map<uint32_t, GroupContext>
using ModuleHandler = std::function<void(uint32_t download_id, uint16_t module_id, const ByteBlock& payload)>
using ObjectHandler = std::function<void(uint32_t download_id, uint16_t module_id, const UString& name, const BIOPMessage& msg)>

Public Member Functions

 DSMCCCarousel (DuckContext &duck)
void clear ()
void feedDownloadData (DSMCCDownloadDataMessage &ddm)
void feedUserToNetwork (const DSMCCUserToNetworkMessage &unm)
void flushPendingObjects ()
const GroupMap & groups () const
const DSMCCModuleAssembler::ModuleContext * module (uint32_t download_id, uint16_t module_id) const
const std::map< DSMCCModuleAssembler::ModuleKey, DSMCCModuleAssembler::ModuleContext > & modules () const
void setGroupCompletedHandler (GroupHandler handler)
void setModuleCompletedHandler (ModuleHandler handler)
void setObjectHandler (ObjectHandler handler)
void setScanBIOP (bool enabled)

Detailed Description

DSM-CC Object Carousel library facade.

Demux-agnostic entry point for extracting the content of a DSM-CC Object Carousel. Callers feed already-parsed DSM-CC messages; the carousel assembles modules, decompresses them when required, and invokes a callback with the final payload.

Member Typedef Documentation

◆ GroupMap

using ts::DSMCCCarousel::GroupMap = std::map<uint32_t, GroupContext>

Map of carousel groups keyed by download_id.

◆ ModuleHandler

using ts::DSMCCCarousel::ModuleHandler = std::function<void(uint32_t download_id, uint16_t module_id, const ByteBlock& payload)>

Callback type for module completion events. Parameters: download_id (maps to the carousel group in data-carousel mode), module id, decompressed payload.

◆ ObjectHandler

using ts::DSMCCCarousel::ObjectHandler = std::function<void(uint32_t download_id, uint16_t module_id, const UString& name, const BIOPMessage& msg)>

Callback type for BIOP object events. Invoked once per BIOP message parsed from a completed module. Parameters: download_id of the owning carousel group, module id, resolved object path (joined NameComponents from the parent SRG/Directory bindings; empty if the parent has not been parsed yet), parsed BIOP message.

◆ GroupHandler

using ts::DSMCCCarousel::GroupHandler = std::function<void(const GroupContext&)>

Callback type for group completion events. Fires exactly once per group when all known modules reach COMPLETE. Parameters: the completed GroupContext (by const ref).

Constructor & Destructor Documentation

◆ DSMCCCarousel()

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

Constructor.

Parameters
[in,out]duckTSDuck execution context.

Member Function Documentation

◆ clear()

void ts::DSMCCCarousel::clear ( )

Clear carousel state.

◆ feedUserToNetwork()

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

Feed a DSM-CC User-to-Network Message (DSI or DII). For a DSI, the carousel engine extracts the ServiceGateway location from the IOR and pre-seeds the name resolver so path resolution works as soon as the SRG module arrives.

Parameters
[in]unmThe parsed message.

◆ feedDownloadData()

void ts::DSMCCCarousel::feedDownloadData ( DSMCCDownloadDataMessage & ddm)
inline

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

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

◆ modules()

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

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

Returns
The internal module map.

◆ module()

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

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.

◆ groups()

const GroupMap & ts::DSMCCCarousel::groups ( ) const
inline

Snapshot of all known groups, keyed by download_id.

Returns
The internal group map.

◆ flushPendingObjects()

void ts::DSMCCCarousel::flushPendingObjects ( )

Flush any BIOP objects that were buffered while waiting for their parent directory to be parsed. Objects whose names still cannot be resolved are emitted with an empty name.

◆ setModuleCompletedHandler()

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

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

Parameters
[in]handlerThe callback function.

◆ setObjectHandler()

void ts::DSMCCCarousel::setObjectHandler ( ObjectHandler handler)
inline

Set a callback to be invoked for each BIOP object extracted from a module.

Parameters
[in]handlerThe callback function.

◆ setGroupCompletedHandler()

void ts::DSMCCCarousel::setGroupCompletedHandler ( GroupHandler handler)
inline

Set a callback to be invoked when all known modules in a group complete.

Parameters
[in]handlerThe callback function.

◆ setScanBIOP()

void ts::DSMCCCarousel::setScanBIOP ( bool enabled)
inline

Enable or disable BIOP parsing of completed modules. When disabled, the module handler still fires but no object handler callbacks occur. Use this for plain data carousels (e.g. DVB-SSU) where module payloads are opaque and BIOP parsing would only produce spurious warnings.

Parameters
[in]enabledTrue to parse BIOP (default), false to skip.

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