videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp
branchRCL_3
changeset 8 ce5ada96ab30
parent 6 7d91903f795f
child 9 5294c000a26d
equal deleted inserted replaced
6:7d91903f795f 8:ce5ada96ab30
    13 *
    13 *
    14 * Description:  This class plays local video file
    14 * Description:  This class plays local video file
    15  *
    15  *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: 43 %
    18 // Version : %version: 47 %
    19 
    19 
    20 
    20 
    21 //
    21 //
    22 //  INCLUDE FILES
    22 //  INCLUDE FILES
    23 //
    23 //
    36 
    36 
    37 #include <coreapplicationuisdomainpskeys.h>
    37 #include <coreapplicationuisdomainpskeys.h>
    38 #include <ctsydomainpskeys.h>
    38 #include <ctsydomainpskeys.h>
    39 #include <mmf/common/mmferrors.h>
    39 #include <mmf/common/mmferrors.h>
    40 
    40 
    41 #include <hal.h>
       
    42 #include <hal_data.h>
       
    43 #include <e32std.h>
    41 #include <e32std.h>
    44 #include <devsoundif.h>
    42 #include <devsoundif.h>
       
    43 #include <avkondomainpskeys.h>
    45 
    44 
    46 #include "mpxvideoregion.h"
    45 #include "mpxvideoregion.h"
    47 #include "mpxvideoplaybackcontroller.h"
    46 #include "mpxvideoplaybackcontroller.h"
    48 #include "mpxvideoplaybackstate.h"
    47 #include "mpxvideoplaybackstate.h"
    49 #include "mpxvideoprivatecrkeys.h"
    48 #include "mpxvideoprivatecrkeys.h"
   143 void CMPXVideoPlaybackController::ConstructL( MMPXPlaybackPluginObserver& aObs )
   142 void CMPXVideoPlaybackController::ConstructL( MMPXPlaybackPluginObserver& aObs )
   144 {
   143 {
   145     MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::ConstructL()"));
   144     MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::ConstructL()"));
   146 
   145 
   147     iMPXPluginObs = &aObs;
   146     iMPXPluginObs = &aObs;
   148     iAccessPointId = -1;
   147     iAccessPointId = KUseDefaultIap;
   149     iVideoSeeker = CMPXVideoSeeker::NewL( this );
   148     iVideoSeeker = CMPXVideoSeeker::NewL( this );
   150 
   149 
   151     // Initiliaze to True
   150     // Initiliaze to True
   152     iSeekable = ETrue;
   151     iSeekable = ETrue;
   153 
   152 
   521                 }
   520                 }
   522 
   521 
   523                 aCmd.SetTObjectValueL<TInt>( KMPXMediaVideoBufferingPercentage,
   522                 aCmd.SetTObjectValueL<TInt>( KMPXMediaVideoBufferingPercentage,
   524                                              bufferingPercentage );
   523                                              bufferingPercentage );
   525 
   524 
       
   525                 break;
       
   526             }
       
   527             case EPbCmdSurfaceRemoved:
       
   528             {
       
   529                 iPlayer->SurfaceRemovedFromView();
   526                 break;
   530                 break;
   527             }
   531             }
   528             default:
   532             default:
   529             {
   533             {
   530                 break;
   534                 break;
  1723 
  1727 
  1724     return alarm;
  1728     return alarm;
  1725 }
  1729 }
  1726 
  1730 
  1727 // -----------------------------------------------------------------------------
  1731 // -----------------------------------------------------------------------------
  1728 // CMPXVideoPlaybackController::IsDisplayOff
  1732 // CMPXVideoPlaybackController::IsKeyLocked
  1729 // -----------------------------------------------------------------------------
  1733 // -----------------------------------------------------------------------------
  1730 //
  1734 //
  1731 TBool CMPXVideoPlaybackController::IsDisplayOff()
  1735 TBool CMPXVideoPlaybackController::IsKeyLocked()
  1732 {
  1736 {
  1733     TBool displayState;
  1737     TBool keylock( EFalse );
  1734     HAL::Get( HALData::EDisplayState, displayState );
  1738     RProperty::Get( KPSUidAvkonDomain, KAknKeyguardStatus, keylock );
  1735 
  1739 
  1736     MPX_DEBUG(_L("CMPXVideoPlaybackController::IsDisplayOff(%d)"), !displayState);
  1740     MPX_DEBUG(_L("CMPXVideoPlaybackController::IsKeyLocked(%d)"), keylock);
  1737 
  1741 
  1738     return !displayState;
  1742     return keylock;
  1739 }
  1743 }
  1740 
  1744 
  1741 //  ------------------------------------------------------------------------------------------------
  1745 //  ------------------------------------------------------------------------------------------------
  1742 //    CMPXVideoPlaybackController::HandleTvOutEventL()
  1746 //    CMPXVideoPlaybackController::HandleTvOutEventL()
  1743 //  ------------------------------------------------------------------------------------------------
  1747 //  ------------------------------------------------------------------------------------------------
  1905 {
  1909 {
  1906     MPX_ENTER_EXIT( _L("CMPXVideoPlaybackController::ResetMemberVariables()"));
  1910     MPX_ENTER_EXIT( _L("CMPXVideoPlaybackController::ResetMemberVariables()"));
  1907 
  1911 
  1908     iPlayer->Reset();
  1912     iPlayer->Reset();
  1909 
  1913 
       
  1914     //
       
  1915     // Delete the video accessory observer when the plugin
       
  1916     // goes back to Not Initialised state.
       
  1917     //
       
  1918     if ( iAccessoryMonitor )
       
  1919     {    
       
  1920         delete iAccessoryMonitor;
       
  1921         iAccessoryMonitor = NULL;
       
  1922     }
       
  1923 
  1910     if ( iFileDetails )
  1924     if ( iFileDetails )
  1911     {
  1925     {
  1912         delete iFileDetails;
  1926         delete iFileDetails;
  1913         iFileDetails = NULL;
  1927         iFileDetails = NULL;
  1914     }
  1928     }