DSMCC_24
module.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  * Copyright © 2001 Koninklijke Philips Electronics N.V
5  *
6  * This file is part of a DTVKit Software Component
7  * You are permitted to copy, modify or distribute this file subject to the terms
8  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
9  *
10  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
11  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
12  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
13  *
14  * If you or your organisation is not a member of DTVKit then you have access
15  * to this source code outside of the terms of the licence agreement
16  * and you are expected to delete this and any associated files immediately.
17  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
18  *******************************************************************************/
26 #ifndef _MODULE_H_
27 #define _MODULE_H_
28 
29 
30 /*-------------------------------- Includes --------------------------------*/
31 #include "clDsmSystem.h"
32 
33 #include "linkList.h"
34 #include "sectionFilter.h"
35 #include "defMemUtilsMgd.h" /* -- Default mem type for module */
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 
42 /*----------------------------- Exported Macros ----------------------------*/
43 
44 
45 /*------------------------------ Exported Types ----------------------------*/
46 
47 typedef struct s_ModuleBuilder *P_ModuleBuilder;
48 
49 typedef enum
50 {
51  MS_INITIAL, /* -- transient state */
52  MS_PENDING_INFO, /* -- waiting for DII info */
53  MS_PENDING_DDB, /* -- DII info available, waiting for first DDB */
54  MS_BUILDING, /* -- first DDB received */
55  MS_CACHED, /* -- module complete (compressed or decompressed) */
56  MS_ACQ_FAILED, /* -- acquisition failed due to decompress failure
57  -- (transient state)*/
58  MS_ACQ_ABORTED, /* -- acquisition aborted due to multiple decompress
59  -- failures */
60  MS_EXPIRED /* -- module stale (out of date) but still in use (ie.
61  -- has loaded object(s)) */
62 } E_ModuleStatus;
63 
64 
65 /* -- MHEG, MHP and HBBTV profile */
66 typedef struct
67 {
68  U32BIT moduleTimeout;
69  U32BIT blockTimeout;
70  U32BIT minBlockTime;
71  U16BIT tapBiopId;
72  U8BIT priority;
73  U8BIT transparency;
74 } S_MHGProfile;
75 
76 /* -- SSU profile */
77 typedef struct
78 {
79  U32BIT moduleCrc;
80  U32BIT offset;
81  U32BIT infoLang;
82  U16BIT nextModuleId;
83  U8BIT positionType; /* for values see E_PostionType */
84  U8BIT moduleType; /* for values see E_ModuleType */
85  U8BIT typeLen;
86  U8BIT nameLen;
87  U8BIT infoLen;
88  MemPtr mpType;
89  MemPtr mpName;
90  MemPtr mpInfo;
91 } S_SSUProfile;
92 
93 typedef struct
94 {
95  U16BIT moduleId;
96  U16BIT blockSize;
97  U16BIT crslMagic;
98  U16BIT associationTag;
99  U8BIT version;
100  U8BIT reserved;
101  BOOLEAN compressed;
102  BOOLEAN zipped;
103 #ifndef NDEBUG
104  U32BIT blkRcvd;
105 #endif
106  U32BIT moduleSize;
107  U32BIT originalSize;
108  union {
109  S_MHGProfile mhgp;
110  S_SSUProfile ssup;
111  } u;
113 
114 
115 typedef struct s_Module
116 {
117  S_LLObject llData[NUM_LISTS_MODULE];
118  S_ModuleInfo moduleInfo;
119  E_ModuleStatus status;
120 
121  /* -- DDB filter info */
122  P_SecFilterInfo pDdbSf;
123 
124  U32BIT cachedTime;
125 
126  U16BIT currentUseCount; /* -- Limited by design */
127  U16BIT decompressFailureCount; /* -- Limited by MAX_MODULE_DECOMPRESS_FAILURES */
128 
129  U16BIT loadedCount; /* -- Limited only by memory */
130  U16BIT highPriorityCount; /* -- Limited only by memory */
131  U16BIT directPriorityCount; /* -- Limited only by memory */
132 
133  /* -- NB. Module inherits 'highest priority' caching rules of
134  -- any object loaded from the module */
135  E_CacheRules cachingRules;
136 
137  P_ModuleBuilder pModuleBuilder;
138  P_ModuleData hCompModuleData;
139  P_ModuleData hModuleData;
140 
141  P_RootLoadRqst pLoadRqst;
142  P_LLControl llcLoadRequests;
143 } S_Module;
144 
145 
146 /*------------------------------ Exported Data -----------------------------*/
147 
148 
149 /*--------------------------- Exported Prototypes --------------------------*/
150 
151 E_DscError DSC_ModuleCreate( P_DsmCoreInst idp,
152  U16BIT moduleId, P_Module *ppModule );
153 
154 void DSC_ModuleDestroy( P_DsmCoreInst idp, P_Module pModule );
155 
156 void DSC_ModuleUse( P_DsmCoreInst idp, P_Module pModule );
157 
158 void DSC_ModuleUnUse( P_DsmCoreInst idp, P_Module pModule );
159 
160 E_DscError DSC_ModuleAcquireStart( P_DsmCoreInst idp,
161  P_Module pModule, E_SFPriority sfPriority );
162 
163 void DSC_ModuleAcquireStop( P_DsmCoreInst idp, P_Module pModule );
164 
168 void DSC_ModuleDelete( P_DsmCoreInst idp, P_Module pModule );
169 
173 void DSC_ModuleDeleteDcTidyUp( P_DsmCoreInst idp, P_Module pModule );
174 
175 void DSC_ModuleResetState( P_DsmCoreInst idp,
176  P_Module pModule, E_ModuleStatus reqdState );
177 
178 E_DscError DSC_ModuleDecompress( P_DsmCoreInst idp, P_Module pModule );
179 
180 E_DscError DSC_ModuleDataRefresh( P_DsmCoreInst idp, P_Module pModule );
181 
182 E_DscError DSC_ModuleUpdate( P_DsmCoreInst idp,
183  P_Module pModule, U8BIT *pDDBMsgPayload, U16BIT ddbMsgPayloadLen );
184 
185 /* Generic module list functions */
186 P_Module DSC_ModuleListFindById( P_LLControl pModuleList, U16BIT moduleId );
187 
188 E_SFPriority DSC_ModulePriority( P_Module pModule );
189 
190 E_DscError DSC_ModuleAddLoadRequest( P_DsmCoreInst idp, P_Module pModule, H_Object hLoadRqst );
191 
192 BOOLEAN DSC_ModuleRemoveLoadRequest( P_DsmCoreInst idp, H_Object hLoadRqst );
193 
194 void DSC_ModuleAbortLoadRequests( P_DsmCoreInst idp, P_Module pModule );
195 
196 E_DscError DSC_ModuleAcquireRestart( P_DsmCoreInst idp, P_Module pModule );
197 
198 /*----------------------------------------------------------------------------*/
199 #ifdef __cplusplus
200 }
201 #endif
202 #endif /* _MODULE_H_ */
General include file for clDsm library internal definitions.
Defines memory access utils to work with managed (MemMgr) memory.
E_DscError DSC_ModuleAcquireStart(P_DsmCoreInst idp, P_Module pModule, E_SFPriority sfPriority)
Start aquisition of module.
Definition: module.c:215
E_DscError DSC_ModuleAcquireRestart(P_DsmCoreInst idp, P_Module pModule)
Restart aquisition of module.
Definition: module.c:263
void DSC_ModuleDeleteDcTidyUp(P_DsmCoreInst idp, P_Module pModule)
Delete module and destroy parent DC if now empty.
Definition: module.c:399
void DSC_ModuleDelete(P_DsmCoreInst idp, P_Module pModule)
Destroy the module and destroy parent DC if now empty.
Definition: module.c:314
void DSC_ModuleAcquireStop(P_DsmCoreInst idp, P_Module pModule)
Stop aquisition of module.
Definition: module.c:299
Header to the sectionFilter module.
Definition: module.h:67
Definition: module.h:94
Definition: module.h:78
Definition: clDsmSystem.h:532
Definition: linkList.h:56
Definition: linkList.h:48
Definition: module.c:47
Definition: moduleData.c:43
Definition: module.h:116
Definition: loadRqst.h:72
Definition: sectionFilter.h:90