Service information

Provides access to the underlying database to add/remove and modify services. More...

Data Structures

struct  Service_t
 Structure describing a digital TV service. More...

Defines

#define ServiceAreEqual(_service1, _service2)
 Macro to compare 2 service structures.
#define ServiceNew()   (Service_t*)ObjectCreateType(Service_t)
 Create a new service object.
#define ServiceRefInc(__service)
 Increment the references to the specified service object.
#define ServiceRefDec(__service)
 Decrement the references of the specified service object.

Typedefs

typedef void * ServiceEnumerator_t
 Handle for enumerating services.

Enumerations

enum  ServiceType { ServiceType_TV, ServiceType_Radio, ServiceType_Data, ServiceType_Unknown }
 Enumeration to describe the type of a service. More...

Functions

int ServiceInit (void)
 Initialise the service module for use.
int ServiceDeinit (void)
 Release resources used by the service module.
int ServiceCount ()
 Return the number of services in the database.
int ServiceForMultiplexCount (int multiplexuid)
 Retrieve the number of services on the specified multplex.
int ServiceDelete (Service_t *service)
 Remove a service from the database.
int ServiceAdd (int multiplexuid, char *name, int id, int source, bool ca, ServiceType type, int pmtversion, int pmtpid, int pcrpid)
 Add a service to the database.
int ServicePMTVersionSet (Service_t *service, int pmtversion)
 Set the PMT version for the given service.
int ServicePMTPIDSet (Service_t *service, int pmtpid)
 Set the PMT PID for the given service.
int ServicePCRPIDSet (Service_t *service, int pcrpid)
 Set the PCR PID for the given service.
int ServiceNameSet (Service_t *service, char *name)
 Set the service name for the given service.
int ServiceSourceSet (Service_t *service, int source)
 Set the service name for the given service.
int ServiceConditionalAccessSet (Service_t *service, bool ca)
 Set whether the service is conditional access of not.
int ServiceTypeSet (Service_t *service, ServiceType type)
 Set the type of the specified service.
int ServiceProviderSet (Service_t *service, char *provider)
 Set the service provider name for the given service.
int ServiceDefaultAuthoritySet (Service_t *service, char *defaultAuthority)
 Set the default authority for the given service.
Service_tServiceFind (char *name)
 Find a service based either on service name or fully qualified id.
Service_tServiceFindName (char *name)
 Find the service with the given name.
Service_tServiceFindId (Multiplex_t *multiplex, int id)
 Find the service with the given id.
Service_tServiceFindFQID (uint16_t networkId, uint16_t tsId, uint16_t serviceId)
 Find the service based on the fully qualified ID.
Service_tServiceFindFQIDStr (char *FQIdStr)
 Find the service based on the fully qualified ID string.
ServiceEnumerator_t ServiceEnumeratorGet ()
 Retrieve an enumerator for the entire service table.
ServiceEnumerator_t ServiceEnumeratorForMultiplex (Multiplex_t *multiplex)
 Retrieve an enumerator for the specified multiplex.
ServiceEnumerator_t ServiceFindByPID (int pid, Multiplex_t *opt_multiplex)
 Retrieve an enumerator for the services known to be assosciated with the given PID.
ServiceEnumerator_t ServiceQueryNameLike (char *query)
 Retrieve an enumerator for the names that match the query string.
void ServiceEnumeratorDestroy (ServiceEnumerator_t enumerator)
 Free an enumerator.
Service_tServiceGetNext (ServiceEnumerator_t enumerator)
 Retrieve the next service from an enumerator.

Detailed Description

Provides access to the underlying database to add/remove and modify services.

Events Exported

Services.Added

This event is fired after a service has been added to the database.
payload = A Service_t representing the service that has been added.

Services.Deleted

This event is fired before a service is removed from the database.
payload = A Service_t representing the service that is to be removed.

Define Documentation

#define ServiceAreEqual ( _service1,
_service2   ) 

Value:

(((_service1)->multiplexUID == (_service2)->multiplexUID) && \
    ((_service1)->id == (_service2)->id))
Macro to compare 2 service structures.

#define ServiceRefDec ( __service   ) 

Value:

do{ \
            if ((__service)) \
            { \
                ObjectRefDec(__service); \
            } \
        }while(0)
Decrement the references of the specified service object.

If the reference count reaches 0 the instance is free'd.

Parameters:
__service The service instance to decrement the reference count of.

#define ServiceRefInc ( __service   ) 

Value:

do{ \
            if ((__service)) \
            { \
                ObjectRefInc(__service); \
            } \
        }while(0)
Increment the references to the specified service object.

Parameters:
__service The service instance to increment the reference count of.


Enumeration Type Documentation

Enumeration to describe the type of a service.

Enumerator:
ServiceType_TV  Digital TV service type.

ServiceType_Radio  Digital Radio service type.

ServiceType_Data  Digital Data service type.

ServiceType_Unknown  Service type not known.


Function Documentation

int ServiceAdd ( int  multiplexuid,
char *  name,
int  id,
int  source,
bool  ca,
ServiceType  type,
int  pmtversion,
int  pmtpid,
int  pcrpid 
)

Add a service to the database.

Parameters:
multiplexuid The multiplex the service is broadcast on.
name Name of the service.
id The service/program id of the service.
source The service/channels source id.
ca Whether the service is conditional access.
type The type of the service.
pmtversion The version of the last PMT processed.
pmtpid The PID the service's PMT is transmitted on.
pcrpid The PID the service's PCR is transmitted on.
Returns:
0 on success, otherwise an SQLite error code.

int ServiceConditionalAccessSet ( Service_t service,
bool  ca 
)

Set whether the service is conditional access of not.

Parameters:
service The service to update.
ca The new state of the service
Returns:
0 on success, otherwise an SQLite error code.

