videoplayback/videohelix/src/mpxvideoplayerutility.cpp
branchRCL_3
changeset 6 7d91903f795f
parent 1 6711b85517b7
child 8 ce5ada96ab30
equal deleted inserted replaced
2:dec420019252 6:7d91903f795f
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:  This class is the interface between the playback plugin and RMMFController
    14 * Description:  This class is the interface between the playback plugin and RMMFController
    15  *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: 13 %
    18 // Version : %version: 15 %
    19 
    19 
    20 
    20 
    21 #include <AudioPreference.h>
    21 #include <AudioPreference.h>
    22 #include <mmf/server/mmffile.h>
    22 #include <mmf/server/mmffile.h>
    23 #include <caf/caftypes.h>
    23 #include <caf/caftypes.h>
    64 CMpxVideoPlayerUtility::~CMpxVideoPlayerUtility()
    64 CMpxVideoPlayerUtility::~CMpxVideoPlayerUtility()
    65 {
    65 {
    66     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::~CMpxVideoPlayerUtility()"));
    66     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::~CMpxVideoPlayerUtility()"));
    67 
    67 
    68     Close();
    68     Close();
    69 
       
    70     delete iControllerEventMonitor;
       
    71 }
    69 }
    72 
    70 
    73 void CMpxVideoPlayerUtility::Close()
    71 void CMpxVideoPlayerUtility::Close()
    74 {
    72 {
    75     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::Close()"));
    73     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::Close()"));
   224     return iVideoControllerCustomCommands.GetVideoMimeType( aMimeType );
   222     return iVideoControllerCustomCommands.GetVideoMimeType( aMimeType );
   225 }
   223 }
   226 
   224 
   227 TUint32 CMpxVideoPlayerUtility::FourCCCode() const
   225 TUint32 CMpxVideoPlayerUtility::FourCCCode() const
   228 {
   226 {
   229     TFourCC aFourCC( 0 ); 
   227     TFourCC aFourCC( 0 );
   230     iVideoControllerCustomCommands.GetAudioCodec( aFourCC );
   228     iVideoControllerCustomCommands.GetAudioCodec( aFourCC );
   231     
   229 
   232     return aFourCC.FourCC();
   230     return aFourCC.FourCC();
   233 }
   231 }
   234 
   232 
   235 void CMpxVideoPlayerUtility::RefreshFrameL()
   233 void CMpxVideoPlayerUtility::RefreshFrameL()
   236 {
   234 {
   509         //  the following code must be done at the end of this function.
   507         //  the following code must be done at the end of this function.
   510         //
   508         //
   511         if ( replaceSurface )
   509         if ( replaceSurface )
   512         {
   510         {
   513             error = iVideoPlaySurfaceSupportCustomCommands.SurfaceRemoved( oldSurfaceId );
   511             error = iVideoPlaySurfaceSupportCustomCommands.SurfaceRemoved( oldSurfaceId );
   514         }
       
   515     }
       
   516     else
       
   517     {
       
   518         if ( replaceSurface )
       
   519         {
       
   520             iVideoPlaySurfaceSupportCustomCommands.SurfaceRemoved( oldSurfaceId );
       
   521         }
   512         }
   522     }
   513     }
   523 
   514 
   524     return error;
   515     return error;
   525 }
   516 }
   607     if ( iVideoPlaybackController->iMPXPluginObs )
   598     if ( iVideoPlaybackController->iMPXPluginObs )
   608     {
   599     {
   609         CMPXMessage* msg = CMPXMessage::NewL();
   600         CMPXMessage* msg = CMPXMessage::NewL();
   610         CleanupStack::PushL( msg );
   601         CleanupStack::PushL( msg );
   611 
   602 
   612         msg->SetTObjectValueL<TInt>( KMPXMessageGeneralId, KMPXMediaIdVideoDisplayMessage );
   603         msg->SetTObjectValueL<TInt>( KMPXMessageGeneralId, KMPXMediaIdVideoDisplaySyncMessage );
   613         msg->SetTObjectValueL<TInt>( KMPXMediaVideoDisplayCommand, aCmd );
   604         msg->SetTObjectValueL<TInt>( KMPXMediaVideoDisplayCommand, aCmd );
   614 
   605 
   615         iVideoPlaybackController->iMPXPluginObs->HandlePlaybackMessage( msg, KErrNone );
   606         iVideoPlaybackController->iMPXPluginObs->HandlePlaybackSyncMessage( *msg );
   616 
   607 
   617         CleanupStack::PopAndDestroy( msg );
   608         CleanupStack::PopAndDestroy( msg );
   618     }
   609     }
   619 }
   610 }
   620 
   611 
   633     if ( iVideoPlaybackController->iMPXPluginObs )
   624     if ( iVideoPlaybackController->iMPXPluginObs )
   634     {
   625     {
   635         CMPXMessage* msg = CMPXMessage::NewL();
   626         CMPXMessage* msg = CMPXMessage::NewL();
   636         CleanupStack::PushL( msg );
   627         CleanupStack::PushL( msg );
   637 
   628 
   638         msg->SetTObjectValueL<TInt>( KMPXMessageGeneralId, KMPXMediaIdVideoDisplayMessage );
   629         msg->SetTObjectValueL<TInt>( KMPXMessageGeneralId, KMPXMediaIdVideoDisplaySyncMessage );
   639         msg->SetTObjectValueL<TInt>( KMPXMediaVideoDisplayCommand, aCmd );
   630         msg->SetTObjectValueL<TInt>( KMPXMediaVideoDisplayCommand, aCmd );
   640         msg->SetTObjectValueL<TSurfaceId>( KMPXMediaVideoDisplayTSurfaceId, aSurfaceId );
   631         msg->SetTObjectValueL<TSurfaceId>( KMPXMediaVideoDisplayTSurfaceId, aSurfaceId );
   641         msg->SetTObjectValueL<TRect>( KMPXMediaVideoDisplayCropRect, aCropRect );
   632         msg->SetTObjectValueL<TRect>( KMPXMediaVideoDisplayCropRect, aCropRect );
   642         msg->SetTObjectValueL<TVideoAspectRatio>( KMPXMediaVideoDisplayAspectRatio, aAspectRatio );
   633         msg->SetTObjectValueL<TVideoAspectRatio>( KMPXMediaVideoDisplayAspectRatio, aAspectRatio );
   643 
   634 
   644         iVideoPlaybackController->iMPXPluginObs->HandlePlaybackMessage( msg, KErrNone );
   635         iVideoPlaybackController->iMPXPluginObs->HandlePlaybackSyncMessage( *msg );
   645 
   636 
   646         CleanupStack::PopAndDestroy( msg );
   637         CleanupStack::PopAndDestroy( msg );
   647     }
   638     }
   648 }
   639 }
   649 
   640