DSMCC  22.11.0
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  BOOLEAN zipped;
113 #ifndef NDEBUG
114  U32BIT blkRcvd;
115 #endif
116  U32BIT moduleSize;
117  U32BIT originalSize;
118  union {
119  S_MHGProfile mhgp;
120  S_SSUProfile ssup;
121  } u;
123 
124 
125 typedef struct s_Module
126 {
127  S_LLObject llData[NUM_LISTS_MODULE];
128  S_ModuleInfo moduleInfo;
129  E_ModuleStatus status;
130 
131  /* -- DDB filter info */
132  P_SecFilterInfo pDdbSf;
133 
134  U32BIT cachedTime;
135 
136  U16BIT currentUseCount; /* -- Limited by design */
137  U16BIT decompressFailureCount; /* -- Limited by MAX_MODULE_DECOMPRESS_FAILURES */
138 
139  U16BIT loadedCount; /* -- Limited only by memory */
140  U16BIT highPriorityCount; /* -- Limited only by memory */
141  U16BIT directPriorityCount; /* -- Limited only by memory */
142 
143  /* -- NB. Module inherits 'highest priority' caching rules of
144  -- any object loaded from the module */
145  E_CacheRules cachingRules;
146 
147  P_ModuleBuilder pModuleBuilder;
148  P_ModuleData hCompModuleData;
149  P_ModuleData hModuleData;
150 
151  P_RootLoadRqst pLoadRqst;
152  P_LLControl llcLoadRequests;
153 } S_Module;
154 
155 
156 /*------------------------------ Exported Data -----------------------------*/
157 
158 
159 /*--------------------------- Exported Prototypes --------------------------*/
160 
161 E_DscError DSC_ModuleCreate( P_DsmCoreInst idp,
162  U16BIT moduleId, P_Module *ppModule );
163 
164 void DSC_ModuleDestroy( P_DsmCoreInst idp, P_Module pModule );
165 
166 void DSC_ModuleUse( P_DsmCoreInst idp, P_Module pModule );
167 
168 void DSC_ModuleUnUse( P_DsmCoreInst idp, P_Module pModule );
169 
170 E_DscError DSC_ModuleAcquireStart( P_DsmCoreInst idp,
171  P_Module pModule, E_SFPriority sfPriority );
172 
173 void DSC_ModuleAcquireStop( P_DsmCoreInst idp, P_Module pModule );
174 
178 void DSC_ModuleDelete( P_DsmCoreInst idp, P_Module pModule );
179 
183 void DSC_ModuleDeleteDcTidyUp( P_DsmCoreInst idp, P_Module pModule );
184 
185 void DSC_ModuleResetState( P_DsmCoreInst idp,
186  P_Module pModule, E_ModuleStatus reqdState );
187 
188 E_DscError DSC_ModuleDecompress( P_DsmCoreInst idp, P_Module pModule );
189 
190 E_DscError DSC_ModuleDataRefresh( P_DsmCoreInst idp, P_Module pModule );
191 
192 E_DscError DSC_ModuleUpdate( P_DsmCoreInst idp,
193  P_Module pModule, U8BIT *pDDBMsgPayload, U16BIT ddbMsgPayloadLen );
194 
195 /* Generic module list functions */
196 P_Module DSC_ModuleListFindById( P_LLControl pModuleList, U16BIT moduleId );
197 
198 E_SFPriority DSC_ModulePriority( P_Module pModule );
199 
200 E_DscError DSC_ModuleAddLoadRequest( P_DsmCoreInst idp, P_Module pModule, H_Object hLoadRqst );
201 
202 BOOLEAN DSC_ModuleRemoveLoadRequest( P_DsmCoreInst idp, H_Object hLoadRqst );
203 
204 void DSC_ModuleAbortLoadRequests( P_DsmCoreInst idp, P_Module pModule );
205 
206 E_DscError DSC_ModuleAcquireRestart( P_DsmCoreInst idp, P_Module pModule );
207 
208 /*----------------------------------------------------------------------------*/
209 #ifdef __cplusplus
210 }
211 #endif
212 #endif /* _MODULE_H_ */
Definition: loadRqst.h:71
General include file for clDsm library internal definitions.
Definition: module.h:125
Definition: clDsmSystem.h:535
void DSC_ModuleDeleteDcTidyUp(P_DsmCoreInst idp, P_Module pModule)
Delete module and destroy parent DC if now empty.
Definition: module.c:391
void DSC_ModuleDelete(P_DsmCoreInst idp, P_Module pModule)
Destroy the module and destroy parent DC if now empty.
Definition: module.c:306
void DSC_ModuleAcquireStop(P_DsmCoreInst idp, P_Module pModule)
Stop aquisition of module.
Definition: module.c:291
E_DscError DSC_ModuleAcquireStart(P_DsmCoreInst idp, P_Module pModule, E_SFPriority sfPriority)
Start aquisition of module.
Definition: module.c:207
E_DscError DSC_ModuleAcquireRestart(P_DsmCoreInst idp, P_Module pModule)
Restart aquisition of module.
Definition: module.c:255
Definition: module.h:76
Definition: sectionFilter.h:89
Definition: module.h:87
Definition: module.h:103
Header to the sectionFilter module.
Definition: moduleData.c:42
Definition: linkList.h:47
Definition: linkList.h:55
Defines memory access utils to work with managed (MemMgr) memory.
Definition: module.h:48