int ServiceCount (  ) 

Return the number of services in the database.

Returns:
The number of services in the database.

int ServiceDefaultAuthoritySet ( Service_t service,
char *  defaultAuthority 
)

Set the default authority for the given service.

Parameters:
service The service to update.
defaultAuthority The new authority of the service.
Returns:
0 on success, otherwise an SQLite error code.

int ServiceDeinit ( void   ) 

Release resources used by the service module.

Returns:
0 on success.

int ServiceDelete ( Service_t service  ) 

Remove a service from the database.

Parameters:
service The service to remove from the database.
Returns:
0 on success, otherwise an SQLite error code.

ServiceEnumerator_t ServiceEnumeratorForMultiplex ( Multiplex_t multiplex  ) 

Retrieve an enumerator for the specified multiplex.

Parameters:
multiplex The multiplex the service is broadcast on.
Returns:
A service enumerator or NULL if there is not enough memory.

ServiceEnumerator_t ServiceEnumeratorGet (  ) 

Retrieve an enumerator for the entire service table.

Returns:
A service enumerator or NULL if there is not enough memory.

Service_t* ServiceFind ( char *  name  ) 

Find a service based either on service name or fully qualified id.

See also:
ServiceFindName()

ServiceFindFQIDStr()

Parameters:
name Service name or fully qualified id.
Returns:
A service structure or NULL if the service was not found.

ServiceEnumerator_t ServiceFindByPID ( int  pid,
Multiplex_t opt_multiplex 
)

Retrieve an enumerator for the services known to be assosciated with the given PID.

Optionally restrict the search to a given multiplex.

Parameters:
pid The PID to search for.
opt_multiplex Optional. The multiplex the service is broadcast on.
Returns:
A service enumerator or NULL if there is not enough memory.

Service_t* ServiceFindFQID ( uint16_t  networkId,
uint16_t  tsId,
uint16_t  serviceId 
)

Find the service based on the fully qualified ID.

The returned service should be released with ServiceRefDec.

Parameters:
networkId Network ID of the multiplex this service is on.
tsId TS ID of the multiplex this service is on.
serviceId ID of the service to find.
Returns:
A service structure or NULL if the service was not found.

Service_t* ServiceFindFQIDStr ( char *  FQIdStr  ) 

Find the service based on the fully qualified ID string.

A fully qualified ID string is in the form "<netId>.<tsId>.<serviceId>", where all the IDs are 16bit hex numbers. The returned service should be released with ServiceRefDec.

Parameters:
FQIdStr String to extract the network, ts and service IDs from.
Returns:
A service structure or NULL if the service was not found.

Service_t* ServiceFindId ( Multiplex_t multiplex,
int  id 
)

Find the service with the given id.

The returned service should be released with ServiceRefDec.

Parameters:
multiplex The multiplex the service is broadcast on.
id The id of the service to find.
Returns:
A service structure or NULL if the service was not found.

Service_t* ServiceFindName ( char *  name  ) 

Find the service with the given name.

The returned service should be released with ServiceRefDec.

Parameters:
name The name of the service to find.
Returns:
A service structure or NULL if the service was not found.

int ServiceForMultiplexCount ( int  multiplexuid  ) 

Retrieve the number of services on the specified multplex.

Parameters:
multiplexuid The multiplex to retrieve the service count for.
Returns:
The number of services on the specified multiplex.

Service_t* ServiceGetNext ( ServiceEnumerator_t  enumerator  ) 

Retrieve the next service from an enumerator.

The returned service should be released with ServiceRefDec.

Parameters:
enumerator The enumerator to retrieve the next service from.
Returns:
A Service_t structure or NULL if there are no more services (with the reference count set to 1)

int ServiceInit ( void   ) 

Initialise the service module for use.

Returns:
0 on success.

int ServiceNameSet ( Service_t service,
char *  name 
)

Set the service name for the given service.

Parameters:
service The service to update.
name The new name of the service.
Returns:
0 on success, otherwise an SQLite error code.

int ServicePCRPIDSet ( Service_t service,
int  pcrpid 
)

Set the PCR PID for the given service.

Parameters:
service The service to update.
pcrpid The new PID of the PCR.
Returns:
0 on success, otherwise an SQLite error code.

int ServicePMTPIDSet ( Service_t service,
int  pmtpid 
)

Set the PMT PID for the given service.

Parameters:
service The service to update.
pmtpid The new PID of the PMT.
Returns:
0 on success, otherwise an SQLite error code.

int ServicePMTVersionSet ( Service_t service,
int  pmtversion 
)

Set the PMT version for the given service.

Parameters:
service The service to update.
pmtversion The version of the PMT to set.
Returns:
0 on success, otherwise an SQLite error code.

int ServiceProviderSet ( Service_t service,
char *  provider 
)

Set the service provider name for the given service.

Parameters:
service The service to update.
provider The new provider name of the service.
Returns:
0 on success, otherwise an SQLite error code.

ServiceEnumerator_t ServiceQueryNameLike ( char *  query  ) 

Retrieve an enumerator for the names that match the query string.

This function uses the SQL LIKE syntax for the query string.

Parameters:
query An SQL LIKE formated string of the name to search for.
Returns:
A service enumerator or NULL if there is not enough memory.

int ServiceSourceSet ( Service_t service,
int  source 
)

Set the service name for the given service.

Parameters:
service The service to update.
source The new source id of the service.
Returns:
0 on success, otherwise an SQLite error code.

int ServiceTypeSet ( Service_t service,
ServiceType  type 
)

Set the type of the specified service.

Parameters:
service The service to update.
type The new type of the service
Returns:
0 on success, otherwise an SQLite error code.


Generated on Thu Jun 26 12:58:32 2008 for DVBStreamer by  doxygen 1.5.5