DSMCC  17.9.0
 All Data Structures Files Functions Typedefs
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 /* -- NB. This is only here to allow debug checking of size from clDsmMain */
48 typedef struct
49 {
50  U16BIT numBlocks;
51  U16BIT blocksRqd;
52  U32BIT downloadSize;
53  U16BIT blockSize;
54  U8BIT blockRcvdRegister[(MAX_BLOCKS_IN_MODULE + 7) / 8]; /* -- round up */
55  P_ModuleData hModuleData;
57 
58 
59 typedef enum
60 {
61  MS_INITIAL, /* -- transient state */
62  MS_PENDING_INFO, /* -- waiting for DII info */
63  MS_PENDING_DDB, /* -- DII info available, waiting for first DDB */
64  MS_BUILDING, /* -- first DDB received */
65  MS_CACHED, /* -- module complete (compressed or decompressed) */
66  MS_ACQ_FAILED, /* -- acquisition failed due to decompress failure
67  -- (transient state)*/
68  MS_ACQ_ABORTED, /* -- acquisition aborted due to multiple decompress
69  -- failures */
70  MS_EXPIRED /* -- module stale (out of date) but still in use (ie.
71  -- has loaded object(s)) */
72 } E_ModuleStatus;
73 
74 
75 /* -- MHEG, MHP and HBBTV profile */
76 typedef struct
77 {
78  U32BIT moduleTimeout;
79  U32BIT blockTimeout;
80  U32BIT minBlockTime;
81  U16BIT tapBiopId;
82  U8BIT priority;
83  U8BIT transparency;
84 } S_MHGProfile;
85 
86 /* -- SSU profile */
87 typedef struct
88 {
89  U32BIT moduleCrc;
90  U32BIT offset;
91  U32BIT infoLang;
92  U16BIT nextModuleId;
93  U8BIT positionType; /* for values see E_PostionType */
94  U8BIT moduleType; /* for values see E_ModuleType */
95  U8BIT typeLen;
96  U8BIT nameLen;
97  U8BIT infoLen;
98  MemPtr mpType;
99  MemPtr mpName;
100  MemPtr mpInfo;
101 } S_SSUProfile;
102 
103 typedef struct
104 {
105  U16BIT moduleId;
106  U16BIT blockSize;
107  U16BIT crslMagic;
108  U16BIT associationTag;
109  U8BIT version;
110  U8BIT reserved;
111  BOOLEAN compressed;
112 #ifndef NDEBUG
113  U32BIT blkRcvd;
114 #endif
115  U32BIT moduleSize;
116  U32BIT originalSize;
117  union {
118  S_MHGProfile mhgp;
119  S_SSUProfile ssup;
120  } u;
122 
123 
124 typedef struct s_Module
125 {
126  S_LLObject llData[NUM_LISTS_MODULE];
127  S_ModuleInfo moduleInfo;
128  E_ModuleStatus status;
129 
130  /* -- DDB filter info */
131  P_SecFilterInfo pDdbSf;
132 
133  U32BIT cachedTime;
134 
135  U16BIT currentUseCount; /* -- Limited by design */
136  U16BIT decompressFailureCount; /* -- Limited by MAX_MODULE_DECOMPRESS_FAILURES */
137 
138  U16BIT loadedCount; /* -- Limited only by memory */
139  U16BIT highPriorityCount; /* -- Limited only by memory */
140  U16BIT directPriorityCount; /* -- Limited only by memory */
141 
142  /* -- NB. Module inherits 'highest priority' caching rules of
143  -- any object loaded from the module */
144  E_CacheRules cachingRules;
145 
146  P_ModuleBuilder pModuleBuilder;
147  P_ModuleData hCompModuleData;
148  P_ModuleData hModuleData;
149 
150  P_RootLoadRqst pLoadRqst;
151  P_LLControl llcLoadRequests;
152 } S_Module;
153 
154 
155 /*------------------------------ Exported Data -----------------------------*/
156 
157 
158 /*--------------------------- Exported Prototypes --------------------------*/
159 
160 E_DscError DSC_ModuleCreate( P_DsmCoreInst idp,
161  U16BIT moduleId, P_Module *ppModule );
162 
163 void DSC_ModuleDestroy( P_DsmCoreInst idp, P_Module pModule );
164 
165 void DSC_ModuleUse( P_DsmCoreInst idp, P_Module pModule );
166 
167 void DSC_ModuleUnUse( P_DsmCoreInst idp, P_Module pModule );
168 
169 E_DscError DSC_ModuleAcquireStart( P_DsmCoreInst idp,
170  P_Module pModule, E_SFPriority sfPriority );
171 
172 void DSC_ModuleAcquireStop( P_DsmCoreInst idp, P_Module pModule );
173 
177 void DSC_ModuleDelete( P_DsmCoreInst idp, P_Module pModule );
178 
182 void DSC_ModuleDeleteDcTidyUp( P_DsmCoreInst idp, P_Module pModule );
183 
184 void DSC_ModuleResetState( P_DsmCoreInst idp,
185  P_Module pModule, E_ModuleStatus reqdState );
186 
187 E_DscError DSC_ModuleDecompress( P_DsmCoreInst idp, P_Module pModule );
188 
189 E_DscError DSC_ModuleDataRefresh( P_DsmCoreInst idp, P_Module pModule );
190 
191 E_DscError DSC_ModuleUpdate( P_DsmCoreInst idp,
192  P_Module pModule, U8BIT *pDDBMsgPayload, U16BIT ddbMsgPayloadLen );
193 
194 /* Generic module list functions */
195 P_Module DSC_ModuleListFindById( P_LLControl pModuleList, U16BIT moduleId );
196 
197 E_SFPriority DSC_ModulePriority( P_Module pModule );
198 
199 E_DscError DSC_ModuleAddLoadRequest( P_DsmCoreInst idp, P_Module pModule, H_Object hLoadRqst );
200 
201 BOOLEAN DSC_ModuleRemoveLoadRequest( P_DsmCoreInst idp, H_Object hLoadRqst );
202 
203 void DSC_ModuleAbortLoadRequests( P_DsmCoreInst idp, P_Module pModule );
204 
205 E_DscError DSC_ModuleAcquireRestart( P_DsmCoreInst idp, P_Module pModule );
206 
207 /*----------------------------------------------------------------------------*/
208 #ifdef __cplusplus
209 }
210 #endif
211 #endif /* _MODULE_H_ */
General include file for clDsm library internal definitions.
void DSC_ModuleDeleteDcTidyUp(P_DsmCoreInst idp, P_Module pModule)
Delete module and destroy parent DC if now empty.
Definition: module.c:388
void DSC_ModuleDelete(P_DsmCoreInst idp, P_Module pModule)
Destroy the module and destroy parent DC if now empty.
Definition: module.c:303
void DSC_ModuleAcquireStop(P_DsmCoreInst idp, P_Module pModule)
Stop aquisition of module.
Definition: module.c:288
E_DscError DSC_ModuleAcquireStart(P_DsmCoreInst idp, P_Module pModule, E_SFPriority sfPriority)
Start aquisition of module.
Definition: module.c:204
E_DscError DSC_ModuleAcquireRestart(P_DsmCoreInst idp, P_Module pModule)
Restart aquisition of module.
Definition: module.c:252
Header to the sectionFilter module.
Defines memory access utils to work with managed (MemMgr) memory.