DSMCC  17.9.0
 All Data Structures Files Functions Typedefs
dsiq.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2004 Ocean Blue Software Ltd
4  *
5  * This file is part of a DTVKit Software Component
6  * You are permitted to copy, modify or distribute this file subject to the terms
7  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
8  *
9  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
10  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
11  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
12  *
13  * If you or your organisation is not a member of DTVKit then you have access
14  * to this source code outside of the terms of the licence agreement
15  * and you are expected to delete this and any associated files immediately.
16  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
17  *******************************************************************************/
24 #ifndef _DSIQ_H_
25 #define _DSIQ_H_
26 
27 #include "cldsmtypes.h"
28 #include "dmxtypes.h"
29 #include "stdfuncs.h"
30 #include "siqfuncs.h"
31 #include "dsm_debug.h"
32 
33 #define UNKNOWN_AIT_TYPE 0x7FFF
34 #define UNKNOWN_AIT_VERS 0x7F
35 
36 typedef enum
37 {
38  SIQ_ERROR,
39  SIQ_IGNORE,
40  SIQ_UPDATE
41 } E_SIQ_STATUS;
42 
43 /*------------------- Functions supplied to SIQ at setup ---------------------*/
44 
57 typedef U32BIT (*F_DvpRequestTable)( void *ref, U16BIT pid, U16BIT xid, U8BIT tid );
58 
65 typedef void (*F_DvpCancelTable)( void *ref, U32BIT rid );
66 
67 
68 /*---------------- Setup structure for SIQ initialisation --------------------*/
69 
70 typedef struct
71 {
72  /* First five functions here are manditory */
73  F_MemAlloc memAlloc;
74  F_MemFree memFree;
75 
76  F_DvpRequestTable dvpRequestTable;
77  F_DvpCancelTable dvpCancelTable;
78  void *pmtref;
79 
80  F_PmtParseInit parsePmtInit;
81  F_ParseDataBcastId parseDataBroadcastId;
82  F_PmtParseDone parsePmtDone;
83 
84  F_ParseSsuSelectorBytes parseSsuSelectorBytes;
85 
86  /* notifyAitInfo is optional and may be set to NULL */
87  F_NotifyAitInfo notifyAitInfo;
88 
89  /* errPrintf and dbgPrintf functions are only used in a debug build.
90  * These are optional and may be set to NULL */
91  F_Printf errPrintf;
92  F_Printf dbgPrintf;
93 
94  /* dbgState controls type of debug output for dbgPrintf
95  * For valid debug filter states see above */
96  U32BIT dbgState;
97 } S_SiqSetup;
98 
99 
100 typedef struct s_SiqCachePat *H_SiqCachePat;
101 typedef struct s_SiqCachePmt *H_SiqCachePmt;
102 typedef struct s_SiqPmtTable *H_SiqPmtTable;
103 
104 /*----------------------- Functions that configure SIQ -----------------------*/
105 
112 
119 
128 void SIQ_SetDebugConfig( H_SiqInstance siq, F_Printf errPrintf,
129  F_Printf dbgPrintf, U32BIT dbgState );
130 
137 void SIQ_SetDebugState( H_SiqInstance siq, U32BIT dbgState );
138 
146 
147 
148 /*------------------ Functions that update SIQ from DVB ----------------------*/
149 
158 void SIQ_UpdatePat( H_SiqInstance siq, U8BIT *dptr );
159 
168 void SIQ_TransportChanged( H_SiqInstance siq, U16BIT origNetworkId, U16BIT transportId );
169 
180 E_SIQ_STATUS SIQ_RequirePmt( H_SiqInstance siq, U8BIT *pmt,
181  U16BIT *pSid, U8BIT *pVer );
182 
192 void SIQ_ServiceRemoved( H_SiqInstance siq, U16BIT serviceId );
193 
204 H_SiqPmtTable SIQ_ParsePmt( H_SiqInstance siq, U8BIT *pmt );
205 
219 void SIQ_ProcessPmt( H_SiqInstance siq, H_SiqPmtTable hNewTable,
220  U16BIT serviceId, U8BIT version );
221 
228 void SIQ_CacheClearPmt( H_SiqInstance siq, U16BIT serviceId );
229 
230 
231 /*----------------- Functions provided to DSM-CC component -------------------*/
232 
240  H_SIQueryRef clDsmSIQueryRef, void *clDsmSIUserData,
241  P_SIQueryResult pResult );
242 
250  void *queryHandle, H_SIQueryRef clDsmSIQueryRef );
251 
260 E_DscError SIQ_ServiceInfoChangeSubscribe( H_SiqInstance siq, U16BIT serviceId );
261 
270 void SIQ_ServiceInfoChangeUnsubscribe( H_SiqInstance siq, U16BIT serviceId );
271 
272 #endif /*_DSIQ_H_*/
273 
void SIQ_ServiceRemoved(H_SiqInstance siq, U16BIT serviceId)
Inform SIQ when a service has been removed from PAT. Not required if PAT is supplied to SIQ...
Definition: siq_cache.c:409
void SIQ_ServiceInfoChangeUnsubscribe(H_SiqInstance siq, U16BIT serviceId)
Unsubscribe component to previously subscribed service change or alteration updates. Called by DSM-CC component, and given in clDsmSysCreate setup.
void SIQ_RequestQueryStop(H_SiqInstance siq, void *queryHandle, H_SIQueryRef clDsmSIQueryRef)
Stop DSM-CC query request. Called by DSM-CC component, and given in clDsmSysCreate setup...
BOOLEAN(* F_ParseSsuSelectorBytes)(U8BIT *selPtr, U8BIT selLen)
Parse "Selector Bytes" contained in "System Software Update Info" of PMT's data broadcast Id decr...
Definition: siqfuncs.h:80
H_SiqInstance SIQ_CreateInstance(S_SiqSetup *pSetup)
Create SIQ instance.
Definition: siq_main.c:67
DSM-CC API functions to control DSM-CC instance.
void SIQ_TransportChanged(H_SiqInstance siq, U16BIT origNetworkId, U16BIT transportId)
Inform SIQ when tuning to another transport stream. Not required if PAT is supplied to SIQ...
Definition: siq_cache.c:391
Define Demux types use in section filter API.
U32BIT(* F_ParseDataBcastId)(H_PmtRef pmtref, U32BIT carouselId, U8BIT *dbcPtr, U8BIT dbcLen)
Parse data broadcast id descriptor for recognised application(s) SIQ wants to know whether this PMT s...
Definition: siqfuncs.h:58
DSM-CC global types header Used by SI Query and Section Filter code.
H_PmtRef(* F_PmtParseInit)(U16BIT serviceId)
Inform the DSM-CC client that parsing of PMT data is about to start The return value is passed to sub...
Definition: siqfuncs.h:37
void SIQ_SetDebugConfig(H_SiqInstance siq, F_Printf errPrintf, F_Printf dbgPrintf, U32BIT dbgState)
Set Debug config for SIQ.
Definition: siq_main.c:126
void SIQ_ProcessPmt(H_SiqInstance siq, H_SiqPmtTable hNewTable, U16BIT serviceId, U8BIT version)
Provide PMT section data to SIQ. It assumes CRC has been checked and is passing valid PMT sections So...
Definition: siq_cache.c:509
void SIQ_SetDebugState(H_SiqInstance siq, U32BIT dbgState)
Set Debug state for SIQ.
Definition: siq_main.c:141
void(* F_NotifyAitInfo)(U16BIT serviceId, U16BIT appType, U16BIT pid, U8BIT version)
Callback to inform of first or changed AIT info in PMT.
Definition: siqfuncs.h:90
H_SiqPmtTable SIQ_ParsePmt(H_SiqInstance siq, U8BIT *pmt)
Provide PMT section data to SIQ. It assumes CRC has been checked and is passing valid PMT sections So...
Definition: siq_cache.c:494
void SIQ_CacheClearPmt(H_SiqInstance siq, U16BIT serviceId)
Clear cached PMT information.
Definition: siq_cache.c:595
void(* F_PmtParseDone)(H_PmtRef pmtref)
Inform the DSM-CC client that parsing of PMT data has completed.
Definition: siqfuncs.h:67
void SIQ_DestroyInstance(H_SiqInstance siq)
Destroy instance created by SIQ_CreateInstance.
Definition: siq_main.c:152
void SIQ_UpdatePat(H_SiqInstance siq, U8BIT *dptr)
Provide SIQ with latest PAT data. Calling this function is optional. However, if not used...
Definition: siq_cache.c:301
E_DscError SIQ_ServiceInfoChangeSubscribe(H_SiqInstance siq, U16BIT serviceId)
Subscribe a component to receive notification of any changes or alterations to the service informatio...
void SIQ_SetDsmInstance(H_SiqInstance siq, H_DsmCoreInst dsm)
Set instance handle for DSM-CC that SIQ is supporting.
Definition: siq_main.c:176
Service Information Query: external function prototypes.
E_SIQ_STATUS SIQ_RequirePmt(H_SiqInstance siq, U8BIT *pmt, U16BIT *pSid, U8BIT *pVer)
Ask SIQ whether PMT section data is required. It assumes CRC has been checked and is passing valid PM...
Definition: siq_cache.c:433
U32BIT(* F_DvpRequestTable)(void *ref, U16BIT pid, U16BIT xid, U8BIT tid)
SIQ requests table data - normally PMT, but could be UNT. Table data should be given to appropriate f...
Definition: dsiq.h:57
Define standard function types.
void(* F_DvpCancelTable)(void *ref, U32BIT rid)
Cancel request for Table data made by F_DvpRequestTable()
Definition: dsiq.h:65
E_DscError SIQ_RequestQueryStart(H_SiqInstance siq, P_SIQueryRequest pQuery, H_SIQueryRef clDsmSIQueryRef, void *clDsmSIUserData, P_SIQueryResult pResult)
Start DSM-CC query request. Called by DSM-CC component, and given in clDsmSysCreate setup...