![]() |
TSDuck v3.44-4659
MPEG Transport Stream Toolkit
|
DSM-CC Object Carousel library facade. More...
#include <tsDSMCCCarousel.h>
Classes | |
| struct | GroupContext |
| Per-group bookkeeping for the carousel. More... | |
Public Types | |
| using | GroupHandler = std::function< void(const GroupContext &)> |
| Callback type for group completion events. | |
| using | GroupMap = std::map< uint32_t, GroupContext > |
Map of carousel groups keyed by download_id. | |
| using | ModuleHandler = std::function< void(uint32_t download_id, uint16_t module_id, const ByteBlock &payload)> |
| Callback type for module completion events. | |
| using | ObjectHandler = std::function< void(uint32_t download_id, uint16_t module_id, const UString &name, const BIOPMessage &msg)> |
| Callback type for BIOP object events. | |
Public Member Functions | |
| DSMCCCarousel (DuckContext &duck) | |
| Constructor. | |
| void | clear () |
| Clear carousel state. | |
| void | feedDownloadData (DSMCCDownloadDataMessage &ddm) |
| Feed a DSM-CC Download Data Message (DDB). | |
| void | feedUserToNetwork (const DSMCCUserToNetworkMessage &unm) |
| Feed a DSM-CC User-to-Network Message (DSI or DII). | |
| void | flushPendingObjects () |
| Flush any BIOP objects that were buffered while waiting for their parent directory to be parsed. | |
| const GroupMap & | groups () const |
| Snapshot of all known groups, keyed by download_id. | |
| const DSMCCModuleAssembler::ModuleContext * | module (uint32_t download_id, uint16_t module_id) const |
| Look up a module by (download_id, module_id). | |
| const std::map< DSMCCModuleAssembler::ModuleKey, DSMCCModuleAssembler::ModuleContext > & | modules () const |
| Snapshot of all known modules, keyed by (download_id, module_id). | |
| void | setGroupCompletedHandler (GroupHandler handler) |
| Set a callback to be invoked when all known modules in a group complete. | |
| void | setModuleCompletedHandler (ModuleHandler handler) |
| Set a callback to be invoked when a module is fully loaded and decompressed. | |
| void | setObjectHandler (ObjectHandler handler) |
| Set a callback to be invoked for each BIOP object extracted from a module. | |
| void | setScanBIOP (bool enabled) |
| Enable or disable BIOP parsing of completed modules. | |
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.
| 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.
| 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.
| 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).
|
explicit |
Constructor.
| [in,out] | duck | TSDuck execution context. |
| 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.
| [in] | unm | The parsed message. |
|
inline |
Feed a DSM-CC Download Data Message (DDB).
| [in,out] | ddm | The parsed message. Payload may be moved out. |
|
inline |
Snapshot of all known modules, keyed by (download_id, module_id).
|
inline |
Look up a module by (download_id, module_id).
| [in] | download_id | The download_id. |
| [in] | module_id | The module_id. |
|
inline |
Snapshot of all known groups, keyed by download_id.
| 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.
|
inline |
Set a callback to be invoked when a module is fully loaded and decompressed.
| [in] | handler | The callback function. |
|
inline |
Set a callback to be invoked for each BIOP object extracted from a module.
| [in] | handler | The callback function. |
|
inline |
Set a callback to be invoked when all known modules in a group complete.
| [in] | handler | The callback function. |
|
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.
| [in] | enabled | True to parse BIOP (default), false to skip. |