--- a/videoplayback/videoplaybackviews/src/mpxvideoplaybackdisplayhandler.cpp Fri Feb 19 22:52:52 2010 +0200
+++ b/videoplayback/videoplaybackviews/src/mpxvideoplaybackdisplayhandler.cpp Fri Mar 12 15:43:00 2010 +0200
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 9 %
+// Version : %version: 10 %
#include <sysutil.h>
#include <s32file.h>
@@ -60,6 +60,8 @@
iVideoDisplay = NULL;
}
#endif
+
+ iSurfaceId = TSurfaceId::CreateNullId();
}
CMPXVideoPlaybackDisplayHandler*
@@ -101,6 +103,27 @@
}
// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackDisplayHandler::SignalSurfaceRemovedL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackDisplayHandler::SignalSurfaceRemovedL()
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SignalSurfaceRemovedL()"));
+
+ CMPXCommand* cmd = CMPXCommand::NewL();
+ CleanupStack::PushL( cmd );
+
+ cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+ cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback );
+ cmd->SetTObjectValueL<TMPXVideoPlaybackCommand>( KMPXMediaVideoPlaybackCommand,
+ EPbCmdSurfaceRemoved );
+
+ iPlaybackUtility->CommandL( *cmd );
+
+ CleanupStack::PopAndDestroy( cmd );
+}
+
+// -------------------------------------------------------------------------------------------------
// CMPXVideoPlaybackDisplayHandler::RemoveDisplayWindow()
// -------------------------------------------------------------------------------------------------
//
@@ -115,6 +138,16 @@
iVideoDisplay = NULL;
}
#endif
+
+ if ( ! iSurfaceId.IsNull() )
+ {
+ //
+ // Signal to the Playback Plugin that the surface has been removed
+ //
+ TRAP_IGNORE( SignalSurfaceRemovedL() );
+
+ iSurfaceId = TSurfaceId::CreateNullId();
+ }
}
// -------------------------------------------------------------------------------------------------
@@ -150,6 +183,18 @@
SurfaceRemoved();
break;
}
+ case EPbMsgVideoRemoveDisplayWindow:
+ {
+ if ( iVideoDisplay )
+ {
+ delete iVideoDisplay;
+ iVideoDisplay = NULL;
+ }
+
+ iSurfaceId = TSurfaceId::CreateNullId();
+
+ break;
+ }
#endif
}
@@ -421,7 +466,7 @@
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SurfaceCreatedL()"));
TSurfaceId oldSurfaceId = iSurfaceId;
-
+
//
// Extract the surface parameters from the message
//