accessoryservices/pluggeddisplay/edidparser/src/cea861edidparser.cpp
changeset 12 e978f818f9bd
parent 0 4e1aa6a622a0
child 27 4a5c47a50617
equal deleted inserted replaced
0:4e1aa6a622a0 12:e978f818f9bd
    17  */
    17  */
    18 
    18 
    19 #include "cea861edidparser.h"
    19 #include "cea861edidparser.h"
    20 #include "trace.h"
    20 #include "trace.h"
    21 
    21 
       
    22 const TInt KIEEERegistrationID = 0x00000C03;
       
    23 
    22 // ======== LOCAL FUNCTIONS ========
    24 // ======== LOCAL FUNCTIONS ========
    23 
    25 
    24 
    26 
    25 // ======== MEMBER FUNCTIONS ========
    27 // ======== MEMBER FUNCTIONS ========
    26 
    28 
   298 
   300 
   299     return iVendorSpecificDataBlockSupported;
   301     return iVendorSpecificDataBlockSupported;
   300     }
   302     }
   301 
   303 
   302 // ----------------------------------------------------------------------------
   304 // ----------------------------------------------------------------------------
       
   305 // CCea861EdidParser::HasIEEERegistration
       
   306 //
       
   307 // ----------------------------------------------------------------------------
       
   308 //
       
   309 EXPORT_C TBool CCea861EdidParser::HasIEEERegistration()
       
   310     {
       
   311     FUNC_LOG;
       
   312 
       
   313 	if ( iVendorSpecificDataBlockSupported && iParsedInfo->iVendorSpecificData &&
       
   314 		iParsedInfo->iVendorSpecificData->iIEEE24bitRegistrationIdentifier == KIEEERegistrationID )
       
   315 		{
       
   316 		return ETrue;
       
   317 		}
       
   318 
       
   319     return EFalse;
       
   320     }
       
   321 
       
   322 // ----------------------------------------------------------------------------
   303 // CCea861EdidParser::GetParsedInformation
   323 // CCea861EdidParser::GetParsedInformation
   304 //
   324 //
   305 // ----------------------------------------------------------------------------
   325 // ----------------------------------------------------------------------------
   306 //
   326 //
   307 EXPORT_C CCea861ExtEdidInformation* CCea861EdidParser::GetParsedInformation()
   327 EXPORT_C CCea861ExtEdidInformation* CCea861EdidParser::GetParsedInformation()
   575 
   595 
   576     if( aIndex > KEdidParserSizeOfEdidBlock )
   596     if( aIndex > KEdidParserSizeOfEdidBlock )
   577         {
   597         {
   578         return KErrOverflow;
   598         return KErrOverflow;
   579         }
   599         }
       
   600         
       
   601     TCEA861TEdidDescriptorBlockList* lastnode = iParsedInfo->iDescriptorBlocks;
   580 
   602 
   581     for( TInt index = aIndex; index < KEdidParserSizeOfEdidBlock; index++ )
   603     for( TInt index = aIndex; index < KEdidParserSizeOfEdidBlock; index++ )
   582         {
   604         {
   583         // Offset. If this is a newer version of CEA-861,
   605         // Offset. If this is a newer version of CEA-861,
   584         // then this is skipped (we are already past the offset)
   606         // then this is skipped (we are already past the offset)
   592                 }
   614                 }
   593             }
   615             }
   594 
   616 
   595         if( aData[index] != KEdidPaddingByte ) // padding = 0x00
   617         if( aData[index] != KEdidPaddingByte ) // padding = 0x00
   596             {
   618             {
   597             // start of 18-byte descriptors: See section 3.10.2 of VESA E-EDID Standard [10]
   619             // start of 18-byte descriptors: See section 3.10.2 of E-EDID Standard [10]
   598 
       
   599             TBool first = ETrue;
       
   600             if( iParsedInfo->iDescriptorBlocks == 0 )
       
   601                 {
       
   602                 iParsedInfo->iDescriptorBlocks
       
   603                     = new ( ELeave ) TCEA861TEdidDescriptorBlockList();
       
   604                 }
       
   605 
       
   606             // read the descriptors here
   620             // read the descriptors here
   607             TEdidDescriptorBlock tmp = GetDescriptorBlock( aData, index );
   621             TEdidDescriptorBlock tmp = GetDescriptorBlock( aData, index );
   608             if( first )
   622 			
   609                 {
   623             if( iParsedInfo->iDescriptorBlocks == 0 )
   610                 first = EFalse;
   624                 {
   611                 iParsedInfo->iDescriptorBlocks->iData = tmp;
   625                 iParsedInfo->iDescriptorBlocks = new ( ELeave ) TCEA861TEdidDescriptorBlockList();
   612                 continue;
   626                 lastnode = iParsedInfo->iDescriptorBlocks;
   613                 }
   627                 }
   614             TCEA861TEdidDescriptorBlockList* last =
   628             else
   615                 iParsedInfo->iDescriptorBlocks;
   629                 {
   616             while( last->iNext != 0 ) // go to last block
   630                 lastnode->iNext = new ( ELeave ) TCEA861TEdidDescriptorBlockList();
   617                 {
   631                 lastnode = lastnode->iNext;
   618                 last = last->iNext;
   632                 }
   619                 }
   633             lastnode->iData = tmp;
   620             last->iNext = new ( ELeave ) TCEA861TEdidDescriptorBlockList();
       
   621             last = last->iNext;
       
   622             last->iData = tmp;
       
   623             }
   634             }
   624         else
   635         else
   625             {
   636             {
   626             // this is only padding, no need to do anything
   637             // this is only padding, no need to do anything
   627             }
   638             }
  1480             break;
  1491             break;
  1481         case 4:
  1492         case 4:
  1482             ReadCea861SpeakerAllocationDataBlock( aData, aIndex, L1 );
  1493             ReadCea861SpeakerAllocationDataBlock( aData, aIndex, L1 );
  1483             break;
  1494             break;
  1484         case 5:
  1495         case 5:
  1485             //VESA DTC Data Block
  1496             //DTC Data Block
  1486             ReadUnknownTagCode( aData, aIndex, L1 );
  1497             ReadUnknownTagCode( aData, aIndex, L1 );
  1487             break;
  1498             break;
  1488         case 6:
  1499         case 6:
  1489             //reserved
  1500             //reserved
  1490             ReadUnknownTagCode( aData, aIndex, L1 );
  1501             ReadUnknownTagCode( aData, aIndex, L1 );
  1505                 }
  1516                 }
  1506             else if( auxTag == 0x11 ) // Vendor-Specific Audio Data Block, see table 57
  1517             else if( auxTag == 0x11 ) // Vendor-Specific Audio Data Block, see table 57
  1507                 {
  1518                 {
  1508                 }
  1519                 }
  1509             // TODO: these should be read as well, not just as unknown
  1520             // TODO: these should be read as well, not just as unknown
  1510             ReadUnknownTagCode( aData, aIndex, L1 );
       
  1511             break;
       
  1512         default:
       
  1513             // if tag-code is unknown, we still must read through it
       
  1514             ReadUnknownTagCode( aData, aIndex, L1 );
  1521             ReadUnknownTagCode( aData, aIndex, L1 );
  1515             break;
  1522             break;
  1516         }
  1523         }
  1517 
  1524 
  1518     return KErrNone;
  1525     return KErrNone;