accessoryservices/pluggeddisplay/edidparser/src/cea861edidparser.cpp
branchRCL_3
changeset 5 1a73e8f1b64d
parent 0 4e1aa6a622a0
child 12 4a5c47a50617
--- a/accessoryservices/pluggeddisplay/edidparser/src/cea861edidparser.cpp	Sat Feb 20 00:05:00 2010 +0200
+++ b/accessoryservices/pluggeddisplay/edidparser/src/cea861edidparser.cpp	Fri Mar 12 15:50:01 2010 +0200
@@ -19,6 +19,8 @@
 #include "cea861edidparser.h"
 #include "trace.h"
 
+const TInt KIEEERegistrationID = 0x00000C03;
+
 // ======== LOCAL FUNCTIONS ========
 
 
@@ -300,6 +302,24 @@
     }
 
 // ----------------------------------------------------------------------------
+// CCea861EdidParser::HasIEEERegistration
+//
+// ----------------------------------------------------------------------------
+//
+EXPORT_C TBool CCea861EdidParser::HasIEEERegistration()
+    {
+    FUNC_LOG;
+
+	if ( iVendorSpecificDataBlockSupported && iParsedInfo->iVendorSpecificData &&
+		iParsedInfo->iVendorSpecificData->iIEEE24bitRegistrationIdentifier == KIEEERegistrationID )
+		{
+		return ETrue;
+		}
+
+    return EFalse;
+    }
+
+// ----------------------------------------------------------------------------
 // CCea861EdidParser::GetParsedInformation
 //
 // ----------------------------------------------------------------------------
@@ -577,6 +597,8 @@
         {
         return KErrOverflow;
         }
+        
+    TCEA861TEdidDescriptorBlockList* lastnode = iParsedInfo->iDescriptorBlocks;
 
     for( TInt index = aIndex; index < KEdidParserSizeOfEdidBlock; index++ )
         {
@@ -594,32 +616,21 @@
 
         if( aData[index] != KEdidPaddingByte ) // padding = 0x00
             {
-            // start of 18-byte descriptors: See section 3.10.2 of VESA E-EDID Standard [10]
-
-            TBool first = ETrue;
-            if( iParsedInfo->iDescriptorBlocks == 0 )
-                {
-                iParsedInfo->iDescriptorBlocks
-                    = new ( ELeave ) TCEA861TEdidDescriptorBlockList();
-                }
-
+            // start of 18-byte descriptors: See section 3.10.2 of E-EDID Standard [10]
             // read the descriptors here
             TEdidDescriptorBlock tmp = GetDescriptorBlock( aData, index );
-            if( first )
+			
+            if( iParsedInfo->iDescriptorBlocks == 0 )
                 {
-                first = EFalse;
-                iParsedInfo->iDescriptorBlocks->iData = tmp;
-                continue;
+                iParsedInfo->iDescriptorBlocks = new ( ELeave ) TCEA861TEdidDescriptorBlockList();
+                lastnode = iParsedInfo->iDescriptorBlocks;
                 }
-            TCEA861TEdidDescriptorBlockList* last =
-                iParsedInfo->iDescriptorBlocks;
-            while( last->iNext != 0 ) // go to last block
+            else
                 {
-                last = last->iNext;
+                lastnode->iNext = new ( ELeave ) TCEA861TEdidDescriptorBlockList();
+                lastnode = lastnode->iNext;
                 }
-            last->iNext = new ( ELeave ) TCEA861TEdidDescriptorBlockList();
-            last = last->iNext;
-            last->iData = tmp;
+            lastnode->iData = tmp;
             }
         else
             {
@@ -1482,7 +1493,7 @@
             ReadCea861SpeakerAllocationDataBlock( aData, aIndex, L1 );
             break;
         case 5:
-            //VESA DTC Data Block
+            //DTC Data Block
             ReadUnknownTagCode( aData, aIndex, L1 );
             break;
         case 6:
@@ -1509,10 +1520,6 @@
             // TODO: these should be read as well, not just as unknown
             ReadUnknownTagCode( aData, aIndex, L1 );
             break;
-        default:
-            // if tag-code is unknown, we still must read through it
-            ReadUnknownTagCode( aData, aIndex, L1 );
-            break;
         }
 
     return KErrNone;