diff -r 0e1e938beb1a -r a9d57bd8d7b7 videoplayback/videoplaybackview/viewsrc/mpxvideoviewwrapper.cpp --- a/videoplayback/videoplaybackview/viewsrc/mpxvideoviewwrapper.cpp Fri Sep 17 08:30:05 2010 +0300 +++ b/videoplayback/videoplaybackview/viewsrc/mpxvideoviewwrapper.cpp Mon Oct 04 00:19:07 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: da1mmcf#47 % +// Version : %version: da1mmcf#48 % @@ -92,15 +92,6 @@ { MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::ConstructL()")); - - // - // Get the playback utility instance from playback utility - // - iPlaybackUtility = - MMPXPlaybackUtility::UtilityL( EMPXCategoryVideo, KPbModeDefault ); - iPlaybackUtility->AddObserverL( *this ); - iPlaybackUtility->SetPrimaryClientL(); - // // Get an instance of collection utility // Used for the Collection Observer to get the MediaL callbacks @@ -113,6 +104,27 @@ iCloseAO = CIdle::NewL( CActive::EPriorityStandard ); // + // Get the playback utility instance from playback utility + // + iPlaybackUtility = + MMPXPlaybackUtility::UtilityL( EMPXCategoryVideo, KPbModeDefault ); + iPlaybackUtility->SetPrimaryClientL(); +} + +// ------------------------------------------------------------------------------------------------- +// CMPXVideoViewWrapper::ActivateL() +// ------------------------------------------------------------------------------------------------- +// +void CMPXVideoViewWrapper::ActivateL() +{ + MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::ActivateL()")); + + if ( iPlaybackUtility ) + { + iPlaybackUtility->AddObserverL( *this ); + } + + // // Create Video Playback Display Handler // iDisplayHandler = CVideoPlaybackDisplayHandler::NewL( iPlaybackUtility, this ); @@ -129,12 +141,12 @@ } // ------------------------------------------------------------------------------------------------- -// CMPXVideoViewWrapper::~CMPXVideoViewWrapper() +// CMPXVideoViewWrapper::DeactivateL() // ------------------------------------------------------------------------------------------------- // -CMPXVideoViewWrapper::~CMPXVideoViewWrapper() +void CMPXVideoViewWrapper::Deactivate() { - MPX_DEBUG(_L("CMPXVideoViewWrapper::~CMPXVideoViewWrapper()")); + MPX_DEBUG(_L("CMPXVideoViewWrapper::Deactivate()")); // // Delete the display handler when the view is deactivated @@ -157,12 +169,6 @@ iControlsController = NULL; } - if ( iCloseAO ) - { - delete iCloseAO; - iCloseAO = NULL; - } - if ( iFileDetails ) { delete iFileDetails; @@ -171,15 +177,35 @@ if ( iPlaybackUtility ) { + iPlaybackUtility->CancelRequest(); TRAP_IGNORE( iPlaybackUtility->RemoveObserverL( *this ) ); - iPlaybackUtility->Close(); - iPlaybackUtility = NULL; + } +} + +// ------------------------------------------------------------------------------------------------- +// CMPXVideoViewWrapper::~CMPXVideoViewWrapper() +// ------------------------------------------------------------------------------------------------- +// +CMPXVideoViewWrapper::~CMPXVideoViewWrapper() +{ + MPX_DEBUG(_L("CMPXVideoViewWrapper::~CMPXVideoViewWrapper()")); + + if ( iCloseAO ) + { + delete iCloseAO; + iCloseAO = NULL; } if ( iCollectionUtility ) { iCollectionUtility->Close(); } + + if ( iPlaybackUtility ) + { + iPlaybackUtility->Close(); + iPlaybackUtility = NULL; + } } // -------------------------------------------------------------------------------------------------