![]() |
DVBCore
22.3.0
Open Source DVB Engine
|
Application level SI task. More...
#include <stdio.h>
#include <string.h>
#include "techtype.h"
#include "dbgfuncs.h"
#include "stbhwos.h"
#include "stbhwtun.h"
#include "stbhwav.h"
#include "stbheap.h"
#include "stberc.h"
#include "stbgc.h"
#include "stbdpc.h"
#include "stbsiflt.h"
#include "stbsitab.h"
#include "stbllist.h"
#include "stbdsapi.h"
#include "stbuni.h"
#include "media_image.h"
#include "app.h"
#include "ap_cfg.h"
#include "ap_cfdat.h"
#include "ap_dbacc.h"
#include "ap_tmr.h"
#include "ap_dbdef.h"
#include "ap_cntrl.h"
#include "ap_si.h"
#include "ap_pvr.h"
#include "app_nvm.h"
#include "ca_glue.h"
#include "ap_ca.h"
#include "dba.h"
Classes | |
struct | pmt_list_entry |
struct | eit_list_entry |
struct | s_si_event_data |
struct | S_IDS |
struct | S_ACTIVE_BOUQUET |
struct | s_dynamic_update_service |
struct | s_dynamic_update_transport |
struct | S_DATABASE_UPDATES_ALLOWED |
Typedefs | |
typedef struct pmt_list_entry | PMT_LIST_ENTRY |
typedef struct eit_list_entry | EIT_LIST_ENTRY |
typedef struct s_si_event_data | S_SI_EVENT_DATA |
typedef struct s_dynamic_update_service | S_DYNAMIC_UPDATE_SERVICE |
typedef struct s_dynamic_update_transport | S_DYNAMIC_UPDATE_TRANSPORT |
Enumerations | |
enum | E_DB_ACCESS_MODE { DB_ACCESS_UPDATE, DB_ACCESS_SEARCH, DB_ACCESS_PLAYBACK } |
enum | E_PMT_REQUEST_MODE { PMT_REQUEST_CURRENT, PMT_REQUEST_MONITOR, PMT_REQUEST_PRIORITY } |
Functions | |
void | ASI_InitialiseAppSi (void) |
Initialises application SI handling. | |
void | ASI_SetAppSiMode (U8BIT path, E_APP_SI_MODE si_mode) |
Sets application SI mode - used before STB_DPStartSI() is called. More... | |
BOOLEAN | ASI_CheckServiceListReadyDuringSearch (U8BIT path) |
Reports the state of the service_list_ready flag which is set when the sdt has been processed in a search. More... | |
U16BIT | ASI_GetPmtPid (U16BIT serv_id, U16BIT ts_id, U16BIT on_id) |
Returns the PID for the pmt of a given service (on live path) More... | |
void | ASI_StopPmtReporting (U8BIT path) |
Prevents the current pmt being reported (e.g. to MHEG). | |
BOOLEAN | ASI_PmtReported (U8BIT path) |
Returns TRUE if pmt has been reported to third parties. More... | |
void | ASI_SetStandbyState (BOOLEAN standby_state) |
Performs the neccessary actions for this module when entering/exiting standby according to the value passed in standby_state. More... | |
void * | ASI_GetNextOTALocation (void *network, void *prev_location, U16BIT *onid_ptr, U16BIT *tid_ptr, U16BIT *sid_ptr) |
Returns the DVB triplet for the next location containing a possible OTA update. More... | |
BOOLEAN | ASI_SSURefused (void) |
Returns the flag indicating whether the SSU was refused. More... | |
void | ASI_RefuseSSU (BOOLEAN refuse) |
Sets the flag indicating whether the SSU has been refused or not. More... | |
void | ASI_SSUSetMandatory (BOOLEAN mandatory) |
Sets the flag indicating whether the SSU can be refused by the user. More... | |
BOOLEAN | ASI_SSUGetMandatory (void) |
Returns the flag indicating whether the SSU is mandatory and so can't be refused. More... | |
BOOLEAN | ASI_CheckForServiceChange (E_STB_DP_SIGNAL_TYPE tuner_type) |
Checks whether the NIT or SDT version numbers have changed, which may indicate a change to the service lineup requiring an update service scan. More... | |
void | ASI_RestartCatFilter (U8BIT path) |
Forces the SI demux filter collecting the CAT tables to be reset, so a previously processed version of the table won't be ignored. More... | |
void | ASI_RestartNitFilter (U8BIT path) |
Forces the SI demux filter collecting the NIT tables to be reset, so a previously processed version of the table won't be ignored. More... | |
void | ASI_RestartSdtFilter (U8BIT path) |
Forces the SI demux filter collecting the SDT tables to be reset, so a previously processed versions of the tables won't be ignored. More... | |
void | ASI_RestartBatFilter (U8BIT path) |
Forces the SI demux filter collecting the BAT tables to be reset, so a previously processed versions of the tables won't be ignored. More... | |
void | ASI_RestartTotFilter (U8BIT path) |
Forces the SI demux filter collecting the TOT tables to be reset, so a previously processed versions of the tables won't be ignored. More... | |
void | ASI_RestartTdtFilter (U8BIT path) |
Forces the SI demux filter collecting the TDT tables to be reset, so a previously processed versions of the tables won't be ignored. More... | |
void | ASI_SetSearchServiceType (E_SEARCH_SERVICE_TYPE service_type) |
Set the type for services that should be added during a service search. More... | |
void | ASI_AddServiceToPmtList (U16BIT service_id) |
Add the given service id to the list of services whose PMT will be requested with a higher priority than others. More... | |
void | ASI_RemoveServiceFromPmtList (U16BIT service_id) |
Removes the service id from the PMT priority list. More... | |
void | ASI_ClearPmtList (void) |
Clears all service ids from the PMT priority list. | |
void | ASI_ProcessPmt (U8BIT path, void *s_ptr, U8BIT *pmt_data) |
Takes data for a raw PMT for the given service and processes it as if it had been received from the demux, also passing it to anything monitoring PMTs and CI+. More... | |
void | ASI_SetEITScheduleLimit (U16BIT limit_hours) |
Sets the number of hours of EIT data that's kept for each service that hasn't its had EIT schedule disabled. More... | |
U16BIT | ASI_GetEITScheduleLimit (void) |
Returns the current setting for the number of hours of EIT data that's kept. More... | |
void | ASI_EnableBatCollection (BOOLEAN use_bats, U16BIT *bouquet_ids, U16BIT num_ids) |
Enables or disables the collection of BATs as part of the SI processing and allows the bouquet IDs of the BATs to be collected to be specified. More... | |
void | ASI_RestartSITables (U8BIT path, BOOLEAN use_standard_pids) |
Cancels any existing SI filters and starts a new one for the SDT, TDT, TOT, NIT, EIT (pf, pf++ and sched) and BAT SI tables. More... | |
void | ASI_SetEITParserFunction (F_EitParser parser_func) |
Sets a function that will be called when parsing an EIT table and a descriptor is found that the standard code doesn't know how to parse. More... | |
void | ASI_SetUpdateBatFunction (F_BatTableUpdate update_func) |
Sets a function that will be called when a BAT table is received. More... | |
void | ASI_SetUpdateEitFunction (F_EitTableUpdate update_func) |
Sets a function that will be called when an EIT table is received. More... | |
void | ASI_SetUpdateNitFunction (F_NitTableUpdate update_func) |
Sets a function that will be called when an NIT table is received. More... | |
void | ASI_SetUpdatePmtFunction (F_PmtTableUpdate update_func) |
Sets a function that will be called when a PMT table is received. More... | |
void | ASI_SetUpdateSdtFunction (F_SdtTableUpdate update_func) |
Sets a function that will be called when an SDT table is received. More... | |
void | ASI_ProcessEitTable (SI_TABLE_RECORD *table_rec, BOOLEAN playback) |
Processes an EIT table, partial or full, and updates the events of the service it is for. More... | |
void | ASI_ProcessTotTable (SI_TABLE_RECORD *table_rec) |
Processes the TOT table record to extract data for the database. More... | |
void | ASI_ProcessTdtTable (SI_TABLE_RECORD *table_rec) |
Processes the TDT table record to extract data for the database. More... | |
void | ASI_RegisterEitSchedUpdateCallback (F_EitSchedUpdateCB sched_update_callback) |
Registers a function that will be called whenever an EIT event is added, updated, deleted or expires from a service's EIT schedule. The registered function should return control as soon as possible, otherwise processing of other EIT events will be affected. More... | |
void | ASI_NotifyEitSchedUpdate (void *serv_ptr, U16BIT event_id, E_APP_SI_EIT_JOURNAL_TYPE type) |
Calls the EIT schedule update callback function, if one has been registered, with details of the service and event. More... | |
void | ASI_SetActiveNetworkId (U16BIT network_id) |
Sets the network ID to be used for all future requests to get an NIT. If this value isn't set, the default behaviour is to request the NITactual, but when this value is set then the NIT received could be NITactual or NITother. To clear this setting this function should be called with a network ID of 0. More... | |
void | ASI_AllowDatabaseUpdates (E_STB_DP_SIGNAL_TYPE signal_type, BOOLEAN allow) |
Sets whether updates should be allowed to the service database from standard SI tables that are received when the SI engine is running in UPDATE mode. The default setting is for updates to be allowed and this setting doesn't persist across power cycles so needs to be explicitly set if updates shouldn't be allowed. If updates aren't allowed then this will prevent dynamic service additions, deletions and moves from being performed, even if these have been enabled, but it doesn't affect updates to the database when some form of search is being performed, such as a service search. This setting is used when the SDT, NIT and BAT tables are received. More... | |
BOOLEAN | ASI_DatabaseUpdatesAllowed (E_STB_DP_SIGNAL_TYPE signal_type) |
Returns whether service database updates are allowed for the given signal type. More... | |
Application level SI task.
void ASI_AddServiceToPmtList | ( | U16BIT | service_id | ) |
Add the given service id to the list of services whose PMT will be requested with a higher priority than others.
service_id | service id to be added to the list |
void ASI_AllowDatabaseUpdates | ( | E_STB_DP_SIGNAL_TYPE | signal_type, |
BOOLEAN | allow | ||
) |
Sets whether updates should be allowed to the service database from standard SI tables that are received when the SI engine is running in UPDATE mode. The default setting is for updates to be allowed and this setting doesn't persist across power cycles so needs to be explicitly set if updates shouldn't be allowed. If updates aren't allowed then this will prevent dynamic service additions, deletions and moves from being performed, even if these have been enabled, but it doesn't affect updates to the database when some form of search is being performed, such as a service search. This setting is used when the SDT, NIT and BAT tables are received.
signal_type | specifies the signal type that the setting will apply to. If this value is given as SIGNAL_NONE, then the given flag will be applied to all signal types (DVB-T, DVB-C and DVB-S). |
allow | flag that defines whether service database updates should be allowed or not |
BOOLEAN ASI_CheckForServiceChange | ( | E_STB_DP_SIGNAL_TYPE | tuner_type | ) |
Checks whether the NIT or SDT version numbers have changed, which may indicate a change to the service lineup requiring an update service scan.
tuner_type | check all networks and transports for this tuner type, or use SIGNAL_NONE to check all networks and transports |
BOOLEAN ASI_CheckServiceListReadyDuringSearch | ( | U8BIT | path | ) |
Reports the state of the service_list_ready flag which is set when the sdt has been processed in a search.
U8BIT | path |
BOOLEAN ASI_DatabaseUpdatesAllowed | ( | E_STB_DP_SIGNAL_TYPE | signal_type | ) |
Returns whether service database updates are allowed for the given signal type.
signal_type | signal type being queried |
void ASI_EnableBatCollection | ( | BOOLEAN | use_bats, |
U16BIT * | bouquet_ids, | ||
U16BIT | num_ids | ||
) |
Enables or disables the collection of BATs as part of the SI processing and allows the bouquet IDs of the BATs to be collected to be specified.
use_bats | TRUE to enable the collection and processing of BATs, FALSE to disable |
bouquet_ids | an array of the bouquet IDs that are to be used. If this is NULL then all BATs will be used. |
num_ids | number of bouquet IDs in the array |
U16BIT ASI_GetEITScheduleLimit | ( | void | ) |
Returns the current setting for the number of hours of EIT data that's kept.
void* ASI_GetNextOTALocation | ( | void * | network, |
void * | prev_location, | ||
U16BIT * | onid_ptr, | ||
U16BIT * | tid_ptr, | ||
U16BIT * | sid_ptr | ||
) |
Returns the DVB triplet for the next location containing a possible OTA update.
network | network on which the OTA search is being made |
prev_location | if this is NULL then info from the first OTA location on the network will be returned, otherwise it should be the value returned when this function was last called so the next possible OTA location will be returned |
onid_ptr | pointer to return the value of the original network ID for the possible OTA |
tdi_ptr | pointer to return the value of the transport ID for the possible OTA |
sid_ptr | pointer to return the value of the service ID for the possible OTA |
U16BIT ASI_GetPmtPid | ( | U16BIT | serv_id, |
U16BIT | ts_id, | ||
U16BIT | on_id | ||
) |
Returns the PID for the pmt of a given service (on live path)
service_id | provides the required service ID |
ts_id | provides the required transport stream ID |
on_id | provides the required original network ID |
void ASI_NotifyEitSchedUpdate | ( | void * | serv_ptr, |
U16BIT | event_id, | ||
E_APP_SI_EIT_JOURNAL_TYPE | type | ||
) |
Calls the EIT schedule update callback function, if one has been registered, with details of the service and event.
serv_ptr | service whose EIT schedule has changed |
event_id | ID of the event that's been added, updated, deleted or expired |
type | type of the change. For APP_SI_EIT_JOURNAL_TYPE_CLEAR, the event_id is irrelevant |
BOOLEAN ASI_PmtReported | ( | U8BIT | path | ) |
Returns TRUE if pmt has been reported to third parties.
path | decode path |
void ASI_ProcessEitTable | ( | SI_TABLE_RECORD * | table_rec, |
BOOLEAN | playback | ||
) |
Processes an EIT table, partial or full, and updates the events of the service it is for.
table_rec | SI table record containing the EIT data |
playback | TRUE if the EIT is related to PVR playback |
void ASI_ProcessPmt | ( | U8BIT | path, |
void * | s_ptr, | ||
U8BIT * | pmt_data | ||
) |
Takes data for a raw PMT for the given service and processes it as if it had been received from the demux, also passing it to anything monitoring PMTs and CI+.
path | decode path |
s_ptr | service to be updated with info extracted from the PMT |
pmt_data | raw PMT data |
void ASI_ProcessTdtTable | ( | SI_TABLE_RECORD * | table_rec | ) |
Processes the TDT table record to extract data for the database.
table_rec | pointer to the pat table record |
void ASI_ProcessTotTable | ( | SI_TABLE_RECORD * | table_rec | ) |
Processes the TOT table record to extract data for the database.
table_rec | pointer to the pat table record |
void ASI_RefuseSSU | ( | BOOLEAN | refuse | ) |
Sets the flag indicating whether the SSU has been refused or not.
refuse | TRUE to refuse the SSU, FALSE to accept |
void ASI_RegisterEitSchedUpdateCallback | ( | F_EitSchedUpdateCB | sched_update_callback | ) |
Registers a function that will be called whenever an EIT event is added, updated, deleted or expires from a service's EIT schedule. The registered function should return control as soon as possible, otherwise processing of other EIT events will be affected.
sched_update_callback | function to be called |
void ASI_RemoveServiceFromPmtList | ( | U16BIT | service_id | ) |
Removes the service id from the PMT priority list.
service_id | service id to be removed |
void ASI_RestartBatFilter | ( | U8BIT | path | ) |
Forces the SI demux filter collecting the BAT tables to be reset, so a previously processed versions of the tables won't be ignored.
path | - decode path that will be affected |
void ASI_RestartCatFilter | ( | U8BIT | path | ) |
Forces the SI demux filter collecting the CAT tables to be reset, so a previously processed version of the table won't be ignored.
path | - decode path that will be affected |
void ASI_RestartNitFilter | ( | U8BIT | path | ) |
Forces the SI demux filter collecting the NIT tables to be reset, so a previously processed version of the table won't be ignored.
path | - decode path that will be affected |
void ASI_RestartSdtFilter | ( | U8BIT | path | ) |
Forces the SI demux filter collecting the SDT tables to be reset, so a previously processed versions of the tables won't be ignored.
path | - decode path that will be affected |
void ASI_RestartSITables | ( | U8BIT | path, |
BOOLEAN | use_standard_pids | ||
) |
Cancels any existing SI filters and starts a new one for the SDT, TDT, TOT, NIT, EIT (pf, pf++ and sched) and BAT SI tables.
path | decode path the filters are using |
use_standard_pids | TRUE if SI tables on the DVB standard PIDs are to be collected, FALSE will only start a filter if a PID is defined for that table on the current service. |
void ASI_RestartTdtFilter | ( | U8BIT | path | ) |
Forces the SI demux filter collecting the TDT tables to be reset, so a previously processed versions of the tables won't be ignored.
path | - decode path that will be affected |
void ASI_RestartTotFilter | ( | U8BIT | path | ) |
Forces the SI demux filter collecting the TOT tables to be reset, so a previously processed versions of the tables won't be ignored.
path | - decode path that will be affected |
void ASI_SetActiveNetworkId | ( | U16BIT | network_id | ) |
Sets the network ID to be used for all future requests to get an NIT. If this value isn't set, the default behaviour is to request the NITactual, but when this value is set then the NIT received could be NITactual or NITother. To clear this setting this function should be called with a network ID of 0.
network_id | network ID of the NIT to be requested, or 0 to use NITactual |
void ASI_SetAppSiMode | ( | U8BIT | path, |
E_APP_SI_MODE | si_mode | ||
) |
Sets application SI mode - used before STB_DPStartSI() is called.
path | decode path |
si_mode | required mode |
void ASI_SetEITParserFunction | ( | F_EitParser | parser_func | ) |
Sets a function that will be called when parsing an EIT table and a descriptor is found that the standard code doesn't know how to parse.
parser_func | function pointer |
void ASI_SetEITScheduleLimit | ( | U16BIT | limit_hours | ) |
Sets the number of hours of EIT data that's kept for each service that hasn't its had EIT schedule disabled.
limit_hours | number of hours to EIT data to be kept. 0 turns this feature off and all data will be kept. |
void ASI_SetSearchServiceType | ( | E_SEARCH_SERVICE_TYPE | service_type | ) |
Set the type for services that should be added during a service search.
service_type | all, free-to-air, or scrambled |
void ASI_SetStandbyState | ( | BOOLEAN | standby_state | ) |
Performs the neccessary actions for this module when entering/exiting standby according to the value passed in standby_state.
standby_state | if set TRUE indicates that the STB is entering standby mode and if set FALSE indicates shat the STB is exiting from standby mode. |
void ASI_SetUpdateBatFunction | ( | F_BatTableUpdate | update_func | ) |
Sets a function that will be called when a BAT table is received.
update_func | function pointer |
void ASI_SetUpdateEitFunction | ( | F_EitTableUpdate | update_func | ) |
Sets a function that will be called when an EIT table is received.
update_func | function pointer |
void ASI_SetUpdateNitFunction | ( | F_NitTableUpdate | update_func | ) |
Sets a function that will be called when an NIT table is received.
update_func | function pointer |
void ASI_SetUpdatePmtFunction | ( | F_PmtTableUpdate | update_func | ) |
Sets a function that will be called when a PMT table is received.
update_func | function pointer |
void ASI_SetUpdateSdtFunction | ( | F_SdtTableUpdate | update_func | ) |
Sets a function that will be called when an SDT table is received.
update_func | function pointer |
BOOLEAN ASI_SSUGetMandatory | ( | void | ) |
Returns the flag indicating whether the SSU is mandatory and so can't be refused.
BOOLEAN ASI_SSURefused | ( | void | ) |
Returns the flag indicating whether the SSU was refused.
void ASI_SSUSetMandatory | ( | BOOLEAN | mandatory | ) |
Sets the flag indicating whether the SSU can be refused by the user.
mandatory | TRUE if the SSU can't be refused by the user, FALSE otherwise |