diff -r dec420019252 -r cf5481c2bc0b videoplayback/videohelix/src/mpxvideoplayerutility.cpp --- a/videoplayback/videohelix/src/mpxvideoplayerutility.cpp Tue Feb 02 00:12:10 2010 +0200 +++ b/videoplayback/videohelix/src/mpxvideoplayerutility.cpp Fri Apr 16 14:59:52 2010 +0300 @@ -12,10 +12,10 @@ * Contributors: * * Description: This class is the interface between the playback plugin and RMMFController - * +* */ -// Version : %version: 13 % +// Version : %version: e003sa33#19 % #include @@ -66,8 +66,6 @@ MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::~CMpxVideoPlayerUtility()")); Close(); - - delete iControllerEventMonitor; } void CMpxVideoPlayerUtility::Close() @@ -81,6 +79,12 @@ iControllerEventMonitor = NULL; } + if ( ! iSurfaceId.IsNull() ) + { + MPX_TRAPD( err, SendSurfaceCommandL( EPbMsgVideoRemoveDisplayWindow ) ); + iSurfaceId = TSurfaceId::CreateNullId(); + } + iController.Close(); iDirectScreenAccessAbort = EFalse; } @@ -90,7 +94,7 @@ MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::Reset()")); Close(); - OpenControllerL(); + MPX_TRAPD( err, OpenControllerL() ); } void CMpxVideoPlayerUtility::OpenControllerL() @@ -226,9 +230,9 @@ TUint32 CMpxVideoPlayerUtility::FourCCCode() const { - TFourCC aFourCC( 0 ); + TFourCC aFourCC( 0 ); iVideoControllerCustomCommands.GetAudioCodec( aFourCC ); - + return aFourCC.FourCC(); } @@ -276,6 +280,21 @@ } } + +// ------------------------------------------------------------------------------------------------- +// CMpxVideoPlayerUtility::SurfaceRemovedFromView() +// ------------------------------------------------------------------------------------------------- +// +void CMpxVideoPlayerUtility::SurfaceRemovedFromView() +{ + MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::SurfaceRemovedFromView()")); + + if ( ! iSurfaceId.IsNull() ) + { + iSurfaceId = TSurfaceId::CreateNullId(); + } +} + TBool CMpxVideoPlayerUtility::AudioEnabledL() const { TBool enabled; @@ -513,13 +532,6 @@ error = iVideoPlaySurfaceSupportCustomCommands.SurfaceRemoved( oldSurfaceId ); } } - else - { - if ( replaceSurface ) - { - iVideoPlaySurfaceSupportCustomCommands.SurfaceRemoved( oldSurfaceId ); - } - } return error; } @@ -578,19 +590,17 @@ { TInt error = KErrNone; - if ( iSurfaceId.IsNull() ) + if ( !iSurfaceId.IsNull() ) { - error = KErrNotFound; - } + // + // Send command to view to remove the surface + // + MPX_TRAPD( err, SendSurfaceCommandL( EPbMsgVideoSurfaceRemoved ) ); - // - // Send command to view to remove the surface - // - MPX_TRAPD( err, SendSurfaceCommandL( EPbMsgVideoSurfaceRemoved ) ); + error = iVideoPlaySurfaceSupportCustomCommands.SurfaceRemoved( iSurfaceId ); - error = iVideoPlaySurfaceSupportCustomCommands.SurfaceRemoved( iSurfaceId ); - - iSurfaceId = TSurfaceId::CreateNullId(); + iSurfaceId = TSurfaceId::CreateNullId(); + } return error; } @@ -609,10 +619,10 @@ CMPXMessage* msg = CMPXMessage::NewL(); CleanupStack::PushL( msg ); - msg->SetTObjectValueL( KMPXMessageGeneralId, KMPXMediaIdVideoDisplayMessage ); + msg->SetTObjectValueL( KMPXMessageGeneralId, KMPXMediaIdVideoDisplaySyncMessage ); msg->SetTObjectValueL( KMPXMediaVideoDisplayCommand, aCmd ); - iVideoPlaybackController->iMPXPluginObs->HandlePlaybackMessage( msg, KErrNone ); + iVideoPlaybackController->iMPXPluginObs->HandlePlaybackSyncMessage( *msg ); CleanupStack::PopAndDestroy( msg ); } @@ -635,13 +645,13 @@ CMPXMessage* msg = CMPXMessage::NewL(); CleanupStack::PushL( msg ); - msg->SetTObjectValueL( KMPXMessageGeneralId, KMPXMediaIdVideoDisplayMessage ); + msg->SetTObjectValueL( KMPXMessageGeneralId, KMPXMediaIdVideoDisplaySyncMessage ); msg->SetTObjectValueL( KMPXMediaVideoDisplayCommand, aCmd ); msg->SetTObjectValueL( KMPXMediaVideoDisplayTSurfaceId, aSurfaceId ); msg->SetTObjectValueL( KMPXMediaVideoDisplayCropRect, aCropRect ); msg->SetTObjectValueL( KMPXMediaVideoDisplayAspectRatio, aAspectRatio ); - iVideoPlaybackController->iMPXPluginObs->HandlePlaybackMessage( msg, KErrNone ); + iVideoPlaybackController->iMPXPluginObs->HandlePlaybackSyncMessage( *msg ); CleanupStack::PopAndDestroy( msg ); }