DSMCC  17.9.0
 All Data Structures Files Functions Typedefs
cldsmtypes.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 © 2002 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 _CLDSMTYPES_H_
27 #define _CLDSMTYPES_H_
28 
29 /*---includes for this file--------------------------------------------------*/
30 #include "dsm_types.h"
31 
32 /*---Constant and macro definitions for public use---------------------------*/
33 
34 /* Minimum and Maximum number of section filters required by this DSM-CC module.
35  * This is NOT number of PID filters - as there can be many DSM-CC section
36  * filters on a single PID.
37  * For example, UK DTG MHEG main test suite requires at least 46 section
38  * filters, but needs only 2 PID filters for this.
39  * Note that to pass MHEG tests, more that 46 is a must!
40  */
41 #define NUM_SECTION_FILTERS_MINIMUM 8
42 #define NUM_SECTION_FILTERS_DEFAULT 512
43 #define NUM_SECTION_FILTERS_MAXIMUM 1024
44 
45 #define INVALID_ASSOCIATION_TAG 0xFFFF
46 
47 /* ----------- Section Filter Priorities --------- */
48 
49 /*--------------------------------------------------*/
50 
51 /*---Enumerations for public use---------------------------------------------*/
52 
53 typedef enum
54 {
55  /* For DSM-CC sections currently with LOW priority */
56  SF_PRIORITY_LOW = 0,
57  /* For DSM-CC sections currently with CLEAR priority
58  * This is where DSM-CC requires that the section should
59  * come direct from transport stream and NOT from any cache
60  * It should be treated as low priority, but not
61  * necessarily in preference to normal low priority filter */
62  SF_PRIORITY_CLEAR = 1,
63  /* For DSM-CC sections currently with HIGH priority
64  * Must be given in preference to any low priority */
65  SF_PRIORITY_HIGH = 2,
66  /* For DSM-CC sections currently with DIRECT priority
67  * This is where DSM-CC requires that the section should
68  * come direct from transport stream and NOT from any cache
69  * It should be treated as high priority, but not
70  * necessarily in preference to normal high priority filter */
71  SF_PRIORITY_DIRECT = 3
72 } E_SFPriority;
73 
74 /*---Global type defs for public use-----------------------------------------*/
75 
76 /* -- DSM-CC ERROR CODES -- */
77 
78 typedef enum
79 {
80 /* 0*/ CLDSM_OK = 0,
81 /* 1*/ CLDSM_PENDING,
82 /* 2*/ CLDSM_DUPLICATE_REQUEST,
83 /* 3*/ CLDSM_ERR_END_OF_DATA,
84 /* 4*/ CLDSM_ERR_INTERNAL,
85 /* 5*/ CLDSM_ERR_ABORTED,
86 /* 6*/ CLDSM_ERR_MEM_HEAP_FULL,
87 /* 7*/ CLDSM_ERR_ALLOC_FAILED,
88 /* 8*/ CLDSM_ERR_ILLEGAL_SETUP,
89 /* 9*/ CLDSM_ERR_ILLEGAL_PARAMETER,
90 /*10*/ CLDSM_ERR_INVALID_INSTANCE,
91 /*11*/ CLDSM_ERR_INVALID_CAROUSEL_HANDLE,
92 /*12*/ CLDSM_ERR_CAROUSEL_LOAD_FAILED,
93 /*13*/ CLDSM_ERR_CAROUSEL_NOT_BOOTED,
94 /*14*/ CLDSM_ERR_CAROUSELS_STILL_LOADED,
95 /*15*/ CLDSM_ERR_INVALID_OBJECT_HANDLE,
96 /*16*/ CLDSM_ERR_INVALID_OBJECT_TYPE,
97 /*17*/ CLDSM_ERR_INVALID_PATHNAME,
98 /*18*/ CLDSM_ERR_INVALID_CACHING_RULES,
99 /*19*/ CLDSM_ERR_LOAD_FAILED,
100 /*20*/ CLDSM_ERR_OPEN_OBJECT_LIMIT,
101 /*21*/ CLDSM_ERR_OBJECT_NOT_LOADED,
102 /*22*/ CLDSM_ERR_OBJECT_OPEN,
103 /*23*/ CLDSM_ERR_OBJECT_NOT_OPEN,
104 /*24*/ CLDSM_ERR_OBJECTS_STILL_LOADED,
105 /*25*/ CLDSM_ERR_INVALID_STREAM_EVENT_NAME,
106 /*26*/ CLDSM_ERR_INVALID_STREAM_EVENT_HANDLE,
107 /*27*/ CLDSM_ERR_STREAM_EVENTS_STILL_SUBSCRIBED,
108 /*28*/ CLDSM_ERR_NO_STREAM_EVENT_NOTIFY_CALLBACK,
109 /*29*/ CLDSM_ERR_SI_QUERY_FAILED,
110 /*30*/ CLDSM_ERR_INVALID_SI_INFO,
111 /*31*/ CLDSM_ERR_INVALID_SIQUERY_STATUS,
112 /*32*/ CLDSM_ERR_INVALID_SI_QUERY_REF,
113 /*33*/ CLDSM_ERR_SYSTEM_ADD_SECTION_FILTER,
114 /*34*/ CLDSM_ERR_SECTION_FILTER_HEAP_FULL,
115 /*35*/ CLDSM_ERR_MODULE_TOO_LARGE,
116 /*36*/ CLDSM_ERR_MODULE_ACQUISITION_FAILURE,
117 /*37*/ CLDSM_ERR_UNABLE_TO_GET_PROGRAM_ASSOC_TAG,
118 /*38*/ CLDSM_ERR_NO_CURRENT_SERVICE_SET,
119 /*39*/ CLDSM_ERR_MEMMGR_START_PROBLEM,
120 /*40*/ CLDSM_ERR_MEMMGR_STOP_PROBLEM,
121 /*41*/ CLDSM_ERR_INSTANCE_NOT_RESET,
122 /*42*/ CLDSM_ERR_RECURSION_LIMIT_REACHED,
123 /*43*/ CLDSM_ERR_TIMER_FAILURE,
124 /*44*/ CLDSM_ERR_SI_SUBSCRIBE_FAILURE,
125 /*45*/ CLDSM_ERR_CAROUSEL_UNAVAILABLE,
126 } E_DscError;
127 
128 /* -- DSM-CC INSTANCE HANDLE -- */
129 
130 typedef struct s_DsmCoreInstance *H_DsmCoreInst;
131 
132 
133 /* -- SECTION FILTER TYPES -- */
134 
135 typedef U32BIT H_DscSFRef;
136 
137 /*
138 -- Structure definition for Section Filter data
139 --
140 -- PID -> MPEG2 PID
141 --
142 -- filterPriority -> direct, high or low
143 --
144 -- tableId -> DSM-CC tableId filter value for sections (byte 0).
145 -- NB. Only the tableId values of 0x3B, 0x3C, 0x3D will
146 -- be used for DSM-CC section filters.
147 --
148 -- tableIdExt -> DSM-CC tableIdExtension filter value (bytes 3&4)
149 --
150 -- tableIdExtMask -> DSM-CC active filter bits.
151 -- NB.'Wildcard' bitmasks will only be set on contiguous
152 -- bits starting at LSBit.
153 --
154 */
155 typedef struct
156 {
157  U16BIT pid;
158  U8BIT priority;
159  U8BIT tableId;
160  U16BIT tableIdExt;
161  U16BIT tableIdExtMask;
163 
164 typedef struct s_SfmInstance *H_SfmInstance;
165 
166 /* -- SI QUERY TYPES -- */
167 
168 typedef struct s_SIQueryRef *H_SIQueryRef;
169 
170 typedef enum
171 {
172  /* Following are supplied to startSIQueryFunc() and
173  * returned in successful query result */
174  SIQUERY_PID,
175  SIQUERY_BOOT_CAROUSEL,
176  SIQUERY_CAROUSEL,
177  SIQUERY_PIDLIST,
178  SIQUERY_DEFERRED_SERVICE,
179  SIQUERY_CAROUSEL_INFO,
180  SIQUERY_FIND_CAROUSEL,
181  SIQUERY_SSU_CAROUSEL,
182  SIQUERY_SSU_PID,
183 
184  /* Below are used in query result when not success - used in
185  * return from startSIQueryFunc() or
186  * asynchronous callback to CDSM_SysProcessSIQueryEvent()
187  */
188  SIRESULT_PENDING,
189  SIRESULT_FAILURE
190 } E_SIQueryKind;
191 
192 
193 typedef struct
194 {
195  E_SIQueryKind kind;
196  U16BIT serviceId;
197  U16BIT associationTag;
198  U32BIT dataId; /* carousel Id, OUI, or componentTag */
200 
201 
202 typedef struct s_CarouselInfo
203 {
204  U16BIT pid;
205  U16BIT associationTag;
206  U32BIT carouselId;
207  struct s_CarouselInfo *next;
208  /*TODO: ?Format Id?*/
210 
211 
212 typedef struct
213 {
214  E_SIQueryKind kind;
215 
216  union
217  {
218  U16BIT pid;
219  S_CarouselInfo carouselInfo;
220  S_DvbLocator deferredService;
221  /* For when query start returns CLDSM_PENDING */
222  void *queryHandle;
223  } data;
225 
226 
227 /* -- SI change event -- */
228 typedef enum
229 {
230  SICHANGE_SERVICE_DELETED,
231  SICHANGE_SERVICE_UPDATED,
232  SICHANGE_CAROUSEL_DELETED
233 } E_SIChangeEvent;
234 
235 typedef struct s_SiqInstance *H_SiqInstance;
236 
237 typedef union
238 {
239  void *ptr;
240  U32BIT u32;
241  S32BIT s32;
242  U16BIT u16;
243  U8BIT u8;
244  BOOLEAN b;
245 } U_PARAM;
246 
247 #endif /* _CLDSMTYPES_H_ */
DSM-CC types used for client control.