videoplayback/videohelix/src/mpxvideoaccessoryobserver.cpp
branchRCL_3
changeset 10 ce5ada96ab30
parent 0 96612d01cf9f
child 16 7f2b2a65da29
--- a/videoplayback/videohelix/src/mpxvideoaccessoryobserver.cpp	Fri Feb 19 22:52:52 2010 +0200
+++ b/videoplayback/videohelix/src/mpxvideoaccessoryobserver.cpp	Fri Mar 12 15:43:00 2010 +0200
@@ -15,7 +15,7 @@
  *
 */
 
-// Version : %version: 6 %
+// Version : %version: 7 %
 
 //
 //  INCLUDE FILES
@@ -133,6 +133,7 @@
     MPX_DEBUG(_L("CMPXVideoAccessoryObserver::UpdateTvOutStatusL()"));
 
     TBool statusChanged = EFalse;
+    TBool tvOutHDMI = EFalse;
 
     //
     //  Initialize TV-Out value to EFalse before checking if
@@ -153,10 +154,12 @@
 
     for ( TInt index = 0 ; index < count ; index++ )
     {
+        TAccPolGenericID genId = iGenericIdArray.GetGenericIDL( index );
+        
         //
         //  Get all supported capabilities for this connected accessory.
         //
-        iConnection.GetSubblockNameArrayL( iGenericIdArray.GetGenericIDL( index ), *nameArray );
+        iConnection.GetSubblockNameArrayL( genId, *nameArray );
 
         //
         //  Check if this connected accessory supports TV-Out
@@ -166,7 +169,22 @@
             MPX_DEBUG(_L("    TV-Out Capabilities Exist"));
 
             tvOutConnected = ETrue;
-            break;
+
+            TAccPolNameRecord nameRecord;
+            nameRecord.SetNameL( KAccVideoOut );                       
+            TAccValueTypeTInt value;            
+            iConnection.GetValueL( genId, nameRecord, value );  
+            
+            if ( value.iValue == EAccVideoOutEHDMI )
+            {
+                tvOutHDMI = ETrue;
+                //
+                // HDMI has precedence over Comp TV-Out, If the accessory is
+                // HDMI then stop the search for Video Out accessory, else continue 
+                // looping through all the accessories.
+                //
+                break;
+            }
         }
     }
 
@@ -180,7 +198,7 @@
     {
         iTvOutConnected = tvOutConnected;
 
-        if ( iTvOutConnected )
+        if ( iTvOutConnected && !tvOutHDMI)
         {
             //
             //  Check the playablility of the clip
@@ -195,7 +213,7 @@
         statusChanged   = ETrue;
     }
 
-    MPX_DEBUG(_L("    iTvOutConnected = %d"), iTvOutConnected);
+    MPX_DEBUG(_L("CMPXVideoAccessoryObserver::UpdateTvOutStatusL  iTvOutConnected = %d, tvOutHDMI = %d"), iTvOutConnected, tvOutHDMI);
 
     MPX_DEBUG(_L("CMPXVideoAccessoryObserver::UpdateTvOutStatusL() ret = %d"), statusChanged);