videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp
branchRCL_3
changeset 8 ce5ada96ab30
parent 6 7d91903f795f
child 9 5294c000a26d
--- a/videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp	Fri Feb 19 22:52:52 2010 +0200
+++ b/videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp	Fri Mar 12 15:43:00 2010 +0200
@@ -15,7 +15,7 @@
  *
 */
 
-// Version : %version: 43 %
+// Version : %version: 47 %
 
 
 //
@@ -38,10 +38,9 @@
 #include <ctsydomainpskeys.h>
 #include <mmf/common/mmferrors.h>
 
-#include <hal.h>
-#include <hal_data.h>
 #include <e32std.h>
 #include <devsoundif.h>
+#include <avkondomainpskeys.h>
 
 #include "mpxvideoregion.h"
 #include "mpxvideoplaybackcontroller.h"
@@ -145,7 +144,7 @@
     MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::ConstructL()"));
 
     iMPXPluginObs = &aObs;
-    iAccessPointId = -1;
+    iAccessPointId = KUseDefaultIap;
     iVideoSeeker = CMPXVideoSeeker::NewL( this );
 
     // Initiliaze to True
@@ -525,6 +524,11 @@
 
                 break;
             }
+            case EPbCmdSurfaceRemoved:
+            {
+                iPlayer->SurfaceRemovedFromView();
+                break;
+            }
             default:
             {
                 break;
@@ -1725,17 +1729,17 @@
 }
 
 // -----------------------------------------------------------------------------
-// CMPXVideoPlaybackController::IsDisplayOff
+// CMPXVideoPlaybackController::IsKeyLocked
 // -----------------------------------------------------------------------------
 //
-TBool CMPXVideoPlaybackController::IsDisplayOff()
+TBool CMPXVideoPlaybackController::IsKeyLocked()
 {
-    TBool displayState;
-    HAL::Get( HALData::EDisplayState, displayState );
+    TBool keylock( EFalse );
+    RProperty::Get( KPSUidAvkonDomain, KAknKeyguardStatus, keylock );
 
-    MPX_DEBUG(_L("CMPXVideoPlaybackController::IsDisplayOff(%d)"), !displayState);
+    MPX_DEBUG(_L("CMPXVideoPlaybackController::IsKeyLocked(%d)"), keylock);
 
-    return !displayState;
+    return keylock;
 }
 
 //  ------------------------------------------------------------------------------------------------
@@ -1907,6 +1911,16 @@
 
     iPlayer->Reset();
 
+    //
+    // Delete the video accessory observer when the plugin
+    // goes back to Not Initialised state.
+    //
+    if ( iAccessoryMonitor )
+    {    
+        delete iAccessoryMonitor;
+        iAccessoryMonitor = NULL;
+    }
+
     if ( iFileDetails )
     {
         delete iFileDetails;