videoplayback/videohelix/src/mpxvideoaccessoryobserver.cpp
branchRCL_3
changeset 12 7f2b2a65da29
parent 8 ce5ada96ab30
child 14 55fa1ec415c6
equal deleted inserted replaced
11:8970fbd719ec 12:7f2b2a65da29
    13 *
    13 *
    14 * Description:  This class observes the accessory framework.
    14 * Description:  This class observes the accessory framework.
    15  *
    15  *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: 7 %
    18 // Version : %version: 8 %
    19 
    19 
    20 //
    20 //
    21 //  INCLUDE FILES
    21 //  INCLUDE FILES
    22 //
    22 //
    23 #include <e32svr.h>
    23 #include <e32svr.h>
   131 TBool CMPXVideoAccessoryObserver::UpdateTvOutStatusL()
   131 TBool CMPXVideoAccessoryObserver::UpdateTvOutStatusL()
   132 {
   132 {
   133     MPX_DEBUG(_L("CMPXVideoAccessoryObserver::UpdateTvOutStatusL()"));
   133     MPX_DEBUG(_L("CMPXVideoAccessoryObserver::UpdateTvOutStatusL()"));
   134 
   134 
   135     TBool statusChanged = EFalse;
   135     TBool statusChanged = EFalse;
   136     TBool tvOutHDMI = EFalse;
       
   137 
   136 
   138     //
   137     //
   139     //  Initialize TV-Out value to EFalse before checking if
   138     //  Initialize TV-Out value to EFalse before checking if
   140     //  accessories support TV-Out
   139     //  accessories support TV-Out
   141     //
   140     //
   166         //
   165         //
   167         if ( nameArray->HasName( KAccVideoOut ) )
   166         if ( nameArray->HasName( KAccVideoOut ) )
   168         {
   167         {
   169             MPX_DEBUG(_L("    TV-Out Capabilities Exist"));
   168             MPX_DEBUG(_L("    TV-Out Capabilities Exist"));
   170 
   169 
   171             tvOutConnected = ETrue;
   170             tvOutConnected = ETrue;                         
   172 
       
   173             TAccPolNameRecord nameRecord;
       
   174             nameRecord.SetNameL( KAccVideoOut );                       
       
   175             TAccValueTypeTInt value;            
       
   176             iConnection.GetValueL( genId, nameRecord, value );  
       
   177             
       
   178             if ( value.iValue == EAccVideoOutEHDMI )
       
   179             {
       
   180                 tvOutHDMI = ETrue;
       
   181                 //
       
   182                 // HDMI has precedence over Comp TV-Out, If the accessory is
       
   183                 // HDMI then stop the search for Video Out accessory, else continue 
       
   184                 // looping through all the accessories.
       
   185                 //
       
   186                 break;
       
   187             }
       
   188         }
   171         }
   189     }
   172     }
   190 
   173 
   191     CleanupStack::PopAndDestroy( nameArray );
   174     CleanupStack::PopAndDestroy( nameArray );
   192 #endif
   175 #endif
   196     //
   179     //
   197     if ( iTvOutConnected != tvOutConnected )
   180     if ( iTvOutConnected != tvOutConnected )
   198     {
   181     {
   199         iTvOutConnected = tvOutConnected;
   182         iTvOutConnected = tvOutConnected;
   200 
   183 
   201         if ( iTvOutConnected && !tvOutHDMI)
   184         if ( iTvOutConnected ) 
   202         {
   185         {
   203             //
   186             //
   204             //  Check the playablility of the clip
   187             //  Check the playablility of the clip
   205             //
   188             //
   206             iTvOutPlaybackAllowed = iController->iPlaybackMode->IsTvOutAllowedL();
   189             iTvOutPlaybackAllowed = iController->iPlaybackMode->IsTvOutAllowedL();
   211         }
   194         }
   212 
   195 
   213         statusChanged   = ETrue;
   196         statusChanged   = ETrue;
   214     }
   197     }
   215 
   198 
   216     MPX_DEBUG(_L("CMPXVideoAccessoryObserver::UpdateTvOutStatusL  iTvOutConnected = %d, tvOutHDMI = %d"), iTvOutConnected, tvOutHDMI);
   199     MPX_DEBUG(_L("CMPXVideoAccessoryObserver::UpdateTvOutStatusL  iTvOutConnected = %d"), iTvOutConnected);
   217 
   200 
   218     MPX_DEBUG(_L("CMPXVideoAccessoryObserver::UpdateTvOutStatusL() ret = %d"), statusChanged);
   201     MPX_DEBUG(_L("CMPXVideoAccessoryObserver::UpdateTvOutStatusL() ret = %d"), statusChanged);
   219 
   202 
   220     return statusChanged;
   203     return statusChanged;
   221 }
   204 }