TSDuck v3.40-3963
MPEG Transport Stream Toolkit
|
Discover and describe a DVB service. More...
#include <tsServiceDiscovery.h>
Public Types | |
enum | ServiceField : uint32_t { ID = 0x0001 , TSID = 0x0002 , ONID = 0x0004 , PMT_PID = 0x0008 , LCN = 0x0010 , TYPE_DVB = 0x0020 , NAME = 0x0040 , PROVIDER = 0x0080 , EITS = 0x0100 , EITPF = 0x0200 , CA = 0x0400 , RUNNING = 0x0800 , TYPE_ATSC = 0x1000 , MAJORID_ATSC = 0x2000 , MINORID_ATSC = 0x4000 , HIDDEN = 0x8000 } |
List of possible fields a Service may have set. More... | |
Public Member Functions | |
ServiceDiscovery (DuckContext &duck, const UString &desc, SignalizationHandlerInterface *pmtHandler=nullptr) | |
Constructor using a string description. | |
ServiceDiscovery (DuckContext &duck, SignalizationHandlerInterface *pmtHandler=nullptr) | |
Default constructor. | |
virtual void | clear () override |
Clear all fields. | |
void | clearCAControlled () |
Clear the CA-controlled (as declared in the SDT) . | |
void | clearEITpfPresent () |
Clear the EIT present/following present (as declared in the SDT) . | |
void | clearEITsPresent () |
Clear the EIT schedule present (as declared in the SDT) . | |
void | clearHidden () |
Clear the Service is hidden to end-user . | |
void | clearId () |
Clear the Service Id . | |
void | clearLCN () |
Clear the Logical Channel Number . | |
void | clearMajorIdATSC () |
Clear the ATSC major id (as declared in TVCT or CVCT) . | |
void | clearMinorIdATSC () |
Clear the ATSC major id (as declared in TVCT or CVCT) . | |
void | clearModified () |
Clear the "modified" indicator. | |
void | clearName () |
Clear the Service Name . | |
void | clearONId () |
Clear the Original Network Id . | |
void | clearPMTPID () |
Clear the PMT PID . | |
void | clearProvider () |
Clear the Provider Name . | |
void | clearRunningStatus () |
Clear the Running status (as declared in the SDT) . | |
void | clearTSId () |
Clear the Transport Stream Id . | |
void | clearTypeATSC () |
Clear the ATSC service type (as declared in TVCT or CVCT) . | |
void | clearTypeDVB () |
Clear the DVB service type (as declared in service_descriptor) . | |
void | feedPacket (const TSPacket &pkt) |
The following method feeds the service discovery with a TS packet. | |
bool | getCAControlled () const |
Get the CA-controlled (as declared in the SDT) . | |
bool | getEITpfPresent () const |
Get the EIT present/following present (as declared in the SDT) . | |
bool | getEITsPresent () const |
Get the EIT schedule present (as declared in the SDT) . | |
uint32_t | getFields () const |
Get the list of fields which are set in a Service. | |
bool | getHidden () const |
Get the Service is hidden to end-user . | |
uint16_t | getId () const |
Get the Service Id . | |
uint16_t | getLCN () const |
Get the Logical Channel Number . | |
uint16_t | getMajorIdATSC () const |
Get the ATSC major id (as declared in TVCT or CVCT) . | |
uint16_t | getMinorIdATSC () const |
Get the ATSC major id (as declared in TVCT or CVCT) . | |
UString | getName () const |
Get the Service Name . | |
uint16_t | getONId () const |
Get the Original Network Id . | |
const PMT & | getPMT () const |
Get a constant reference to the last received PMT for the service. | |
PID | getPMTPID () const |
Get the PMT PID . | |
UString | getProvider () const |
Get the Provider Name . | |
uint8_t | getRunningStatus () const |
Get the Running status (as declared in the SDT) . | |
uint16_t | getTSId () const |
Get the Transport Stream Id . | |
uint8_t | getTypeATSC () const |
Get the ATSC service type (as declared in TVCT or CVCT) . | |
uint8_t | getTypeDVB () const |
Get the DVB service type (as declared in service_descriptor) . | |
bool | hasCAControlled () const |
Check if the CA-controlled (as declared in the SDT) is present. | |
bool | hasCAControlled (bool value) const |
Check if the CA-controlled (as declared in the SDT) has a given value. | |
bool | hasEITpfPresent () const |
Check if the EIT present/following present (as declared in the SDT) is present. | |
bool | hasEITpfPresent (bool value) const |
Check if the EIT present/following present (as declared in the SDT) has a given value. | |
bool | hasEITsPresent () const |
Check if the EIT schedule present (as declared in the SDT) is present. | |
bool | hasEITsPresent (bool value) const |
Check if the EIT schedule present (as declared in the SDT) has a given value. | |
bool | hasHidden () const |
Check if the Service is hidden to end-user is present. | |
bool | hasHidden (bool value) const |
Check if the Service is hidden to end-user has a given value. | |
bool | hasId () const |
Check if the Service Id is present. | |
bool | hasId (uint16_t value) const |
Check if the Service Id has a given value. | |
bool | hasLCN () const |
Check if the Logical Channel Number is present. | |
bool | hasLCN (uint16_t value) const |
Check if the Logical Channel Number has a given value. | |
bool | hasMajorIdATSC () const |
Check if the ATSC major id (as declared in TVCT or CVCT) is present. | |
bool | hasMajorIdATSC (uint16_t value) const |
Check if the ATSC major id (as declared in TVCT or CVCT) has a given value. | |
bool | hasMinorIdATSC () const |
Check if the ATSC major id (as declared in TVCT or CVCT) is present. | |
bool | hasMinorIdATSC (uint16_t value) const |
Check if the ATSC major id (as declared in TVCT or CVCT) has a given value. | |
bool | hasName () const |
Check if the Service Name is present. | |
bool | hasName (const UString &value) const |
Check if the Service Name has a given value. | |
bool | hasONId () const |
Check if the Original Network Id is present. | |
bool | hasONId (uint16_t value) const |
Check if the Original Network Id has a given value. | |
bool | hasPMT () const |
Check if the PMT of the service is known. | |
bool | hasPMTPID () const |
Check if the PMT PID is present. | |
bool | hasPMTPID (PID value) const |
Check if the PMT PID has a given value. | |
bool | hasProvider () const |
Check if the Provider Name is present. | |
bool | hasProvider (const UString &value) const |
Check if the Provider Name has a given value. | |
bool | hasRunningStatus () const |
Check if the Running status (as declared in the SDT) is present. | |
bool | hasRunningStatus (uint8_t value) const |
Check if the Running status (as declared in the SDT) has a given value. | |
bool | hasTSId () const |
Check if the Transport Stream Id is present. | |
bool | hasTSId (uint16_t value) const |
Check if the Transport Stream Id has a given value. | |
bool | hasTypeATSC () const |
Check if the ATSC service type (as declared in TVCT or CVCT) is present. | |
bool | hasTypeATSC (uint8_t value) const |
Check if the ATSC service type (as declared in TVCT or CVCT) has a given value. | |
bool | hasTypeDVB () const |
Check if the DVB service type (as declared in service_descriptor) is present. | |
bool | hasTypeDVB (uint8_t value) const |
Check if the DVB service type (as declared in service_descriptor) has a given value. | |
bool | isModified () const |
Check if any field was modified since the last call to clearModified(). | |
bool | match (const UString &ident, bool exact_match=false) const |
Check if a service matches a string identification. | |
bool | nonExistentService () const |
Check if the service is non-existent. | |
virtual void | set (const UString &desc) override |
Reset using a string description. | |
void | setCAControlled (bool value) |
Set the CA-controlled (as declared in the SDT) . | |
void | setEITpfPresent (bool value) |
Set the EIT present/following present (as declared in the SDT) . | |
void | setEITsPresent (bool value) |
Set the EIT schedule present (as declared in the SDT) . | |
void | setHidden (bool value) |
Set the Service is hidden to end-user . | |
void | setId (uint16_t value) |
Set the Service Id . | |
void | setLCN (uint16_t value) |
Set the Logical Channel Number . | |
void | setMajorIdATSC (uint16_t value) |
Set the ATSC major id (as declared in TVCT or CVCT) . | |
void | setMinorIdATSC (uint16_t value) |
Set the ATSC major id (as declared in TVCT or CVCT) . | |
void | setName (const UString &value) |
Set the Service Name . | |
void | setONId (uint16_t value) |
Set the Original Network Id . | |
void | setPMTHandler (SignalizationHandlerInterface *h) |
Replace the PMT handler. | |
void | setPMTPID (PID value) |
Set the PMT PID . | |
void | setProvider (const UString &value) |
Set the Provider Name . | |
void | setRunningStatus (uint8_t value) |
Set the Running status (as declared in the SDT) . | |
void | setTSId (uint16_t value) |
Set the Transport Stream Id . | |
void | setTypeATSC (uint8_t value) |
Set the ATSC service type (as declared in TVCT or CVCT) . | |
void | setTypeDVB (uint8_t value) |
Set the DVB service type (as declared in service_descriptor) . | |
virtual UString | toString () const override |
Convert to a string object. | |
Static Public Member Functions | |
template<class CONTAINER > | |
static std::ostream & | Display (std::ostream &strm, const UString &margin, const CONTAINER &container, bool header=true) |
Display a container of services, one line per service. | |
template<class ITERATOR > | |
static std::ostream & | Display (std::ostream &strm, const UString &margin, const ITERATOR &begin, const ITERATOR &end, bool header=true) |
Display a container of services, one line per service. | |
static bool | Sort1 (const Service &s1, const Service &s2) |
Sorting criterion method, used by std::sort(). | |
static bool | Sort2 (const Service &s1, const Service &s2) |
Sorting criterion method, used by std::sort(). | |
static bool | Sort3 (const Service &s1, const Service &s2) |
Sorting criterion method, used by std::sort(). | |
Discover and describe a DVB service.
This subclass of Service automatically detects the properties of the service based on TS packets from the transport stream.
|
inherited |
List of possible fields a Service may have set.
Can be used as bitfield.
Enumerator | |
---|---|
ID | Service id. |
TSID | Transport stream id. |
ONID | Original network id. |
PMT_PID | PMT PID. |
LCN | Logical channel number. |
TYPE_DVB | DVB service type (as defined in service_descriptor). |
NAME | Service name. |
PROVIDER | Provider name. |
EITS | |
EITPF | |
CA | CA-controlled (as declared in the SDT). |
RUNNING | Running status (as declared in the SDT). |
TYPE_ATSC | |
MAJORID_ATSC | |
MINORID_ATSC | |
HIDDEN | Service is hidden to end-user. |
|
explicit |
Default constructor.
[in,out] | duck | TSDuck execution context. The reference is kept inside the demux. |
[in] | pmtHandler | Handler to call for each new PMT. |
|
explicit |
Constructor using a string description.
[in,out] | duck | TSDuck execution context. The reference is kept inside the demux. |
[in] | desc | Service description string. If the string evaluates to an integer (decimal or hexa), this is a service id, otherwise this is a service name. If the string is empty or "-", use the first service from the PAT. |
[in] | pmtHandler | Handler to call for each new PMT. |
|
overridevirtual |
Reset using a string description.
[in] | desc | Service description string. If the string evaluates to an integer (decimal or hexa), this is a service id, otherwise this is a service name. |
Reimplemented from ts::Service.
Clear all fields.
Reimplemented from ts::Service.
The following method feeds the service discovery with a TS packet.
The application should pass all packets of the TS.
[in] | pkt | A TS packet. |
|
inline |
Replace the PMT handler.
[in] | h | The new handler. |
|
inline |
|
inline |
Check if the service is non-existent.
|
inlineinherited |
Clear the "modified" indicator.
This indicator is set whenever a field is updated with a different value.
|
inlineinherited |
Check if any field was modified since the last call to clearModified().
Convert to a string object.
Implements ts::StringifyInterface.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Check if the Transport Stream Id is present.
Check if the Transport Stream Id has a given value.
[in] | value | The Transport Stream Id to check. |
|
inlineinherited |
Clear the Transport Stream Id .
|
inlineinherited |
Get the Transport Stream Id .
Set the Transport Stream Id .
[in] | value | The Transport Stream Id . |
|
inlineinherited |
Check if the Original Network Id is present.
Check if the Original Network Id has a given value.
[in] | value | The Original Network Id to check. |
|
inlineinherited |
Clear the Original Network Id .
|
inlineinherited |
Get the Original Network Id .
Set the Original Network Id .
[in] | value | The Original Network Id . |
|
inlineinherited |
Check if the Logical Channel Number is present.
Check if the Logical Channel Number has a given value.
[in] | value | The Logical Channel Number to check. |
|
inlineinherited |
Clear the Logical Channel Number .
|
inlineinherited |
Get the Logical Channel Number .
Set the Logical Channel Number .
[in] | value | The Logical Channel Number . |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Check if the DVB service type (as declared in service_descriptor) is present.
Check if the DVB service type (as declared in service_descriptor) has a given value.
[in] | value | The DVB service type (as declared in service_descriptor) to check. |
|
inlineinherited |
Clear the DVB service type (as declared in service_descriptor) .
|
inlineinherited |
Get the DVB service type (as declared in service_descriptor) .
Set the DVB service type (as declared in service_descriptor) .
[in] | value | The DVB service type (as declared in service_descriptor) . |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Clear the Running status (as declared in the SDT) .
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Clear the CA-controlled (as declared in the SDT) .
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Check if the Provider Name is present.
Check if the Provider Name has a given value.
[in] | value | The Provider Name to check. |
|
inlineinherited |
Clear the Provider Name .
|
inlineinherited |
Get the Provider Name .
Set the Provider Name .
[in] | value | The Provider Name . |
|
inherited |
Check if a service matches a string identification.
[in] | ident | Service identification, either an integer (service id) or service name. |
[in] | exact_match | If true, the service name must be exactly identical to ident. If it is false, the search is case-insensitive and blanks are ignored. |
Sorting criterion method, used by std::sort().
Sort order: LCN, ONId, TSId, Id, name, provider, type, PMT PID.
If both objects have a given field set, sort according to this field. If only one object has this field set, it comes first. If none of the two objects have this field set, use to next criterion.
[in] | s1 | First service. |
[in] | s2 | First service. |
Sorting criterion method, used by std::sort().
Sort order: name, provider, LCN, ONId, TSId, Id, type, PMT PID.
If both objects have a given field set, sort according to this field. If only one object has this field set, it comes first. If none of the two objects have this field set, use to next criterion.
[in] | s1 | First service. |
[in] | s2 | First service. |
Sorting criterion method, used by std::sort().
Sort order: ONId, TSId, Id, type, name, provider, LCN, PMT PID.
If both objects have a given field set, sort according to this field. If only one object has this field set, it comes first. If none of the two objects have this field set, use to next criterion.
[in] | s1 | First service. |
[in] | s2 | First service. |
|
staticinherited |
Display a container of services, one line per service.
ITERATOR | An iterator class in the container. |
[in,out] | strm | Output text stream. |
[in] | margin | The string to print as left margin. |
[in] | begin | Iterator to the first object to display. |
[in] | end | Iterator after the last object to display. |
[in] | header | If true, display a header line first. |
|
inlinestaticinherited |
Display a container of services, one line per service.
CONTAINER | A container class. |
[in,out] | strm | Output text stream. |
[in] | margin | The string to print as left margin. |
[in] | container | Container of services to display. |
[in] | header | If true, display a header line first. |