videoplayback/videohelix/src/mpxvideoplaybackmode.cpp
branchRCL_3
changeset 8 ce5ada96ab30
parent 0 96612d01cf9f
child 9 5294c000a26d
equal deleted inserted replaced
6:7d91903f795f 8:ce5ada96ab30
    13 *
    13 *
    14 * Description:  This class plays local video file
    14 * Description:  This class plays local video file
    15  *
    15  *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: 17 %
    18 // Version : %version: 19 %
    19 
    19 
    20 
    20 
    21 
    21 
    22 //
    22 //
    23 //  INCLUDE FILES
    23 //  INCLUDE FILES
   178     MPX_DEBUG(_L("CMPXVideoPlaybackMode::HandleBackground()"));
   178     MPX_DEBUG(_L("CMPXVideoPlaybackMode::HandleBackground()"));
   179 
   179 
   180     if ( iVideoPlaybackCtlr->iAppInForeground )
   180     if ( iVideoPlaybackCtlr->iAppInForeground )
   181     {
   181     {
   182         if ( iVideoPlaybackCtlr->IsAlarm() ||
   182         if ( iVideoPlaybackCtlr->IsAlarm() ||
   183              ( iVideoPlaybackCtlr->IsDisplayOff() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled ) )
   183              ( iVideoPlaybackCtlr->IsKeyLocked() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled ) )
   184         {
   184         {
   185             iVideoPlaybackCtlr->iForegroundPause = ETrue;
   185             iVideoPlaybackCtlr->iForegroundPause = ETrue;
   186             iVideoPlaybackCtlr->iState->HandlePause();
   186             iVideoPlaybackCtlr->iState->HandlePause();
   187         }
   187         }
   188         else if ( iVideoPlaybackCtlr->IsPhoneCall() || iVideoPlaybackCtlr->IsVideoCall() )
   188         else if ( iVideoPlaybackCtlr->IsPhoneCall() || iVideoPlaybackCtlr->IsVideoCall() )
   211         if ( iVideoPlaybackCtlr->IsVideoCall() )
   211         if ( iVideoPlaybackCtlr->IsVideoCall() )
   212         {
   212         {
   213             MPX_TRAPD( err,
   213             MPX_TRAPD( err,
   214                 iVideoPlaybackCtlr->iState->SendErrorToViewL( KMPXVideoCallOngoingError ) );
   214                 iVideoPlaybackCtlr->iState->SendErrorToViewL( KMPXVideoCallOngoingError ) );
   215         }
   215         }
   216         else if ( iVideoPlaybackCtlr->IsDisplayOff() &&
   216         else if ( iVideoPlaybackCtlr->IsKeyLocked() &&
   217                   iVideoPlaybackCtlr->iFileDetails->iVideoEnabled )
   217                   iVideoPlaybackCtlr->iFileDetails->iVideoEnabled )
   218         {
   218         {
   219             iVideoPlaybackCtlr->iForegroundPause = ETrue;
   219             iVideoPlaybackCtlr->iForegroundPause = ETrue;
   220         }
   220         }
   221         else if ( ! iVideoPlaybackCtlr->iAccessoryMonitor->IsTvOutPlaybackAllowed() )
   221         else if ( ! iVideoPlaybackCtlr->iAccessoryMonitor->IsTvOutPlaybackAllowed() )
   260 
   260 
   261     User::LeaveIfError( mobilePhone.GetCurrentMode( networkMode ) );
   261     User::LeaveIfError( mobilePhone.GetCurrentMode( networkMode ) );
   262 
   262 
   263     if ( networkMode == RMobilePhone::ENetworkModeGsm)
   263     if ( networkMode == RMobilePhone::ENetworkModeGsm)
   264     {
   264     {
   265     	networkMode2g = ETrue;
   265         networkMode2g = ETrue;
   266     }
   266     }
   267 
   267 
   268     mobilePhone.Close();
   268     mobilePhone.Close();
   269     telServer.Close();
   269     telServer.Close();
   270 
   270 
   344 //
   344 //
   345 void CMPXStreamingPlaybackMode::HandleOpenComplete()
   345 void CMPXStreamingPlaybackMode::HandleOpenComplete()
   346 {
   346 {
   347     MPX_ENTER_EXIT(_L("CMPXStreamingPlaybackMode::HandleOpenComplete()"));
   347     MPX_ENTER_EXIT(_L("CMPXStreamingPlaybackMode::HandleOpenComplete()"));
   348 
   348 
   349     // since SDP files are opened as KMmfUidFileSource type, we need to set
   349     //
   350     // the access point for SDP files before Prepare is called on Helix
   350     //  There is no need to send the access point if it is set to use default.
   351     //
   351     //  SDP files are opened as KMmfUidFileSource type, we need to set the access point for
   352     // for RAM files and URLs - access point is already been set
   352     //  SDP files before Prepare is called on Helix for RAM files and URLs - access point is
   353     // at the point of adding data source
   353     //  already been set at the point of adding data source
   354 
   354     //
   355     if ( iVideoPlaybackCtlr->iMediaType == CMediaRecognizer::ELocalSdpFile )
   355     if ( iVideoPlaybackCtlr->iAccessPointId != KUseDefaultIap &&
       
   356          iVideoPlaybackCtlr->iMediaType == CMediaRecognizer::ELocalSdpFile )
   356     {
   357     {
   357         const TMMFMessageDestinationPckg destinationPckg(KUidInterfaceMMFHelixController);
   358         const TMMFMessageDestinationPckg destinationPckg(KUidInterfaceMMFHelixController);
   358         const TPckgBuf<TBool> savePckg( EFalse );
   359         const TPckgBuf<TBool> savePckg( EFalse );
   359 
   360 
   360         HBufC8* tempBuf = NULL;
   361         HBufC8* tempBuf = NULL;
   391         if ( iVideoPlaybackCtlr->IsVideoCall() )
   392         if ( iVideoPlaybackCtlr->IsVideoCall() )
   392         {
   393         {
   393             MPX_TRAPD(err,
   394             MPX_TRAPD(err,
   394                       iVideoPlaybackCtlr->iState->SendErrorToViewL( KMPXVideoCallOngoingError ));
   395                       iVideoPlaybackCtlr->iState->SendErrorToViewL( KMPXVideoCallOngoingError ));
   395         }
   396         }
   396         else if ( iVideoPlaybackCtlr->IsDisplayOff() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled )
   397         else if ( iVideoPlaybackCtlr->IsKeyLocked() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled )
   397         {
   398         {
   398           //exit for live streaming
   399           //exit for live streaming
   399         }
   400         }
   400         else
   401         else
   401         {
   402         {
   503 
   504 
   504     if ( iVideoPlaybackCtlr->iAppInForeground )
   505     if ( iVideoPlaybackCtlr->iAppInForeground )
   505     {
   506     {
   506         if ( iVideoPlaybackCtlr->IsPhoneCall() ||
   507         if ( iVideoPlaybackCtlr->IsPhoneCall() ||
   507              iVideoPlaybackCtlr->IsVideoCall() ||
   508              iVideoPlaybackCtlr->IsVideoCall() ||
   508              ( iVideoPlaybackCtlr->IsDisplayOff() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled ))
   509              ( iVideoPlaybackCtlr->IsKeyLocked() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled ))
   509         {
   510         {
   510             iVideoPlaybackCtlr->iState->HandlePause();
   511             iVideoPlaybackCtlr->iState->HandlePause();
   511         }
   512         }
   512     }
   513     }
   513     else
   514     else