videoplayback/videohelix/src/mpxvideoplaybackmode.cpp
changeset 15 cf5481c2bc0b
parent 0 96612d01cf9f
child 17 69946d1824c4
--- a/videoplayback/videohelix/src/mpxvideoplaybackmode.cpp	Tue Feb 02 00:12:10 2010 +0200
+++ b/videoplayback/videohelix/src/mpxvideoplaybackmode.cpp	Fri Apr 16 14:59:52 2010 +0300
@@ -15,7 +15,7 @@
  *
 */
 
-// Version : %version: 17 %
+// Version : %version: e003sa33#21 %
 
 
 
@@ -180,7 +180,7 @@
     if ( iVideoPlaybackCtlr->iAppInForeground )
     {
         if ( iVideoPlaybackCtlr->IsAlarm() ||
-             ( iVideoPlaybackCtlr->IsDisplayOff() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled ) )
+             ( iVideoPlaybackCtlr->IsKeyLocked() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled ) )
         {
             iVideoPlaybackCtlr->iForegroundPause = ETrue;
             iVideoPlaybackCtlr->iState->HandlePause();
@@ -213,7 +213,7 @@
             MPX_TRAPD( err,
                 iVideoPlaybackCtlr->iState->SendErrorToViewL( KMPXVideoCallOngoingError ) );
         }
-        else if ( iVideoPlaybackCtlr->IsDisplayOff() &&
+        else if ( iVideoPlaybackCtlr->IsKeyLocked() &&
                   iVideoPlaybackCtlr->iFileDetails->iVideoEnabled )
         {
             iVideoPlaybackCtlr->iForegroundPause = ETrue;
@@ -262,7 +262,7 @@
 
     if ( networkMode == RMobilePhone::ENetworkModeGsm)
     {
-    	networkMode2g = ETrue;
+        networkMode2g = ETrue;
     }
 
     mobilePhone.Close();
@@ -346,13 +346,14 @@
 {
     MPX_ENTER_EXIT(_L("CMPXStreamingPlaybackMode::HandleOpenComplete()"));
 
-    // since SDP files are opened as KMmfUidFileSource type, we need to set
-    // the access point for SDP files before Prepare is called on Helix
     //
-    // for RAM files and URLs - access point is already been set
-    // at the point of adding data source
-
-    if ( iVideoPlaybackCtlr->iMediaType == CMediaRecognizer::ELocalSdpFile )
+    //  There is no need to send the access point if it is set to use default.
+    //  SDP files are opened as KMmfUidFileSource type, we need to set the access point for
+    //  SDP files before Prepare is called on Helix for RAM files and URLs - access point is
+    //  already been set at the point of adding data source
+    //
+    if ( iVideoPlaybackCtlr->iAccessPointId != KUseDefaultIap &&
+         iVideoPlaybackCtlr->iMediaType == CMediaRecognizer::ELocalSdpFile )
     {
         const TMMFMessageDestinationPckg destinationPckg(KUidInterfaceMMFHelixController);
         const TPckgBuf<TBool> savePckg( EFalse );
@@ -360,21 +361,23 @@
         HBufC8* tempBuf = NULL;
         TInt apMaxLen = 3;
 
-        HBufC8* accessPoint = HBufC8::NewLC( KMMFAccessPoint().Length() + apMaxLen );
-        accessPoint->Des().Format( KMMFAccessPoint, iVideoPlaybackCtlr->iAccessPointId );
+        MPX_TRAPD( err,
+                   HBufC8* accessPoint = HBufC8::NewLC( KMMFAccessPoint().Length() + apMaxLen );
+                   accessPoint->Des().Format( KMMFAccessPoint, iVideoPlaybackCtlr->iAccessPointId );
 
-        tempBuf = HBufC8::NewLC( accessPoint->Length() );
-        tempBuf->Des().Copy( accessPoint->Des() );
+                   tempBuf = HBufC8::NewLC( accessPoint->Length() );
+                   tempBuf->Des().Copy( accessPoint->Des() );
 
-        if ( tempBuf )
-        {
-            iVideoPlaybackCtlr->iPlayer->CustomCommandSync( destinationPckg,
+                   if ( tempBuf )
+                   {
+                       iVideoPlaybackCtlr->iPlayer->CustomCommandSync( destinationPckg,
                                                             EMMFROPControllerSetApplicationConfig,
                                                             tempBuf->Des(),
                                                             savePckg );
-        }
+                   }
 
-        CleanupStack::PopAndDestroy(2);   // accessPoint, tempBuf
+                   CleanupStack::PopAndDestroy(2);   // accessPoint, tempBuf 
+                );
     }
 }
 
@@ -393,13 +396,14 @@
             MPX_TRAPD(err,
                       iVideoPlaybackCtlr->iState->SendErrorToViewL( KMPXVideoCallOngoingError ));
         }
-        else if ( iVideoPlaybackCtlr->IsDisplayOff() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled )
+        else if ( iVideoPlaybackCtlr->IsKeyLocked() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled )
         {
           //exit for live streaming
         }
         else
         {
-            playAllowed = !( iVideoPlaybackCtlr->IsVoiceCall() && IsNetworkMode2GL() );
+            MPX_TRAPD( err,
+            		   playAllowed = !( iVideoPlaybackCtlr->IsVoiceCall() && IsNetworkMode2GL() ) );
 
             if ( !playAllowed )
             {
@@ -445,7 +449,8 @@
             TRAP_IGNORE( iVideoPlaybackCtlr->iState->SendErrorToViewL( err ) );
         }
     }
-    else
+    // Streaming link is non-pausable and no alarm stop playback
+    else if ( !iVideoPlaybackCtlr->IsAlarm() )
     {
         iVideoPlaybackCtlr->iPlayer->Stop();
 
@@ -505,7 +510,7 @@
     {
         if ( iVideoPlaybackCtlr->IsPhoneCall() ||
              iVideoPlaybackCtlr->IsVideoCall() ||
-             ( iVideoPlaybackCtlr->IsDisplayOff() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled ))
+             ( iVideoPlaybackCtlr->IsKeyLocked() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled ))
         {
             iVideoPlaybackCtlr->iState->HandlePause();
         }