|
1 /* |
|
2 * Copyright (c) 2008,2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Declaration of CEdidParserBase class. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef C_CEDIDPARSERBASE_H |
|
20 #define C_CEDIDPARSERBASE_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 #include "ediddatatypes.h" |
|
25 |
|
26 // FORWARD DECLERATION |
|
27 class CCea861EdidParser; |
|
28 |
|
29 |
|
30 /** |
|
31 * CEdidParserBase is the base class for parsing EDID data |
|
32 * |
|
33 * @lib edidparser.dll |
|
34 * @since S60 v9.2 |
|
35 */ |
|
36 NONSHARABLE_CLASS( CEdidParserBase ): public CBase |
|
37 { |
|
38 public: |
|
39 |
|
40 /** |
|
41 * Two-phased constructor. |
|
42 * Creates an instance of CEdidParserBase |
|
43 * |
|
44 * @param aData |
|
45 * @return CEdidParserBase* created instance of CEdidParserBase |
|
46 */ |
|
47 IMPORT_C static CEdidParserBase* NewL( const TDesC8& aBinaryData ); |
|
48 |
|
49 /** |
|
50 * Two-phased constructor. |
|
51 * Creates an instance of CEdidParserBase |
|
52 * |
|
53 * @param aData |
|
54 * @return CEdidParserBase* created instance of CEdidParserBase |
|
55 */ |
|
56 IMPORT_C static CEdidParserBase* NewLC( const TDesC8& aBinaryData ); |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 virtual ~CEdidParserBase(); |
|
62 |
|
63 |
|
64 public: |
|
65 |
|
66 /** |
|
67 * Checks if data is valid EDID data |
|
68 * |
|
69 * @since S60 9.2 |
|
70 * @param aBinaryData (EDID data block) |
|
71 * @return TBool |
|
72 */ |
|
73 IMPORT_C TBool IsEdidData( const TDesC8& aBinaryData ); |
|
74 |
|
75 /** |
|
76 * Gets manufacturer code from EDID data. |
|
77 * Manufacturer PNPIDs are issued by Microsoft |
|
78 * |
|
79 * @since S60 9.2 |
|
80 * @param aCode |
|
81 * @return none |
|
82 */ |
|
83 IMPORT_C void GetManufacturerCode( TDes& aCode ); |
|
84 |
|
85 /** |
|
86 * Gets product id from EDID data. |
|
87 * |
|
88 * @since S60 9.2 |
|
89 * @param aCode |
|
90 * @return none |
|
91 */ |
|
92 IMPORT_C void GetProductId( TDes& aCode ); |
|
93 |
|
94 /** |
|
95 * Gets week of manufacture from EDID data. |
|
96 * |
|
97 * @since S60 9.2 |
|
98 * @param none |
|
99 * @return TUint16 |
|
100 */ |
|
101 IMPORT_C TUint8 GetManufactureWeek(); |
|
102 |
|
103 /** |
|
104 * Gets year of manufacture from EDID data. |
|
105 * Year of manufacture stored in EDID data is "Year of Manufacture - 1990" |
|
106 * |
|
107 * @since S60 9.2 |
|
108 * @param none |
|
109 * @return TUint16 |
|
110 */ |
|
111 IMPORT_C TUint16 GetManufactureYear(); |
|
112 |
|
113 /** |
|
114 * Gets EDID version from data block |
|
115 * |
|
116 * @since S60 9.2 |
|
117 * @param none |
|
118 * @return EDID version (TUint8) |
|
119 */ |
|
120 IMPORT_C TUint8 GetVersion(); |
|
121 |
|
122 /** |
|
123 * Gets EDID revision from data block |
|
124 * |
|
125 * @since S60 9.2 |
|
126 * @param none |
|
127 * @return EDID revision (TUint8) |
|
128 */ |
|
129 IMPORT_C TUint8 GetRevision(); |
|
130 |
|
131 /** |
|
132 * Gets Video Input Definition block |
|
133 * Bit #8 indicates if input is analog or digital |
|
134 * |
|
135 * @since S60 9.2 |
|
136 * @param none |
|
137 * @return Video Input Definition data |
|
138 */ |
|
139 IMPORT_C TUint8 GetVideoInputDefinition(); |
|
140 |
|
141 /** |
|
142 * Gets horizontal screen size |
|
143 * Range is between 1-255 cm |
|
144 * |
|
145 * @since S60 9.2 |
|
146 * @param none |
|
147 * @return Horizontal screen size in cm |
|
148 */ |
|
149 IMPORT_C TUint8 GetHorizontalScreenSize(); |
|
150 |
|
151 /** |
|
152 * Gets vertical screen size |
|
153 * Range is between 1-255 cm |
|
154 * |
|
155 * @since S60 9.2 |
|
156 * @param none |
|
157 * @return Vertical screen size in cm |
|
158 */ |
|
159 IMPORT_C TUint8 GetVerticalScreenSize(); |
|
160 |
|
161 |
|
162 /** |
|
163 * Gets aspect ratio |
|
164 * |
|
165 * @since S60 9.2 |
|
166 * @param none |
|
167 * @return TUint8 (aspect ratio landscape value) |
|
168 */ |
|
169 IMPORT_C TUint8 GetAspectRatioLandscape(); |
|
170 |
|
171 |
|
172 /** |
|
173 * Gets aspect ratio |
|
174 * |
|
175 * @since S60 9.2 |
|
176 * @param none |
|
177 * @return TUint8 (aspect ratio landscape value) |
|
178 */ |
|
179 IMPORT_C TUint8 GetAspectRatioPortrait(); |
|
180 |
|
181 |
|
182 /** |
|
183 * Returns true/false depending on Aspect Ratio is used |
|
184 * |
|
185 * If byte 15h != 00h then byte 16h = Vertical Screen Size in cm. |
|
186 * (Range is 1 cm -> 255 cm) |
|
187 * If byte 15h == 00h then byte 16h = Aspect Ratio (Portrait) |
|
188 * (Range is 0.28 : 1 AR -> 0.99 : 1 AR) |
|
189 * |
|
190 * If byte 16h != 00h then byte 15h = Horizontal Screen Size in cm. |
|
191 * (Range is 1 cm -> 255 cm) |
|
192 * If byte 16h == 00h then byte 15h = Aspect Ratio (Landscape) |
|
193 * (Range is 1 : 1 AR -> 3.54 : 1 AR) |
|
194 * |
|
195 * @since S60 9.2 |
|
196 * @param none |
|
197 * @return ETrue (Aspect Ratio is used) EFalse (Aspect Ratio is not used) |
|
198 */ |
|
199 IMPORT_C TBool IsAspectRatioUsed(); |
|
200 |
|
201 /** |
|
202 * Gets Display Transfer Characteristics |
|
203 * Gamma value = ( dec( Display Transfer Characteristics ) + 100 )/100 |
|
204 * Gamma value range is from 1.00 -> 3.54 |
|
205 * |
|
206 * @since S60 9.2 |
|
207 * @param none |
|
208 * @return Vertical screen size in cm |
|
209 */ |
|
210 IMPORT_C TUint8 DisplayTransferCharacteristics(); |
|
211 |
|
212 /** |
|
213 * Gets red x chromaticity coordinate |
|
214 * |
|
215 * @since S60 9.2 |
|
216 * @param none |
|
217 * @return Red x chromaticity coordinate |
|
218 */ |
|
219 IMPORT_C TUint16 GetColorCoordinatesRedX(); |
|
220 |
|
221 /** |
|
222 * Gets red y chromaticity coordinate |
|
223 * |
|
224 * @since S60 9.2 |
|
225 * @param none |
|
226 * @return Red y chromaticity coordinate |
|
227 */ |
|
228 IMPORT_C TUint16 GetColorCoordinatesRedY(); |
|
229 |
|
230 /** |
|
231 * Gets green x chromaticity coordinate |
|
232 * |
|
233 * @since S60 9.2 |
|
234 * @param none |
|
235 * @return Green x chromaticity coordinate |
|
236 */ |
|
237 IMPORT_C TUint16 GetColorCoordinatesGreenX(); |
|
238 |
|
239 /** |
|
240 * Gets green y chromaticity coordinate |
|
241 * |
|
242 * @since S60 9.2 |
|
243 * @param none |
|
244 * @return Green y chromaticity coordinate |
|
245 */ |
|
246 IMPORT_C TUint16 GetColorCoordinatesGreenY(); |
|
247 |
|
248 /** |
|
249 * Gets blue x chromaticity coordinate |
|
250 * |
|
251 * @since S60 9.2 |
|
252 * @param none |
|
253 * @return Blue x chromaticity coordinate |
|
254 */ |
|
255 IMPORT_C TUint16 GetColorCoordinatesBlueX(); |
|
256 |
|
257 /** |
|
258 * Gets blue y chromaticity coordinate |
|
259 * |
|
260 * @since S60 9.2 |
|
261 * @param none |
|
262 * @return Blue y chromaticity coordinate |
|
263 */ |
|
264 IMPORT_C TUint16 GetColorCoordinatesBlueY(); |
|
265 |
|
266 /** |
|
267 * Gets white x chromaticity coordinate |
|
268 * |
|
269 * @since S60 9.2 |
|
270 * @param none |
|
271 * @return White x chromaticity coordinate |
|
272 */ |
|
273 IMPORT_C TUint16 GetColorCoordinatesWhiteX(); |
|
274 |
|
275 /** |
|
276 * Gets white y chromaticity coordinate |
|
277 * |
|
278 * @since S60 9.2 |
|
279 * @param none |
|
280 * @return White y chromaticity coordinate |
|
281 */ |
|
282 IMPORT_C TUint16 GetColorCoordinatesWhiteY(); |
|
283 |
|
284 /** |
|
285 * Gets Established Timings 1 |
|
286 * EEDID standatrd R3EDID Plug & Play compliant displays shall show |
|
287 * support for the BASE VIDEO MODE (640 × 480 @ 60Hz) and shall |
|
288 * indicate support in the Established Timing I data field |
|
289 * |
|
290 * @since S60 9.2 |
|
291 * @param none |
|
292 * @return Bits for Established Timings 1 |
|
293 */ |
|
294 IMPORT_C TUint8 GetEstablishedTimings1(); |
|
295 |
|
296 /** |
|
297 * Gets Established Timings 2 |
|
298 * |
|
299 * @since S60 9.2 |
|
300 * @param none |
|
301 * @return Bits for Established Timings 2 |
|
302 */ |
|
303 IMPORT_C TUint8 GetEstablishedTimings2(); |
|
304 |
|
305 /** |
|
306 * Gets Manufacturer Timings |
|
307 * |
|
308 * @since S60 9.2 |
|
309 * @param none |
|
310 * @return Bits for Manufacturer Timings |
|
311 */ |
|
312 IMPORT_C TUint8 GetManufacturerTimings(); |
|
313 |
|
314 /** |
|
315 * Gets standard timings. |
|
316 * |
|
317 * @param aIndex Byte between 0-15. |
|
318 * @return Bits for selected byte |
|
319 */ |
|
320 IMPORT_C TUint8 GetStandardTimings( TInt aIndex ); |
|
321 |
|
322 /** |
|
323 * Gets descriptor block |
|
324 * |
|
325 * @since S60 9.2 |
|
326 * @param aDescriptorBlockNumber |
|
327 * @return Desriptor block |
|
328 */ |
|
329 IMPORT_C TEdidDescriptorBlock GetDescriptorBlock( TUint8 aDescriptorBlockNumber ) const; |
|
330 |
|
331 /** |
|
332 * Gets number of extensions |
|
333 * |
|
334 * @since S60 9.2 |
|
335 * @param none |
|
336 * @return Number of extensions |
|
337 */ |
|
338 IMPORT_C TUint8 GetNumberOfExtensions(); |
|
339 |
|
340 /** |
|
341 * Reads extension block. |
|
342 * Block number 1 = first extension block, .. |
|
343 * Data is copied to iExtensionData |
|
344 * |
|
345 * @since S60 9.2 |
|
346 * @param aNumber - Extension number |
|
347 * @return Possible return values: |
|
348 * KErrNone Extension read succesfully |
|
349 * KErrNotSupported Extension not supported |
|
350 */ |
|
351 IMPORT_C TInt ReadExtension( TInt aNumber ); |
|
352 |
|
353 /** |
|
354 * Gets extension type |
|
355 * See TEdidExtensionTagCode |
|
356 * |
|
357 * @since S60 9.2 |
|
358 * @param aNumber - Extension number |
|
359 * @return TEdidExtensionTagCode |
|
360 */ |
|
361 IMPORT_C TEdidExtensionTagCode GetExtensionType( TInt aNumber ); |
|
362 |
|
363 /** |
|
364 * Creates CEA 861 extension parser |
|
365 * |
|
366 * @since S60 9.2 |
|
367 * @param aNumber - Extension number |
|
368 * @return CCea861EdidParser* (Pointer to the parser object) |
|
369 */ |
|
370 IMPORT_C CCea861EdidParser* CreateCea861ExtensionParserL( TInt aNumber ); |
|
371 |
|
372 /** |
|
373 * Gets checksum value |
|
374 * |
|
375 * @since S60 9.2 |
|
376 * @param none |
|
377 * @return Checksum value |
|
378 */ |
|
379 IMPORT_C TUint8 GetChecksum(); |
|
380 |
|
381 private: |
|
382 |
|
383 /** |
|
384 * Default constructor. |
|
385 */ |
|
386 CEdidParserBase(); |
|
387 |
|
388 /** |
|
389 * By default Symbian 2nd phase constructor is private. |
|
390 */ |
|
391 void ConstructL( const TDesC8& aBinaryData ); |
|
392 |
|
393 /** |
|
394 * Gets pixel clock from descriptor block |
|
395 * |
|
396 * @since S60 9.2 |
|
397 * @param aDataBlockNumber |
|
398 * @return TUint16 |
|
399 */ |
|
400 TUint16 GetPixelClock( TUint8 aDataBlockNumber ) const; |
|
401 |
|
402 /** |
|
403 * Gets Horizontal Addressable Video in pixels |
|
404 * |
|
405 * @since S60 9.2 |
|
406 * @param aDataBlockNumber |
|
407 * @return TUint16 |
|
408 */ |
|
409 TUint16 GetHorizontalAddressableVideo( TUint8 aDataBlockNumber ) const; |
|
410 |
|
411 /** |
|
412 * Gets Horizontal Blanking in pixels |
|
413 * |
|
414 * @since S60 9.2 |
|
415 * @param aDataBlockNumber |
|
416 * @return TUint16 |
|
417 */ |
|
418 TUint16 GetHorizontalBlanking( TUint8 aDataBlockNumber ) const; |
|
419 |
|
420 /** |
|
421 * Gets Vertical Addressable Video in lines |
|
422 * |
|
423 * @since S60 9.2 |
|
424 * @param aDataBlockNumber |
|
425 * @return TUint16 |
|
426 */ |
|
427 TUint16 GetVerticalAddressableVideo( TUint8 aDataBlockNumber ) const; |
|
428 |
|
429 /** |
|
430 * Gets Vertical Blanking in lines |
|
431 * |
|
432 * @since S60 9.2 |
|
433 * @param aDataBlockNumber |
|
434 * @return TUint16 |
|
435 */ |
|
436 TUint16 GetVerticalBlanking( TUint8 aDataBlockNumber ) const; |
|
437 |
|
438 /** |
|
439 * Gets Horizontal Front Porch in pixels |
|
440 * |
|
441 * @since S60 9.2 |
|
442 * @param aDataBlockNumber |
|
443 * @return TUint16 |
|
444 */ |
|
445 TUint16 GetHorizontalFrontPorch( TUint8 aDataBlockNumber ) const; |
|
446 |
|
447 /** |
|
448 * Gets Horizontal Sync Pulse Width in lines |
|
449 * |
|
450 * @since S60 9.2 |
|
451 * @param aDataBlockNumber |
|
452 * @return TUint16 |
|
453 */ |
|
454 TUint16 GetHorizontalSyncPulseWidth( TUint8 aDataBlockNumber ) const; |
|
455 |
|
456 /** |
|
457 * Gets Vertical Front Porch in lines |
|
458 * |
|
459 * @since S60 9.2 |
|
460 * @param aDataBlockNumber |
|
461 * @return TUint16 |
|
462 */ |
|
463 TUint16 GetVerticalFrontPorch( TUint8 aDataBlockNumber ) const; |
|
464 |
|
465 /** |
|
466 * Gets Vertical Sync Pulse Width in lines |
|
467 * |
|
468 * @since S60 9.2 |
|
469 * @param aDataBlockNumber |
|
470 * @return TUint16 |
|
471 */ |
|
472 TUint8 GetVerticalSyncPulseWidth( TUint8 aDataBlockNumber ) const; |
|
473 |
|
474 /** |
|
475 * Gets Horizontal Addresable Image Size |
|
476 * |
|
477 * @since S60 9.2 |
|
478 * @param aDataBlockNumber |
|
479 * @return TUint16 |
|
480 */ |
|
481 TUint16 GetHorizontalAddressableImageSize( TUint8 aDataBlockNumber ) const; |
|
482 |
|
483 /** |
|
484 * Gets Vertical Addresable Image Size |
|
485 * |
|
486 * @since S60 9.2 |
|
487 * @param aDataBlockNumber |
|
488 * @return TUint16 |
|
489 */ |
|
490 TUint16 GetVerticalAddressableImageSize( TUint8 aDataBlockNumber ) const; |
|
491 |
|
492 /** |
|
493 * Gets Right Horizontal Border or Left Horizontal Border in Pixels |
|
494 * |
|
495 * @since S60 9.2 |
|
496 * @param aDataBlockNumber |
|
497 * @return TUint8 |
|
498 */ |
|
499 TUint8 GetHorizontalBorderSize( TUint8 aDataBlockNumber ) const; |
|
500 |
|
501 /** |
|
502 * Gets Right Vertical Border or Left Horizontal Border in Pixels |
|
503 * |
|
504 * @since S60 9.2 |
|
505 * @param aDataBlockNumber |
|
506 * @return TUint8 |
|
507 */ |
|
508 TUint8 GetVerticalBorderSize( TUint8 aDataBlockNumber ) const; |
|
509 |
|
510 /** |
|
511 * Checks whether or not video is interlaced |
|
512 * |
|
513 * @since S60 9.2 |
|
514 * @param aDataBlockNumber |
|
515 * @return TBool |
|
516 */ |
|
517 TBool GetVideoIsInterlaced( TUint8 aDataBlockNumber ) const; |
|
518 |
|
519 /** |
|
520 * Gets stero support |
|
521 * |
|
522 * @since S60 9.2 |
|
523 * @param aDataBlockNumber |
|
524 * @return TEdidStereoViewingSupport |
|
525 */ |
|
526 TEdidStereoViewingSupport GetStereoViewingSupport( TUint8 aDataBlockNumber ) const; |
|
527 |
|
528 /** |
|
529 * Gets signal definitions |
|
530 * |
|
531 * @since S60 9.2 |
|
532 * @param aDataBlockNumber |
|
533 * @return TEdidSyncSignalDefinitions |
|
534 */ |
|
535 TEdidSyncSignalDefinitions GetSyncSignalDefinitions( TUint8 aDataBlockNumber ) const; |
|
536 |
|
537 /** |
|
538 * Gets analog sync signal definitions |
|
539 * |
|
540 * @since S60 9.2 |
|
541 * @param aByte17 |
|
542 * @return TEdidSyncSignalDefinitions |
|
543 */ |
|
544 static TEdidSyncSignalDefinitions GetAnalogSyncSignalDefinitions( const TUint aByte17 ); |
|
545 |
|
546 /** |
|
547 * Gets digital sync signal definitions |
|
548 * |
|
549 * @since S60 9.2 |
|
550 * @param aByte17 |
|
551 * @return TEdidSyncSignalDefinitions |
|
552 */ |
|
553 static TEdidSyncSignalDefinitions GetDigitalSyncSignalDefinitions( const TUint aByte17 ); |
|
554 |
|
555 private: // data |
|
556 |
|
557 TEdidBaseBlock iBaseEdidData; // Base EDID data |
|
558 HBufC8* iRawData; // Raw data that contains all EDID data |
|
559 TUint iNumberOfExtensionBlocks; // Number of extensionblocks for this base edid block |
|
560 TExtDataBlock iExtensionData; // Extension data |
|
561 }; |
|
562 |
|
563 #endif // C_CEDIDPARSERBASE_H |