1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26#ifndef _BC_DTS_DEFS_H_
27#define _BC_DTS_DEFS_H_
28
29
30#define BC_BIT(_x) (1 << (_x))
31
32enum BC_STATUS {
33 BC_STS_SUCCESS = 0,
34 BC_STS_INV_ARG = 1,
35 BC_STS_BUSY = 2,
36 BC_STS_NOT_IMPL = 3,
37 BC_STS_PGM_QUIT = 4,
38 BC_STS_NO_ACCESS = 5,
39 BC_STS_INSUFF_RES = 6,
40 BC_STS_IO_ERROR = 7,
41 BC_STS_NO_DATA = 8,
42 BC_STS_VER_MISMATCH = 9,
43 BC_STS_TIMEOUT = 10,
44 BC_STS_FW_CMD_ERR = 11,
45 BC_STS_DEC_NOT_OPEN = 12,
46 BC_STS_ERR_USAGE = 13,
47 BC_STS_IO_USER_ABORT = 14,
48 BC_STS_IO_XFR_ERROR = 15,
49 BC_STS_DEC_NOT_STARTED = 16,
50 BC_STS_FWHEX_NOT_FOUND = 17,
51 BC_STS_FMT_CHANGE = 18,
52 BC_STS_HIF_ACCESS = 19,
53 BC_STS_CMD_CANCELLED = 20,
54 BC_STS_FW_AUTH_FAILED = 21,
55 BC_STS_BOOTLOADER_FAILED = 22,
56 BC_STS_CERT_VERIFY_ERROR = 23,
57 BC_STS_DEC_EXIST_OPEN = 24,
58 BC_STS_PENDING = 25,
59 BC_STS_CLK_NOCHG = 26,
60
61
62 BC_STS_ERROR = -1
63};
64
65
66
67
68#define BC_REG_KEY_MAIN_PATH "Software\\Broadcom\\MediaPC\\70010"
69#define BC_REG_KEY_FWPATH "FirmwareFilePath"
70#define BC_REG_KEY_SEC_OPT "DbgOptions"
71
72
73
74
75
76
77
78
79
80
81
82enum BC_SW_OPTIONS {
83 BC_OPT_DOSER_OUT_ENCRYPT = BC_BIT(3),
84 BC_OPT_LINK_OUT_ENCRYPT = BC_BIT(29),
85};
86
87struct BC_REG_CONFIG{
88 uint32_t DbgOptions;
89};
90
91#if defined(__KERNEL__) || defined(__LINUX_USER__)
92#else
93
94#define ALIGN(x) __declspec(align(x))
95#endif
96
97
98
99
100
101
102
103
104
105
106
107
108
109enum DtsDeviceOpenMode {
110 DTS_PLAYBACK_MODE = 0,
111 DTS_DIAG_MODE,
112 DTS_MONITOR_MODE,
113 DTS_HWINIT_MODE
114};
115
116
117enum DtsDeviceFixMode {
118 DTS_LOAD_NEW_FW = BC_BIT(8),
119 DTS_LOAD_FILE_PLAY_FW = BC_BIT(9),
120 DTS_DISK_FMT_BD = BC_BIT(10),
121
122 DTS_SKIP_TX_CHK_CPB = BC_BIT(16),
123 DTS_ADAPTIVE_OUTPUT_PER = BC_BIT(17),
124 DTS_INTELLIMAP = BC_BIT(18),
125
126 DTS_PLAYBACK_DROP_RPT_MODE = BC_BIT(22)
127};
128
129#define DTS_DFLT_RESOLUTION(x) (x<<11)
130
131#define DTS_DFLT_CLOCK(x) (x<<19)
132
133
134enum FW_FILE_VER {
135
136 BC_FW_VER_020402 = ((12<<16) | (2<<8) | (0))
137};
138
139
140
141
142enum DtsOpenDecStreamTypes {
143 BC_STREAM_TYPE_ES = 0,
144 BC_STREAM_TYPE_PES = 1,
145 BC_STREAM_TYPE_TS = 2,
146 BC_STREAM_TYPE_ES_TSTAMP = 6,
147};
148
149
150
151
152enum DtsSetVideoParamsAlgo {
153 BC_VID_ALGO_H264 = 0,
154 BC_VID_ALGO_MPEG2 = 1,
155 BC_VID_ALGO_VC1 = 4,
156 BC_VID_ALGO_VC1MP = 7,
157};
158
159
160
161
162#define BC_MPEG_VALID_PANSCAN (1)
163
164struct BC_PIB_EXT_MPEG {
165 uint32_t valid;
166
167
168 uint32_t display_horizontal_size;
169 uint32_t display_vertical_size;
170
171
172
173 uint32_t offset_count;
174 int32_t horizontal_offset[3];
175 int32_t vertical_offset[3];
176};
177
178
179
180
181
182#define H264_VALID_PANSCAN (1)
183#define H264_VALID_SPS_CROP (2)
184#define H264_VALID_VUI (4)
185
186struct BC_PIB_EXT_H264 {
187
188
189
190
191 uint32_t valid;
192
193
194 uint32_t pan_scan_count;
195 int32_t pan_scan_left[3];
196 int32_t pan_scan_right[3];
197 int32_t pan_scan_top[3];
198 int32_t pan_scan_bottom[3];
199
200
201 int32_t sps_crop_left;
202 int32_t sps_crop_right;
203 int32_t sps_crop_top;
204 int32_t sps_crop_bottom;
205
206
207 uint32_t chroma_top;
208 uint32_t chroma_bottom;
209};
210
211
212
213
214#define VC1_VALID_PANSCAN (1)
215
216struct BC_PIB_EXT_VC1 {
217 uint32_t valid;
218
219
220
221 uint32_t display_horizontal_size;
222 uint32_t display_vertical_size;
223
224
225 uint32_t num_panscan_windows;
226 int32_t ps_horiz_offset[4];
227 int32_t ps_vert_offset[4];
228 int32_t ps_width[4];
229 int32_t ps_height[4];
230};
231
232
233
234
235#if defined(__LINUX_USER__)
236
237
238enum {
239 vdecNoPulldownInfo = 0,
240 vdecTop = 1,
241 vdecBottom = 2,
242 vdecTopBottom = 3,
243 vdecBottomTop = 4,
244 vdecTopBottomTop = 5,
245 vdecBottomTopBottom = 6,
246 vdecFrame_X2 = 7,
247 vdecFrame_X3 = 8,
248 vdecFrame_X1 = 9,
249 vdecFrame_X4 = 10,
250};
251
252
253enum {
254 vdecFrameRateUnknown = 0,
255 vdecFrameRate23_97,
256 vdecFrameRate24,
257 vdecFrameRate25,
258 vdecFrameRate29_97,
259 vdecFrameRate30,
260 vdecFrameRate50,
261 vdecFrameRate59_94,
262 vdecFrameRate60,
263};
264
265
266enum {
267 vdecAspectRatioUnknown = 0,
268 vdecAspectRatioSquare,
269 vdecAspectRatio12_11,
270 vdecAspectRatio10_11,
271 vdecAspectRatio16_11,
272 vdecAspectRatio40_33,
273 vdecAspectRatio24_11,
274 vdecAspectRatio20_11,
275 vdecAspectRatio32_11,
276 vdecAspectRatio80_33,
277 vdecAspectRatio18_11,
278 vdecAspectRatio15_11,
279 vdecAspectRatio64_33,
280 vdecAspectRatio160_99,
281 vdecAspectRatio4_3,
282 vdecAspectRatio16_9,
283 vdecAspectRatio221_1,
284 vdecAspectRatioOther = 255,
285};
286
287
288enum {
289 vdecColourPrimariesUnknown = 0,
290 vdecColourPrimariesBT709,
291 vdecColourPrimariesUnspecified,
292 vdecColourPrimariesReserved,
293 vdecColourPrimariesBT470_2M = 4,
294 vdecColourPrimariesBT470_2BG,
295 vdecColourPrimariesSMPTE170M,
296 vdecColourPrimariesSMPTE240M,
297 vdecColourPrimariesGenericFilm,
298};
299
300enum {
301 vdecRESOLUTION_CUSTOM = 0x00000000,
302 vdecRESOLUTION_480i = 0x00000001,
303 vdecRESOLUTION_1080i = 0x00000002,
304 vdecRESOLUTION_NTSC = 0x00000003,
305 vdecRESOLUTION_480p = 0x00000004,
306 vdecRESOLUTION_720p = 0x00000005,
307 vdecRESOLUTION_PAL1 = 0x00000006,
308 vdecRESOLUTION_1080i25 = 0x00000007,
309 vdecRESOLUTION_720p50 = 0x00000008,
310 vdecRESOLUTION_576p = 0x00000009,
311 vdecRESOLUTION_1080i29_97 = 0x0000000A,
312 vdecRESOLUTION_720p59_94 = 0x0000000B,
313 vdecRESOLUTION_SD_DVD = 0x0000000C,
314 vdecRESOLUTION_480p656 = 0x0000000D,
315 vdecRESOLUTION_1080p23_976 = 0x0000000E,
316 vdecRESOLUTION_720p23_976 = 0x0000000F,
317 vdecRESOLUTION_240p29_97 = 0x00000010,
318 vdecRESOLUTION_240p30 = 0x00000011,
319 vdecRESOLUTION_288p25 = 0x00000012,
320 vdecRESOLUTION_1080p29_97 = 0x00000013,
321 vdecRESOLUTION_1080p30 = 0x00000014,
322 vdecRESOLUTION_1080p24 = 0x00000015,
323 vdecRESOLUTION_1080p25 = 0x00000016,
324 vdecRESOLUTION_720p24 = 0x00000017,
325 vdecRESOLUTION_720p29_97 = 0x00000018,
326 vdecRESOLUTION_480p23_976 = 0x00000019,
327 vdecRESOLUTION_480p29_97 = 0x0000001A,
328 vdecRESOLUTION_576p25 = 0x0000001B,
329
330 vdecRESOLUTION_480p0 = 0x0000001C,
331 vdecRESOLUTION_480i0 = 0x0000001D,
332 vdecRESOLUTION_576p0 = 0x0000001E,
333 vdecRESOLUTION_720p0 = 0x0000001F,
334 vdecRESOLUTION_1080p0 = 0x00000020,
335 vdecRESOLUTION_1080i0 = 0x00000021,
336};
337
338
339#define VDEC_FLAG_EOS (0x0004)
340
341#define VDEC_FLAG_FRAME (0x0000)
342#define VDEC_FLAG_FIELDPAIR (0x0008)
343#define VDEC_FLAG_TOPFIELD (0x0010)
344#define VDEC_FLAG_BOTTOMFIELD (0x0018)
345
346#define VDEC_FLAG_PROGRESSIVE_SRC (0x0000)
347#define VDEC_FLAG_INTERLACED_SRC (0x0020)
348#define VDEC_FLAG_UNKNOWN_SRC (0x0040)
349
350#define VDEC_FLAG_BOTTOM_FIRST (0x0080)
351#define VDEC_FLAG_LAST_PICTURE (0x0100)
352
353#define VDEC_FLAG_PICTURE_META_DATA_PRESENT (0x40000)
354
355#endif
356
357enum _BC_OUTPUT_FORMAT {
358 MODE420 = 0x0,
359 MODE422_YUY2 = 0x1,
360 MODE422_UYVY = 0x2,
361};
362
363struct BC_PIC_INFO_BLOCK {
364
365 uint64_t timeStamp;
366 uint32_t picture_number;
367 uint32_t width;
368 uint32_t height;
369 uint32_t chroma_format;
370 uint32_t pulldown;
371 uint32_t flags;
372 uint32_t frame_rate;
373 uint32_t aspect_ratio;
374 uint32_t colour_primaries;
375 uint32_t picture_meta_payload;
376 uint32_t sess_num;
377 uint32_t ycom;
378 uint32_t custom_aspect_ratio_width_height;
379 uint32_t n_drop;
380
381
382 union {
383 struct BC_PIB_EXT_H264 h264;
384 struct BC_PIB_EXT_MPEG mpeg;
385 struct BC_PIB_EXT_VC1 vc1;
386 } other;
387
388};
389
390
391
392
393
394enum POUT_OPTIONAL_IN_FLAGS_{
395
396 BC_POUT_FLAGS_YV12 = 0x01,
397 BC_POUT_FLAGS_STRIDE = 0x02,
398 BC_POUT_FLAGS_SIZE = 0x04,
399 BC_POUT_FLAGS_INTERLACED = 0x08,
400 BC_POUT_FLAGS_INTERLEAVED = 0x10,
401
402
403 BC_POUT_FLAGS_FMT_CHANGE = 0x10000,
404 BC_POUT_FLAGS_PIB_VALID = 0x20000,
405 BC_POUT_FLAGS_ENCRYPTED = 0x40000,
406 BC_POUT_FLAGS_FLD_BOT = 0x80000,
407};
408
409typedef enum BC_STATUS(*dts_pout_callback)(void *shnd, uint32_t width, uint32_t height, uint32_t stride, void *pOut);
410
411
412
413#define MAX_UD_SIZE 1792
414
415struct BC_DTS_PROC_OUT {
416 uint8_t *Ybuff;
417 uint32_t YbuffSz;
418 uint32_t YBuffDoneSz;
419
420 uint8_t *UVbuff;
421 uint32_t UVbuffSz;
422 uint32_t UVBuffDoneSz;
423
424 uint32_t StrideSz;
425 uint32_t PoutFlags;
426
427 uint32_t discCnt;
428
429 struct BC_PIC_INFO_BLOCK PicInfo;
430
431
432
433 uint32_t UserDataSz;
434 uint8_t UserData[MAX_UD_SIZE];
435
436 void *hnd;
437 dts_pout_callback AppCallBack;
438 uint8_t DropFrames;
439 uint8_t b422Mode;
440 uint8_t bPibEnc;
441 uint8_t bRevertScramble;
442
443};
444
445struct BC_DTS_STATUS {
446 uint8_t ReadyListCount;
447 uint8_t FreeListCount;
448 uint8_t PowerStateChange;
449 uint8_t reserved_[1];
450
451 uint32_t FramesDropped;
452 uint32_t FramesCaptured;
453 uint32_t FramesRepeated;
454
455 uint32_t InputCount;
456
457 uint64_t InputTotalSize;
458
459 uint32_t InputBusyCount;
460
461
462 uint32_t PIBMissCount;
463
464 uint32_t cpbEmptySize;
465
466
467 uint64_t NextTimeStamp;
468
469
470 uint8_t reserved__[16];
471
472};
473
474#define BC_SWAP32(_v) \
475 ((((_v) & 0xFF000000)>>24)| \
476 (((_v) & 0x00FF0000)>>8)| \
477 (((_v) & 0x0000FF00)<<8)| \
478 (((_v) & 0x000000FF)<<24))
479
480#define WM_AGENT_TRAYICON_DECODER_OPEN 10001
481#define WM_AGENT_TRAYICON_DECODER_CLOSE 10002
482#define WM_AGENT_TRAYICON_DECODER_START 10003
483#define WM_AGENT_TRAYICON_DECODER_STOP 10004
484#define WM_AGENT_TRAYICON_DECODER_RUN 10005
485#define WM_AGENT_TRAYICON_DECODER_PAUSE 10006
486
487
488#endif
489