Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 485 lines (441 sloc) 19.369 kB
41a6c9f @Wiladams Many changes for hdmi and tv_service
authored
1
2 local ffi = require "ffi"
3
4
5 --[[
6 * HDMI common host header for TV service, defines resolution code which host applications should
7 * use for power up command for HDMI
8 --]]
9
10
11 require "vc_hdmi_property" -- All HDMI related properties have been moved to here
12
13 ffi.cdef[[
14 typedef int VC_HDMI_BOOL_T;
15
16 /**
17 * HDMI resolution groups. There are two main groups:
18 * CEA - the conventional HDMI ones like 720p
19 * DMT - computer monitor resolutions like XGA
20 */
21 typedef enum {
22 HDMI_RES_GROUP_INVALID = 0, /**< Initialised value */
23 HDMI_RES_GROUP_CEA = 1, /**< CEA - HDMI device */
24 HDMI_RES_GROUP_DMT = 2, /**< DMT - computer monitors */
25 HDMI_RES_GROUP_CEA_3D = 3 /**< CEA 3D mode (for 3D displays only) */
26 } HDMI_RES_GROUP_T;
27 ]]
28
29 local GROUP_NAME = {
30 [ffi.C.HDMI_RES_GROUP_INVALID] = "Invalid";
31 [ffi.C.HDMI_RES_GROUP_CEA] = "CEA";
32 [ffi.C.HDMI_RES_GROUP_DMT] = "DMT";
33 [ffi.C.HDMI_RES_GROUP_CEA_3D] = "CEA_3D";
34 }
35
36 HDMI_RES_GROUP_NAME = function(g)
37 return GROUP_NAME[g] or "Unknown";
38 end
39
40 ffi.cdef[[
41 /**
42 * CEA 861-B defined video code and aspect ratios for various HDMI modes
43 */
44 typedef enum {
45 HDMI_ASPECT_UNKNOWN = 0, /**< Unknown aspect ratio */
46 HDMI_ASPECT_4_3 = 1, /**< 4:3 */
47 HDMI_ASPECT_14_9 = 2, /**< 14:9 */
48 HDMI_ASPECT_16_9 = 3 /**< 16:9 */
49 } HDMI_ASPECT_T;
50
51 /**
52 * Display options set the bounding box (only used in CEA mode)
53 */
54 typedef struct {
55 HDMI_ASPECT_T aspect;
56 /** Active area information - meanings as in CEA-861. */
57 VC_HDMI_BOOL_T vertical_bar_present;
58 uint16_t left_bar_width;
59 uint16_t right_bar_width;
60 VC_HDMI_BOOL_T horizontal_bar_present;
61 uint16_t top_bar_height;
62 uint16_t bottom_bar_height;
63 /** S0/S1 flags as defined in CEA-861. */
64 uint8_t overscan_flags;
65 } HDMI_DISPLAY_OPTIONS_T;
66
67 /**
68 * Copy protection for HDMI, only HDCP is available
69 * This enum is to make it consistent with the enums
70 * SDTV_CP_MODE_T in vc_sdtv.h
71 */
72 typedef enum {
73 HDMI_CP_NONE = 0, /**< No copyprotection */
74 HDMI_CP_HDCP = 1 /**< HDCP 1.x */
75 } HDMI_CP_MODE_T;
76
77 /**
78 * HDMI operation modes
79 */
80 typedef enum {
81 HDMI_MODE_OFF, /**< Off! */
82 HDMI_MODE_DVI, /**< DVI */
83 HDMI_MODE_HDMI, /**< HDMI */
84 HDMI_MODE_3D /**< HDMI 1.4a 3D */
85 } HDMI_MODE_T;
86
87 /**
88 * Possible values for the Source Product Description type code (in SPD infoframe).
89 * Taken from the CEA-861 spec.
90 */
91 typedef enum {
92 HDMI_SPD_TYPE_UNKNOWN,
93 HDMI_SPD_TYPE_STB, /**<Digital STB */
94 HDMI_SPD_TYPE_DVD, /**<DVD player */
95 HDMI_SPD_TYPE_DVHS, /**<D-VHS */
96 HDMI_SPD_TYPE_HDD_RECORDER, /**<HDD video recoder */
97 HDMI_SPD_TYPE_DVC, /**<DVC */
98 HDMI_SPD_TYPE_DSC, /**<DSC */
99 HDMI_SPD_TYPE_VCD, /**<Video CD */
100 HDMI_SPD_TYPE_GAME, /**<Game */
101 HDMI_SPD_TYPE_PC, /**<PC general */
102 HDMI_SPD_TYPE_BD, /**<Blu-Ray Disc */
103 HDMI_SPD_TYPE_SACD, /**<Super Audio CD */
104 HDMI_SPD_TYPE_HDDVD, /**<HD DVD */
105 HDMI_SPD_TYPE_PMP /**<Personal media player */
106 } HDMI_SPD_TYPE_CODE_T;
107
108 /**
109 * Structure for SPD infoframe
110 */
111 typedef struct {
112 char *manufacturer; /**< Manufacture name (up to 8 characters) */
113 char *description; /**< Product name (up to 16 characters) */
114 HDMI_SPD_TYPE_CODE_T type; /**< Product type */
115 } HDMI_SPD_DATA_T;
116
117 /**
118 * These are CEA mode numbers (sent in AVI infoframe) for different resolutions as define in CEA-861
119 * 1080i at 100/120Hz (40,46) are supported by HDMI H/W but note we cannot
120 * display the debug overlay under these modes.
121 * Some modes have two codes, the first one has aspect ratio 4:3 and
122 * the second one (with "H" suffix") 16:9.
123 * The modes with "4x", etc. are the same the corresponding "non-multiplied" modes
124 * but clocked at a higher pixel clock.
125 */
126 typedef enum {
127 HDMI_CEA_VGA = 1,
128 HDMI_CEA_480p60 = 2,
129 HDMI_CEA_480p60H = 3,
130 HDMI_CEA_720p60 = 4,
131 HDMI_CEA_1080i60 = 5,
132 HDMI_CEA_480i60 = 6,
133 HDMI_CEA_480i60H = 7,
134 HDMI_CEA_240p60 = 8,
135 HDMI_CEA_240p60H = 9,
136 HDMI_CEA_480i60_4x = 10,
137 HDMI_CEA_480i60_4xH = 11,
138 HDMI_CEA_240p60_4x = 12,
139 HDMI_CEA_240p60_4xH = 13,
140 HDMI_CEA_480p60_2x = 14,
141 HDMI_CEA_480p60_2xH = 15,
142 HDMI_CEA_1080p60 = 16,
143 HDMI_CEA_576p50 = 17,
144 HDMI_CEA_576p50H = 18,
145 HDMI_CEA_720p50 = 19,
146 HDMI_CEA_1080i50 = 20,
147 HDMI_CEA_576i50 = 21,
148 HDMI_CEA_576i50H = 22,
149 HDMI_CEA_288p50 = 23,
150 HDMI_CEA_288p50H = 24,
151 HDMI_CEA_576i50_4x = 25,
152 HDMI_CEA_576i50_4xH = 26,
153 HDMI_CEA_288p50_4x = 27,
154 HDMI_CEA_288p50_4xH = 28,
155 HDMI_CEA_576p50_2x = 29,
156 HDMI_CEA_576p50_2xH = 30,
157 HDMI_CEA_1080p50 = 31,
158 HDMI_CEA_1080p24 = 32,
159 HDMI_CEA_1080p25 = 33,
160 HDMI_CEA_1080p30 = 34,
161 HDMI_CEA_480p60_4x = 35,
162 HDMI_CEA_480p60_4xH = 36,
163 HDMI_CEA_576p50_4x = 37,
164 HDMI_CEA_576p50_4xH = 38,
165 HDMI_CEA_1080i50_rb = 39,
166 HDMI_CEA_1080i100 = 40,
167 HDMI_CEA_720p100 = 41,
168 HDMI_CEA_576p100 = 42,
169 HDMI_CEA_576p100H = 43,
170 HDMI_CEA_576i100 = 44,
171 HDMI_CEA_576i100H = 45,
172 HDMI_CEA_1080i120 = 46,
173 HDMI_CEA_720p120 = 47,
174 HDMI_CEA_480p120 = 48,
175 HDMI_CEA_480p120H = 49,
176 HDMI_CEA_480i120 = 50,
177 HDMI_CEA_480i120H = 51,
178 HDMI_CEA_576p200 = 52,
179 HDMI_CEA_576p200H = 53,
180 HDMI_CEA_576i200 = 54,
181 HDMI_CEA_576i200H = 55,
182 HDMI_CEA_480p240 = 56,
183 HDMI_CEA_480p240H = 57,
184 HDMI_CEA_480i240 = 58,
185 HDMI_CEA_480i240H = 59,
186 HDMI_CEA_720p24 = 60,
187 HDMI_CEA_720p25 = 61,
188 HDMI_CEA_720p30 = 62,
189 HDMI_CEA_1080p120 = 63,
190 HDMI_CEA_1080p100 = 64,
191
192 //Up-to-date as of CEA 861-E
193
194 HDMI_CEA_OFF = 0xff /**<Special code to shutdown HDMI */
195
196 } HDMI_CEA_RES_CODE_T;
197
198 /**
199 * These are the DMT modes from VESA. They are used for powering up
200 * HDMI in DMT resolutions and are not sent in AVI infoframes.
201 * Enum is ordered as ascending order of DMT id.
202 * All reduced blanking formats are 60Hz unless stated otherwise.
203 */
204 typedef enum {
205 HDMI_DMT_640x350_85 = 0x1, /**<640x350 */
206 HDMI_DMT_640x400_85 = 0x2, /**<640x400 */
207 HDMI_DMT_IBM_VGA_85 = 0x3, /**<720x400 */
208 HDMI_DMT_VGA_60 = 0x4, /**<640x480 (60Hz is same as VGA above) */
209 HDMI_DMT_VGA_72 = 0x5,
210 HDMI_DMT_VGA_75 = 0x6,
211 HDMI_DMT_VGA_85 = 0x7,
212 HDMI_DMT_SVGA_56 = 0x8, /**<800x600 */
213 HDMI_DMT_SVGA_60 = 0x9,
214 HDMI_DMT_SVGA_72 = 0xA,
215 HDMI_DMT_SVGA_75 = 0xB,
216 HDMI_DMT_SVGA_85 = 0xC,
217 HDMI_DMT_SVGA_120 = 0xD,
218 HDMI_DMT_848x480_60 = 0xE, /**<848x480 */
219 HDMI_DMT_XGA_43 = 0xF, /**<1024x768 - interlaced, DO NOT USE */
220 HDMI_DMT_XGA_60 = 0x10, /**<1024x768 */
221 HDMI_DMT_XGA_70 = 0x11,
222 HDMI_DMT_XGA_75 = 0x12,
223 HDMI_DMT_XGA_85 = 0x13,
224 HDMI_DMT_XGA_120 = 0x14,
225 HDMI_DMT_XGAP_75 = 0x15, /**<1152x864 */
226 HDMI_DMT_WXGA_RB = 0x16, /**<1280x768 reduced blanking */
227 HDMI_DMT_WXGA_60 = 0x17,
228 HDMI_DMT_WXGA_75 = 0x18,
229 HDMI_DMT_WXGA_85 = 0x19,
230 HDMI_DMT_WXGA_120 = 0x1A, /**<120Hz with reduced blanking */
231 HDMI_DMT_1280x800_RB = 0x1B, /**<1280x800 reduced blanking */
232 HDMI_DMT_1280x800_60 = 0x1C,
233 HDMI_DMT_1280x800_75 = 0x1D,
234 HDMI_DMT_1280x800_85 = 0x1E,
235 HDMI_DMT_1280x800_120 = 0x1F, /** reduced blanking */
236 HDMI_DMT_1280x960_60 = 0x20, /**<1280x960 */
237 HDMI_DMT_1280x960_85 = 0x21,
238 HDMI_DMT_1280x960_120 = 0x22, /** reduced blanking */
239 HDMI_DMT_SXGA_60 = 0x23, /**<1280x1024 */
240 HDMI_DMT_SXGA_75 = 0x24,
241 HDMI_DMT_SXGA_85 = 0x25,
242 HDMI_DMT_SXGA_120 = 0x26, /** reduced blanking */
243 HDMI_DMT_1360x768_60 = 0x27, /**<1360x768 */
244 HDMI_DMT_1360x768_120 = 0x28, /**<120 Hz with reduced blanking */
245 HDMI_DMT_SXGAP_RB = 0x29, /**<1400x1050 reduced blanking */
246 HDMI_DMT_SXGAP_60 = 0x2A,
247 HDMI_DMT_SXGAP_75 = 0x2B,
248 HDMI_DMT_SXGAP_85 = 0x2C,
249 HDMI_DMT_SXGAP_120 = 0x2D, /** reduced blanking */
250 HDMI_DMT_1440x900_RB = 0x2E, /**<1440x900 reduced blanking */
251 HDMI_DMT_1440x900_60 = 0x2F,
252 HDMI_DMT_1440x900_75 = 0x30,
253 HDMI_DMT_1440x900_85 = 0x31,
254 HDMI_DMT_1440x900_120 = 0x32, /** reduced blanking */
255 HDMI_DMT_UXGA_60 = 0x33, /**<1600x1200 60Hz */
256 HDMI_DMT_UXGA_65 = 0x34,
257 HDMI_DMT_UXGA_70 = 0x35,
258 HDMI_DMT_UXGA_75 = 0x36,
259 HDMI_DMT_UXGA_85 = 0x37,
260 HDMI_DMT_UXGA_120 = 0x38, /** reduced blanking */
261 HDMI_DMT_SWXGAP_RB = 0x39, /**<1680x1050 reduced blanking */
262 HDMI_DMT_SWXGAP_60 = 0x3A, /**<1680x1050 60Hz */
263 HDMI_DMT_SWXGAP_75 = 0x3B,
264 HDMI_DMT_SWXGAP_85 = 0x3C,
265 HDMI_DMT_SWXGAP_120 = 0x3D, /** reduced blanking */
266 HDMI_DMT_1792x1344_60 = 0x3E, /**<1792x1344 60Hz */
267 HDMI_DMT_1792x1344_75 = 0x3F, /**<1792x1344 75Hz */
268 HDMI_DMT_1792x1344_120 = 0x40, /** reduced blanking */
269 HDMI_DMT_1856x1392_60 = 0x41, /**<1856x1392 60Hz */
270 HDMI_DMT_1856x1392_75 = 0x42, /**<1856x1392 75Hz */
271 HDMI_DMT_1856x1392_120 = 0x43, /** reduced blanking */
272 HDMI_DMT_WUXGA_RB = 0x44, /**<1920x1200 reduced blanking */
273 HDMI_DMT_WUXGA_60 = 0x45, /**<1920x1200 60Hz */
274 HDMI_DMT_WUXGA_75 = 0x46, /**<1920x1200 75Hz */
275 HDMI_DMT_WUXGA_85 = 0x47, /**<1920x1200 85Hz */
276 HDMI_DMT_WUXGA_120 = 0x48, /** reduced blanking */
277 HDMI_DMT_1920x1440_60 = 0x49, /**<1920x1440 60Hz */
278 HDMI_DMT_1920x1440_75 = 0x4A, /**<1920x1440 75Hz */
279 HDMI_DMT_1920x1440_120 = 0x4B, /** reduced blanking */
280 HDMI_DMT_2560x1600_RB = 0x4C, /**<2560x1600 reduced blanking */
281 HDMI_DMT_2560x1600_60 = 0x4D, /**<2560x1600 60 Hz */
282 HDMI_DMT_2560x1600_75 = 0x4E, /**<2560x1600 75 Hz */
283 HDMI_DMT_2560x1600_85 = 0x4E, /**<2560x1600 85 Hz */
284 HDMI_DMT_2560x1600_120 = 0x50, /** reduced blanking */
285 HDMI_DMT_1366x768_60 = 0x51, /**<1366x768 60Hz */
286 HDMI_DMT_1080p_60 = 0x52, /**<Same as 1080p60 above */
287 HDMI_DMT_1600x900_RB = 0x53, /**<1600x900 reduced blanking */
288 HDMI_DMT_2048x1152_RB = 0x54, /**<2048x1152 reduced blanking */
289 HDMI_DMT_720p_60 = 0x55, /**<Same as 720p60 above */
290 HDMI_DMT_1366x768_RB = 0x56, /**<1366x768 reduced blanking */
291 //Up-to-date as of VESA DMT v1 r12
292
293 HDMI_DMT_OFF = 0xff
294 } HDMI_DMT_RES_CODE_T;
295
296 /**
297 * HDMI scanmode
298 */
299 typedef enum {
300 HDMI_NONINTERLACED,
301 HDMI_INTERLACED
302 } HDMI_INTERLACED_T;
303
304 /**
305 * Preference for powering up HDMI using best mode
306 * Note we will only use CEA modes for matching
307 */
308 typedef enum {
309 HDMI_MODE_MATCH_NONE = 0x0, /**<No mode*/
310 HDMI_MODE_MATCH_FRAMERATE = 0x1, /**<Match based on frame rate */
311 HDMI_MODE_MATCH_RESOLUTION = 0x2, /**<Match based on resolution */
312 HDMI_MODE_MATCH_SCANMODE = 0x4 /**<Match based on scan mode */
313 } EDID_MODE_MATCH_FLAG_T;
314
315 /**
316 * Audio support flags
317 */
318 typedef enum {
319 EDID_AUDIO_NO_SUPPORT = (1 << 0), /**<No support for that format */
320 EDID_AUDIO_CHAN_UNSUPPORTED = (1 << 1), /**<max. no. of channels exceeded */
321 EDID_AUDIO_FS_UNSUPPORTED = (1 << 2), /**<no support for that sampling frequency */
322 EDID_AUDIO_BR_UNSUPPORTED = (1 << 3), /**<max. bitrate exceeded */
323 EDID_AUDIO_SAMP_UNSUPPORTED = (1 << 4), /**sample size unsupported (pcm only) */
324 } EDID_AUDIO_SUPPORT_FLAG_T;
325
326 /**
327 * Enums for audio support in audio descriptor block (CEA only)
328 * audio formats as specified in CEA Short Audio Descriptors
329 */
330 typedef enum {
331 EDID_AudioFormat_eReserved, /**<Refer to header when set in audio info frame */
332 EDID_AudioFormat_ePCM, /**<Plain old PCM, mandatory for any audio support */
333 EDID_AudioFormat_eAC3, /**<AC3 */
334 EDID_AudioFormat_eMPEG1, /**<Mpeg layer 1 and 2 */
335 EDID_AudioFormat_eMP3, /**<Mpeg layer 3 */
336 EDID_AudioFormat_eMPEG2, /**<Mpeg 2 audio */
337 EDID_AudioFormat_eAAC, /**<AAC */
338 EDID_AudioFormat_eDTS, /**<DTS */
339 EDID_AudioFormat_eATRAC, /**<Sony proprietary */
340 EDID_AudioFormat_eDSD, /**<Super Audio CD 1-bit audio */
341 EDID_AudioFormat_eEAC3, /**<Dolby Digital + */
342 EDID_AudioFormat_eDTS_HD, /**<DTS-HD */
343 EDID_AudioFormat_eMLP, /**<Meridian Lossless Packing - for DVD audio */
344 EDID_AudioFormat_eDST, /**<Direct stream transfer - compressed super audio CD */
345 EDID_AudioFormat_eWMAPRO, /**<WMA Pro */
346 EDID_AudioFormat_eExtended, /**<Refer to byte 3 of audio db for coding extension type */
347
348 EDID_AudioFormat_eMaxCount
349 } EDID_AudioFormat;
350
351 /**
352 * If audio format is set to EDID_AudioFormat_eExtended,
353 * this gives the extended audio type (see CEA-861E section 6.6.1)
354 */
355 typedef enum {
356 EDID_AudioCodingExtension_NONE = 0x0, /** no extension, for audio format != Extended */
357 EDID_AudioCodingExtension_HEAAC = 0x1, /**<HE-AAC */
358 EDID_AudioCodingExtension_HEAAC2 = 0x2, /**<HE-AAC v2 */
359 EDID_AudioCodingExtension_MPEGSUR = 0x3, /**<MPEG Surround */
360
361 EDID_AudioCodingExtension_max
362 } EDID_AudioCodingExtension;
363
364 /**
365 * Audio sample rates as specified in CEA Short Audio Descriptors
366 */
367 typedef enum {
368 EDID_AudioSampleRate_eReferToHeader = 0x0, /**<Only used in audio infoframe */
369 EDID_AudioSampleRate_e32KHz = (1 << 0), /**<32 kHz (mandatory) */
370 EDID_AudioSampleRate_e44KHz = (1 << 1), /**<44.1 kHz (mandatory) */
371 EDID_AudioSampleRate_e48KHz = (1 << 2), /**<48kHz (mandatory) */
372 EDID_AudioSampleRate_e88KHz = (1 << 3), /**<88.2 kHz */
373 EDID_AudioSampleRate_e96KHz = (1 << 4), /**<96kHz */
374 EDID_AudioSampleRate_e176KHz = (1 << 5), /**<176.4 kHz */
375 EDID_AudioSampleRate_e192KHz = (1 << 6) /**<192 kHz */
376 } EDID_AudioSampleRate;
377
378 /**
379 * Audio sample sizes (L-PCM) as specified in CEA Short Audio Descriptors
380 */
381 typedef enum {
382 EDID_AudioSampleSize_refertoheader = 0x0, /**<Only used in audio infoframe */
383 EDID_AudioSampleSize_16bit = 0x1, /**<16-bit samples (mandatory) */
384 EDID_AudioSampleSize_20bit = 0x2, /**<20-bit samples */
385 EDID_AudioSampleSize_24bit = 0x4 /**<24-bit samples */
386 } EDID_AudioSampleSize;
387
388 /**
389 * LFE feedback level as described in audio db
390 */
391 typedef enum {
392 EDID_AudioLFEFB_UNKNOWN = 0x0, /**<Refer to other information */
393 EDID_AudioLFEFB_0dB = 0x1, /**<0dB - same level as other channels */
394 EDID_AudioLFEFB_10dB = 0x2 /**<+10dB relative to other channels */
395 } EDID_AudioLFEFB;
396
397 /**
398 * HDMI notifications (defined as a bit mask to be conveniently returned as a state),
399 * make sure this does not clash with the values in vc_sdtv.h
400 * SDTV notifications start at bit 16.
401 * These values are returned by the TV service in a callback.
402 */
403 typedef enum {
404 VC_HDMI_UNPLUGGED = (1 << 0), /**<HDMI cable is detached */
405 VC_HDMI_STANDBY = (1 << 1), /**<HDMI cable is attached but not powered on */
406 VC_HDMI_DVI = (1 << 2), /**<HDMI is on but in DVI mode (no audio) */
407 VC_HDMI_HDMI = (1 << 3), /**<HDMI is on and HDMI mode is active */
408 VC_HDMI_HDCP_UNAUTH = (1 << 4), /**<HDCP authentication is broken (e.g. Ri mismatched) or not active */
409 VC_HDMI_HDCP_AUTH = (1 << 5), /**<HDCP is active */
410 VC_HDMI_HDCP_KEY_DOWNLOAD = (1 << 6), /**<HDCP key download successful/fail */
411 VC_HDMI_HDCP_SRM_DOWNLOAD = (1 << 7), /**<HDCP revocation list download successful/fail */
412 VC_HDMI_CHANGING_MODE = (1 << 8), /**<HDMI is starting to change mode, clock has not yet been set */
413
414 } VC_HDMI_NOTIFY_T;
415 ]]
416
417 --[[
418 /**
419 * Callback reason and arguments from HDMI middleware
420 * Each callback comes with two optional uint32_t parameters.
421 * Reason param1 param2 remark
422 * VC_HDMI_UNPLUGGED - - cable is unplugged
423 * VC_HDMI_STANDBY CEA/DMT mode code cable is plugged in and peripheral powered off (preferred mode sent back if available)
424 * VC_HDMI_DVI CEA/DMT mode code DVI mode is active at said resolution
425 * VC_HDMI_HDMI CEA(3D)/DMT mode code HDMI mode is active at said resolution (in 3D mode if CEA3D)
426 * VC_HDMI_HDCP_UNAUTH HDCP_ERROR_T retry? HDCP is inactive, the error can be none if we actively disable HDCP, if retry is non-zero, HDCP will attempt to reauthenticate
427 * VC_HDMI_HDCP_AUTH - - HDCP is active
428 * VC_HDMI_HDCP_KEY_DOWNLOAD success? - HDCP key download success (zero) or not (non zero)
429 * VC_HDMI_HDCP_SRM_DOWNLOAD no. of keys - HDCP revocation list download set no. of keys (zero means failure)
430 * VC_HDMI_CHANGING_MODE 0 0 No information is supplied in this callback
431 */
432 --]]
433
09324a4 @Wiladams modified: bcm_host.lua
authored
434 ffi.cdef[[
435 // Some constants which are required on host side
436 static const int HDCP_KEY_BLOCK_SIZE = 328; // KSV, padding, device keys and hash.
437 static const int HDCP_KSV_LENGTH = 5;
438 static const int HDCP_MAX_DEVICE = 127; // Max. number of HDCP downstream device supported
439 static const int HDCP_MAX_DEPTH = 7; // Max. number of levels HDCP 1.x can have
440 static const int EDID_BLOCKSIZE = 128;
441 static const int HDMI_NUM_PACKET_BYTES = 28; // Size of HDMI infoframes minus the header
442 ]]
41a6c9f @Wiladams Many changes for hdmi and tv_service
authored
443 -- All CEC related constants now reside in vc_cec.h
444
445 ffi.cdef[[
446 /**
447 * General callback function for both HDMI and HDCP middleware
448 * reason is the notification nature
449 * param1 and param2 have different meanings depending on the notification (see above)
450 *
451 * @param client_p is the callback context
452 *
453 * @param reason is the callback reason
454 *
455 * @param param1 is the first callback argument (meaning as above)
456 *
457 * @param param2 is the second callback argument (meaning as above)
458 *
459 * @return void
460 */
461 typedef void (*HDMI_CALLBACK_T)(void *client_p, VC_HDMI_NOTIFY_T reason, uint32_t param1, uint32_t param2);
462
463 //TV service error return code
464 typedef enum {
465 VC_HDMI_SUCCESS = 0, /** OK */
466 VC_HDMI_ERROR_FORMAT_UNSUPPORTED = 1, /** format not supported */
467 VC_HDMI_ERROR_INVALID_FORMAT = 2, /** invalid format */
468 VC_HDMI_ERROR_INVALID_PROPERTY = 3, /** invalid property */
469 VC_HDMI_ERROR_OUT_OF_RANGE = 4, /** invalid values passed to set property */
470 VC_HDMI_ERROR_INVALID_INFOFRAME = 5, /** invalid infoframe */
471 } VC_HDMI_ERROR_T;
472
473 //Defines for backward code compatibilty (these were originally in hdmi.h)
474 typedef VC_HDMI_ERROR_T HDMI_RESULT_T;
475 ]]
476
477 HDMI_RESULT_SUCCESS = ffi.C.VC_HDMI_SUCCESS;
478 HDMI_RESULT_FAILED = ffi.C.VC_HDMI_ERROR_FORMAT_UNSUPPORTED;
479
09324a4 @Wiladams modified: bcm_host.lua
authored
480 HDMI_DISPLAY_OPTIONS_T = ffi.typeof("HDMI_DISPLAY_OPTIONS_T");
481
482 HDMI_SPD_DATA_T = ffi.typeof("HDMI_SPD_DATA_T");
483
41a6c9f @Wiladams Many changes for hdmi and tv_service
authored
484
Something went wrong with that request. Please try again.