TSDuck v3.40-3963
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::LogicalChannelNumbers Class Reference

A multi-standard storage of Logical Channel Numbers (LCN). More...

#include <tsLogicalChannelNumbers.h>

Public Member Functions

 LogicalChannelNumbers (DuckContext &duck)
 Constructor.
 
size_t addFromDescriptors (const DescriptorList &descs, uint16_t ts_id, uint16_t onet_id=0xFFFF)
 Collect all LCN which are declared in a list of descriptors.
 
size_t addFromNIT (const NIT &nit, uint16_t ts_id=0xFFFF, uint16_t onet_id=0xFFFF)
 Collect all LCN which are declared in a NIT.
 
void addLCN (uint16_t lcn, uint16_t srv_id, uint16_t ts_id, uint16_t onet_id, bool visible=true)
 Add the logical channel number of a service.
 
void clear ()
 Clear the content of the LCN store.
 
bool empty () const
 Check if the LCN store is empty.
 
uint16_t getLCN (const ServiceIdTriplet &srv) const
 Get the logical channel number of a service.
 
uint16_t getLCN (uint16_t srv_id, uint16_t ts_id, uint16_t onet_id=0xFFFF) const
 Get the logical channel number of a service.
 
bool getVisible (const ServiceIdTriplet &srv) const
 Get the visible flag of a service.
 
bool getVisible (uint16_t srv_id, uint16_t ts_id, uint16_t onet_id=0xFFFF) const
 Get the visible flag of a service.
 
size_t size () const
 Get the number of services in the LCN store.
 
bool updateService (Service &srv, bool replace) const
 Update a service description with its LCN.
 
template<class CONTAINER >
void updateServices (CONTAINER &services, Replacement rep) const
 Update a list of service descriptions with LCN's.
 

Detailed Description

A multi-standard storage of Logical Channel Numbers (LCN).

Logical Channel Numbers (LCN) are an important data for operators and users. However, there is not standard way to define them in the signalization. Several private descriptors exist. This class is a store of LCN values which can be collected from many type of tables.

Constructor & Destructor Documentation

◆ LogicalChannelNumbers()

ts::LogicalChannelNumbers::LogicalChannelNumbers ( DuckContext duck)

Constructor.

Parameters
[in,out]duckTSDuck execution context.

Member Function Documentation

◆ empty()

bool ts::LogicalChannelNumbers::empty ( ) const
inline

Check if the LCN store is empty.

Returns
True if the LCN store is empty.

◆ size()

size_t ts::LogicalChannelNumbers::size ( ) const
inline

Get the number of services in the LCN store.

Returns
The number of services in the LCN store.

◆ addLCN()

void ts::LogicalChannelNumbers::addLCN ( uint16_t  lcn,
uint16_t  srv_id,
uint16_t  ts_id,
uint16_t  onet_id,
bool  visible = true 
)

Add the logical channel number of a service.

Parameters
[in]lcnThe logical channel number to add.
[in]srv_idThe service id.
[in]ts_idThe transport stream id.
[in]onet_idThe original network id. Use 0xFFFF for "unspecified".
[in]visibleThe service LCN is visible.

◆ addFromNIT()

size_t ts::LogicalChannelNumbers::addFromNIT ( const NIT nit,
uint16_t  ts_id = 0xFFFF,
uint16_t  onet_id = 0xFFFF 
)

Collect all LCN which are declared in a NIT.

Parameters
[in]nitThe NIT to analyze.
[in]ts_idIf not 0xFFFF, get services from that TS id only.
[in]onet_idIf not 0xFFFF, get services from that original network id only.
Returns
The number of collected LCN.

◆ addFromDescriptors()

size_t ts::LogicalChannelNumbers::addFromDescriptors ( const DescriptorList descs,
uint16_t  ts_id,
uint16_t  onet_id = 0xFFFF 
)

Collect all LCN which are declared in a list of descriptors.

Parameters
[in]descsThe list of descriptors to analyze.
[in]ts_idThe transport stream id of all services.
[in]onet_idThe original network id to use. If set to 0xFFFF (the default), leave it unspecified.
Returns
The number of collected LCN.

◆ getLCN() [1/2]

uint16_t ts::LogicalChannelNumbers::getLCN ( uint16_t  srv_id,
uint16_t  ts_id,
uint16_t  onet_id = 0xFFFF 
) const

Get the logical channel number of a service.

Parameters
[in]srv_idThe service id to search.
[in]ts_idThe transport stream id of the service.
[in]onet_idThe original network id of the service. If set to 0xFFFF (the default), the first match service is used.
Returns
The LCN of the service or 0xFFFF if not found.

◆ getLCN() [2/2]

uint16_t ts::LogicalChannelNumbers::getLCN ( const ServiceIdTriplet srv) const

Get the logical channel number of a service.

Parameters
[in]srvThe service id triplet to search.
Returns
The LCN of the service or 0xFFFF if not found.

◆ getVisible() [1/2]

bool ts::LogicalChannelNumbers::getVisible ( uint16_t  srv_id,
uint16_t  ts_id,
uint16_t  onet_id = 0xFFFF 
) const

Get the visible flag of a service.

Parameters
[in]srv_idThe service id to search.
[in]ts_idThe transport stream id of the service.
[in]onet_idThe original network id of the service. If set to 0xFFFF (the default), the first match service is used.
Returns
The visible flag of the service or true if not found.

◆ getVisible() [2/2]

bool ts::LogicalChannelNumbers::getVisible ( const ServiceIdTriplet srv) const

Get the visible flag of a service.

Parameters
[in]srvThe service id triplet to search.
Returns
The visible flag of the service or true if not found.

◆ updateService()

bool ts::LogicalChannelNumbers::updateService ( Service srv,
bool  replace 
) const

Update a service description with its LCN.

Parameters
[in,out]srvThe service description to update. The service id and transport stream id must be set. If the original network id is unset, the first LCN matching the service id and transport stream id is used.
[in]replaceIf srv already has an LCN and replace is false, don't search.
Returns
True if the LCN was updated, false otherwise.

◆ updateServices()

template<class CONTAINER >
void ts::LogicalChannelNumbers::updateServices ( CONTAINER &  services,
Replacement  rep 
) const

Update a list of service descriptions with LCN's.

Template Parameters
CONTAINERA container class of Services with push_back() method.
Parameters
[in,out]servicesThe container of service description to update.
[in]repReplacement policy in services for new, updated, or absent services.

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