xref: /utopia/UTPA2-700.0.x/modules/dscmb/drv/nsk2/raspdemuxrasp2.h (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1 /*
2 Copyright ((c)) NDS Limited 2005-2010
3 
4 P R O P R I E T A R Y  &  C O N F I D E N T I A L
5 
6 The copyright of this code and related documentation together with
7 any other associated intellectual property rights are vested in
8 NDS Limited and may not be used except in accordance with the terms
9 of the licence that you have entered into with NDS Limited.
10 Use of this material without an express licence from NDS Limited
11 shall be an infringement of copyright and any other intellectual
12 property rights that may be incorporated with this material.
13 
14 P L E A S E     N O T E :
15 
16 This header file has been automatically generated from a source CDI
17 Specification file in XML format.
18 */
19 /*
20 CDI Issue 7
21 */
22 
23 /*
24 CDI header file for the demux rasp device.
25 This file is immutable. Do not edit.
26 */
27 
28 #ifndef __NDS_CDI_RASPDEMUXRASP_H__
29 #define __NDS_CDI_RASPDEMUXRASP_H__
30 
31 /* Include the platform-specific IOCTL macros. */
32 #include "MsCommon.h"
33 
34 
35 /* Demux RASP notification field definitions. */
36 #define DEMUX_RASP_TPID_PAYLOAD_UNIT_START_INDICATOR       (0x00000001U)
37 #define DEMUX_RASP_TPID_CHANGE_ES_TO_NOT_SCRAMBLED         (0x00000002U)
38 #define DEMUX_RASP_TPID_CHANGE_ES_TO_EVEN_SCRAMBLED        (0x00000004U)
39 #define DEMUX_RASP_TPID_CHANGE_ES_TO_ODD_SCRAMBLED         (0x00000008U)
40 #define DEMUX_RASP_TPID_DISCONTINUITY_INDICATOR            (0x00000100U)
41 #define DEMUX_RASP_TPID_RANDOM_ACCESS_INDICATOR            (0x00000200U)
42 #define DEMUX_RASP_TPID_ES_PRIORITY_INDICATOR              (0x00000400U)
43 #define DEMUX_RASP_TPID_PCR_FLAG                           (0x00000800U)
44 #define DEMUX_RASP_TPID_OPCR_FLAG                          (0x00001000U)
45 #define DEMUX_RASP_TPID_SPLICING_POINT_FLAG                (0x00002000U)
46 #define DEMUX_RASP_TPID_TRANSPORT_PRIVATE_DATA             (0x00004000U)
47 #define DEMUX_RASP_TPID_ADAPTATION_FIELD_EXTENSION_FLAG    (0x00008000U)
48 #define DEMUX_RASP_GENERAL_FIRST_PACKET                    (0x01000000U)
49 #define DEMUX_RASP_GENERAL_INTERNAL_TICK                   (0x02000000U)
50 /* Obsolete:
51 	The following definitions for DEMUX_RASP_* are obsolete
52 	as of CDI [version 2] Issue 5.
53 	The definitions may be removed in a future version
54 	of the CDI specification and from this header file.
55 */
56 #define DEMUX_RASP_TPID_SECTION_FILTER_MATCH               (0x00000020U)
57 #define DEMUX_RASP_TPID_PACKET_REPLACEMENT                 (0x00010000U)
58 
59 /* Demux RASP Event definitions. */
60 #define DEMUX_RASP_EVENT_THRESHOLD_REACHED               (0x00000001U)
61 #define DEMUX_RASP_EVENT_OVERFLOW                        (0x00000002U)
62 #define DEMUX_RASP_EVENT_TP_PAYLOAD_THRESHOLD_REACHED    (0x00000004U)
63 #define DEMUX_RASP_EVENT_TP_PAYLOAD_OVERFLOW             (0x00000008U)
64 
65 /* Capabilities Versions definitions. */
66 #define DEMUX_RASP_CAP_V0    (0x00000001U)
67 #define DEMUX_RASP_CAP_V1    (0x00000002U)
68 
69 /* RASP TP Payload PES Notification Fields definitions. */
70 #define DEMUX_RASP_PES_PTS    (0x00000001U)
71 
72 /* RASP Encoding Formats definitions. */
73 #define DEMUX_RASP_ES_ENCODING_FORMAT_MPEG2    (0x00000001U)
74 
75 /* MPEG2 ES Encoding Format definitions. */
76 #define DEMUX_RASP_ES_MPEG2_SEQUENCE_START     (0x00000001U)
77 #define DEMUX_RASP_ES_MPEG2_PICTURE_I_START    (0x00000010U)
78 #define DEMUX_RASP_ES_MPEG2_PICTURE_P_START    (0x00000020U)
79 #define DEMUX_RASP_ES_MPEG2_PICTURE_B_START    (0x00000040U)
80 
81 /* MPEG2 ES Encoding Format definitions. */
82 #define DEMUX_RASP_ES_MPEG2_PIC_TYPE_FIELD_TOP       (0x01U)
83 #define DEMUX_RASP_ES_MPEG2_PIC_TYPE_FIELD_BOTTOM    (0x02U)
84 #define DEMUX_RASP_ES_MPEG2_PIC_TYPE_FRAME           (0x03U)
85 
86 /* Demux Trigger definitions. */
87 #define DEMUX_RASP_TRIGGER_BY_TIME         (1U)
88 #define DEMUX_RASP_TRIGGER_BY_RASP_DATA    (2U)
89 
90 /// data type unsigned char, data length 1 byte
91 typedef unsigned char               uint8_t;                              // 1 byte
92 /// data type unsigned short, data length 2 byte
93 typedef unsigned short              uint16_t;                             // 2 bytes
94 /// data type unsigned int, data length 4 byte
95 typedef unsigned long               uint32_t;                             // 4 bytes
96 
97 /* DemuxRaspConfiguration structure */
98 typedef struct DemuxRaspConfiguration_cdi
99 {
100     uint32_t  thresholdType;
101     uint32_t  raspDataThreshold;
102     uint32_t  timeThreshold;
103     uint32_t  tpidIndependentEvents;
104 } DemuxRaspConfiguration;
105 
106 /* DemuxRaspTPMask structure */
107 typedef struct DemuxRaspTPMask_cdi
108 {
109     uint32_t  tpid;
110     uint32_t  tpMaskID;
111     uint32_t  eventMask;
112     uint32_t  payloadMask;
113 } DemuxRaspTPMask;
114 
115 /* DemuxRaspTimerTPNumber structure */
116 typedef struct DemuxRaspTimerTPNumber_cdi
117 {
118     uint32_t  time;
119     uint8_t   packetNumber[8];
120 } DemuxRaspTimerTPNumber;
121 
122 /* DemuxRaspTP structure */
123 typedef struct DemuxRaspTP_cdi
124 {
125     uint8_t  packetNumber[8];
126     uint8_t  bufferLength;
127     uint8_t  *buffer;
128 } DemuxRaspTP;
129 
130 /* DemuxRaspReplaceTP structure */
131 
132 /* Obsolete:
133    The following definition for DemuxRaspReplaceTP is obsolete
134    as of CDI [version 2] Issue 5.
135    The definition may be removed in a future version of the
136    CDI specification and from this header file.
137 */
138 typedef struct DemuxRaspReplaceTP_cdi
139 {
140     uint32_t  tpid;
141     uint32_t  tpReplacerID;
142     uint8_t   fromByte;
143     uint8_t   numBytes;
144     const void      *replaceData;
145 } DemuxRaspReplaceTP;
146 
147 /* DemuxRaspDataBlock structure */
148 typedef struct DemuxRaspDataBlock_cdi
149 {
150     uint32_t  eventDescriptor;
151     uint32_t  tpid;
152     uint8_t   packetNumber[8];
153     uint32_t  timer;
154     uint32_t  streamClock;
155 } DemuxRaspDataBlock;
156 
157 /* DemuxRaspRead structure */
158 typedef struct DemuxRaspRead_cdi
159 {
160     uint32_t            numDataBlocksToRead;
161     DemuxRaspDataBlock  *dataBlocks;
162     uint32_t            numDataBlocksReturned;
163 } DemuxRaspRead;
164 
165 /* DemuxRaspCapsEx structure */
166 typedef struct DemuxRaspCapsEx_cdi
167 {
168     uint32_t  version;
169     void      *capability;
170     uint32_t  capabilitySize;
171 } DemuxRaspCapsEx;
172 
173 /* Demux RASP features definitions. */
174 #define DEMUX_RASP_FEATURE_EVERY_SLOT_TIME         (0x01U)
175 #define DEMUX_RASP_FEATURE_STREAM_CLOCK_STAMP      (0x02U)
176 #define DEMUX_RASP_FEATURE_LOCAL_CLOCK_STAMP       (0x04U)
177 #define DEMUX_RASP_FEATURE_TRIGGER_BY_RASP_DATA    (0x08U)
178 #define DEMUX_RASP_FEATURE_TRIGGER_BY_TIME         (0x10U)
179 #define DEMUX_RASP_FEATURE_GET_TIMER_IN_TICKS      (0x20U)
180 #define DEMUX_RASP_FEATURE_TP_PAYLOAD_INDEXING     (0x40U)
181 
182 /* Demux RASP capability definitions. */
183 
184 /* Obsolete:
185    The following definitions for Demux RASP capability (DEMUX_RASP_CAP_*)
186    are obsolete as of CDI [version 2] Issue 5.
187    The definition may be removed in a future version of the CDI specification
188    and from this header file.
189 */
190 #define DEMUX_RASP_CAP_EVERY_SLOT_TIME         (DEMUX_RASP_FEATURE_EVERY_SLOT_TIME)
191 #define DEMUX_RASP_CAP_STREAM_CLOCK_STAMP      (DEMUX_RASP_FEATURE_STREAM_CLOCK_STAMP)
192 #define DEMUX_RASP_CAP_LOCAL_CLOCK_STAMP       (DEMUX_RASP_FEATURE_LOCAL_CLOCK_STAMP)
193 #define DEMUX_RASP_CAP_TRIGGER_BY_RASP_DATA    (DEMUX_RASP_FEATURE_TRIGGER_BY_RASP_DATA)
194 #define DEMUX_RASP_CAP_TRIGGER_BY_TIME         (DEMUX_RASP_FEATURE_TRIGGER_BY_TIME)
195 
196 /* DemuxRaspCaps structure */
197 
198 /* Obsolete:
199    The following definition for DemuxRaspCaps is obsolete
200    as of CDI [version 2] Issue 5.
201    The definition may be removed in a future version of the
202    CDI specification and from this header file.
203 */
204 typedef struct DemuxRaspCaps_cdi
205 {
206     uint32_t  raspEvents;
207     uint32_t  clockRate;
208     uint16_t  numConnections;
209     uint16_t  numRaspDataBlocks;
210     uint16_t  numTPs;
211     uint16_t  numTPMasks;
212     uint16_t  numTPreplacers;
213     uint8_t   functionalityMask;
214 } DemuxRaspCaps;
215 
216 typedef DemuxRaspCaps DemuxRaspCapsV0;
217 
218 /* DemuxRaspCapsV1 structure */
219 typedef struct DemuxRaspCapsV1_cdi
220 {
221     uint32_t  raspEvents;
222     uint32_t  clockRate;
223     uint16_t  numConnections;
224     uint16_t  numRaspDataBlocks;
225     uint16_t  numTPs;
226     uint16_t  numTPMasks;
227     uint8_t   features;
228 } DemuxRaspCapsV1;
229 
230 /* TP Payload Data Block Version definitions. */
231 #define DEMUX_RASP_TP_PAYLOAD_DATABLOCK_V0    (0x00000001U)
232 
233 /* RASP TP Payload Feature Definitions definitions. */
234 #define DEMUX_RASP_TP_PAYLOAD_FEATURE_LOCAL_CLOCK_STAMP       (0x00000001U)
235 #define DEMUX_RASP_TP_PAYLOAD_FEATURE_TRIGGER_BY_RASP_DATA    (0x00000002U)
236 #define DEMUX_RASP_TP_PAYLOAD_FEATURE_TRIGGER_BY_TIME         (0x00000004U)
237 #define DEMUX_RASP_TP_PAYLOAD_FEATURE_ES_MPEG2_FRAME_FIELD    (0x00000008U)
238 
239 /* DemuxRaspTPPayloadCaps structure */
240 typedef struct DemuxRaspTPPayloadCaps_cdi
241 {
242     uint32_t  features;
243     uint32_t  pesEvents;
244     uint32_t  esEncodingFormats;
245     uint16_t  numRaspTPPayloadDataBlocks;
246     uint16_t  numTPPayloadMasks;
247     uint8_t   tpPayloadDataBlockVersion;
248 } DemuxRaspTPPayloadCaps;
249 
250 /* DemuxRaspTPPayloadESCaps structure */
251 typedef struct DemuxRaspTPPayloadESCaps_cdi
252 {
253     uint32_t  esEncodingFormat;
254     uint32_t  esEvents;
255 } DemuxRaspTPPayloadESCaps;
256 
257 /* DemuxRaspTPPayloadConfiguration structure */
258 typedef struct DemuxRaspTPPayloadConfiguration_cdi
259 {
260     uint32_t  thresholdType;
261     uint32_t  raspDataThreshold;
262     uint32_t  timeThreshold;
263     uint32_t  tpidIndependentEvents;
264 } DemuxRaspTPPayloadConfiguration;
265 
266 /* DemuxRaspTPPayloadMask structure */
267 typedef struct DemuxRaspTPPayloadMask_cdi
268 {
269     uint32_t  tpid;
270     uint32_t  tpPayloadMaskID;
271     uint32_t  pesEventMask;
272     uint32_t  esEncodingFormat;
273     uint32_t  esEventMask;
274 } DemuxRaspTPPayloadMask;
275 
276 /* tag_PTS_do_not_use_in_client structure */
277 typedef struct tag_PTS_do_not_use_in_client_cdi
278 {
279     uint32_t  high;
280     uint32_t  low;
281 } tag_PTS_do_not_use_in_client;
282 
283 typedef tag_PTS_do_not_use_in_client PTS;
284 
285 
286 /* DemuxRaspTPPayloadDataBlockV0 structure */
287 typedef struct DemuxRaspTPPayloadDataBlockV0_cdi
288 {
289     uint32_t  pesEventDescriptor;
290     uint32_t  esEventDescriptor;
291     uint32_t  tpid;
292     uint8_t   packetNumber[8];
293     uint32_t  timer;
294     PTS       pts;
295     uint8_t   pictureType;
296 } DemuxRaspTPPayloadDataBlockV0;
297 
298 /* DemuxRaspTPPayloadRead structure */
299 typedef struct DemuxRaspTPPayloadRead_cdi
300 {
301     uint32_t  numDataBlocksToRead;
302     void      *dataBlocks;
303     uint32_t  numDataBlocksReturned;
304 } DemuxRaspTPPayloadRead;
305 
306 
307 
308 #endif
309 /* End of File. */
310 
311