videoplayback/videohelix/src/mpxvideoplaybackmode.cpp
changeset 34 bbb98528c666
parent 0 96612d01cf9f
child 35 3738fe97f027
equal deleted inserted replaced
33:48e74db5d516 34:bbb98528c666
    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: 20 %
    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         {
   443         else
   444         else
   444         {
   445         {
   445             TRAP_IGNORE( iVideoPlaybackCtlr->iState->SendErrorToViewL( err ) );
   446             TRAP_IGNORE( iVideoPlaybackCtlr->iState->SendErrorToViewL( err ) );
   446         }
   447         }
   447     }
   448     }
   448     else
   449     // Streaming link is non-pausable and no alarm stop playback
       
   450     else if ( !iVideoPlaybackCtlr->IsAlarm() )
   449     {
   451     {
   450         iVideoPlaybackCtlr->iPlayer->Stop();
   452         iVideoPlaybackCtlr->iPlayer->Stop();
   451 
   453 
   452         iVideoPlaybackCtlr->ChangeState( EMPXVideoStopped );
   454         iVideoPlaybackCtlr->ChangeState( EMPXVideoStopped );
   453 
   455 
   503 
   505 
   504     if ( iVideoPlaybackCtlr->iAppInForeground )
   506     if ( iVideoPlaybackCtlr->iAppInForeground )
   505     {
   507     {
   506         if ( iVideoPlaybackCtlr->IsPhoneCall() ||
   508         if ( iVideoPlaybackCtlr->IsPhoneCall() ||
   507              iVideoPlaybackCtlr->IsVideoCall() ||
   509              iVideoPlaybackCtlr->IsVideoCall() ||
   508              ( iVideoPlaybackCtlr->IsDisplayOff() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled ))
   510              ( iVideoPlaybackCtlr->IsKeyLocked() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled ))
   509         {
   511         {
   510             iVideoPlaybackCtlr->iState->HandlePause();
   512             iVideoPlaybackCtlr->iState->HandlePause();
   511         }
   513         }
   512     }
   514     }
   513     else
   515     else