videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackdisplayhandler.h
changeset 39 f6d44a0cd476
parent 37 4eb2df7f7cbe
equal deleted inserted replaced
38:ff53afa8ad05 39:f6d44a0cd476
    13 *
    13 *
    14 * Description:   Implementation of video playback display handler
    14 * Description:   Implementation of video playback display handler
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version:  4 %
    18 // Version : %version:  6 %
    19 
    19 
    20 
    20 
    21 #ifndef __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
    21 #ifndef __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
    22 #define __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
    22 #define __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
    23 
    23 
    24 // INCLUDES
    24 // INCLUDES
    25 
    25 
    26 #include <mpxmessage2.h>
    26 #include <mpxmessage2.h>
    27 #include <mmfscalingcustomcommandconstants.h>
    27 #include <mmfscalingcustomcommandconstants.h>
    28 #include <mpxvideoplaybackdefs.h>
    28 #include <mpxvideoplaybackdefs.h>
    29 #ifdef SYMBIAN_BUILD_GCE
       
    30 #include <mediaclientvideodisplay.h>
    29 #include <mediaclientvideodisplay.h>
    31 #else
       
    32 #include <w32std.h>
       
    33 #endif
       
    34 
    30 
    35 
    31 
    36 // 
    32 // 
    37 //  CLASS DECLARATION
    33 //  CLASS DECLARATION
    38 //
    34 //
    43 /*
    39 /*
    44  *  CMPXVideoPlaybackDisplayHandler
    40  *  CMPXVideoPlaybackDisplayHandler
    45  *
    41  *
    46  */
    42  */
    47 class CMPXVideoPlaybackDisplayHandler : public CBase
    43 class CMPXVideoPlaybackDisplayHandler : public CBase
    48 #ifndef SYMBIAN_BUILD_GCE
       
    49                                       , public MDirectScreenAccess
       
    50 #endif
       
    51 {
    44 {
    52     //
       
    53     //  To save user's preference for scaling type in video ratio + screen ratio
       
    54     //
       
    55     typedef struct
       
    56     {
       
    57         TReal32         videoRatio;
       
    58         TReal32         screenRatio;
       
    59         TMMFScalingType scalingType;
       
    60     } TMPXAspectRatio ;
       
    61     
       
    62     public:
    45     public:
    63 
    46 
    64         ~CMPXVideoPlaybackDisplayHandler();
    47         ~CMPXVideoPlaybackDisplayHandler();
    65 
    48 
    66         static CMPXVideoPlaybackDisplayHandler* NewL( MMPXPlaybackUtility* aPlayUtil,
    49         static CMPXVideoPlaybackDisplayHandler* NewL( MMPXPlaybackUtility* aPlayUtil,
    78         TInt SetAspectRatioL( TMPXVideoPlaybackCommand aCmd );
    61         TInt SetAspectRatioL( TMPXVideoPlaybackCommand aCmd );
    79         
    62         
    80         TInt SetDefaultAspectRatioL( QMPXVideoPlaybackViewFileDetails* aFileDetails, 
    63         TInt SetDefaultAspectRatioL( QMPXVideoPlaybackViewFileDetails* aFileDetails, 
    81                                      TReal32 aDisplayAspectRatio );
    64                                      TReal32 aDisplayAspectRatio );
    82 
    65 
    83         void UpdateVideoRectL(  TRect aRect, TBool transitionEffect  );
    66         void UpdateVideoRectL( TRect aRect, TBool transitionEffect );
    84 
    67 
    85     private:
    68     private:
    86 
    69 
    87         CMPXVideoPlaybackDisplayHandler( MMPXPlaybackUtility* aPlayUtil,
    70         CMPXVideoPlaybackDisplayHandler( MMPXPlaybackUtility* aPlayUtil,
    88                                          CMPXVideoViewWrapper* aViewWrapper );
    71                                          CMPXVideoViewWrapper* aViewWrapper );
    89 
    72 
    90         void ConstructL();
    73         void ConstructL();
    91         
       
    92         void LoadAspectRatioL();
       
    93         
       
    94         void SaveAspectRatioL();
       
    95 
       
    96         void SetVideoRectL( TRect aClipRect );
       
    97 
       
    98         void CalculateVideoRectL();
       
    99 
       
   100         static TInt UpdateVideoRectTimeOutL( TAny* aPtr );
       
   101 
       
   102 #ifdef SYMBIAN_BUILD_GCE
       
   103 
       
   104     private:
       
   105         void AddDisplayWindowL( CWsScreenDevice& aScreenDevice,
       
   106                                 RWindowBase& aWindowBase,
       
   107                                 RWindow* aWin );
       
   108 
       
   109         void SurfaceCreatedL( CMPXMessage* aMessage );
       
   110         void SurfaceChangedL( CMPXMessage* aMessage );
       
   111         void SurfaceRemoved();
       
   112         TInt SetNgaAspectRatioL( TMPXVideoPlaybackCommand aCmd );
       
   113 
       
   114 #else
       
   115 
       
   116     private:
       
   117         //
       
   118         //  MDirectScreenAccess Implementation
       
   119         //
       
   120         void AbortNow( RDirectScreenAccess::TTerminationReasons aReason );
       
   121         void Restart( RDirectScreenAccess::TTerminationReasons aReason );
       
   122 
       
   123         TInt CreateAspectRatioCommandL( TMPXVideoPlaybackCommand aCmd );
       
   124         
       
   125         void SetDisplayWindowL( RWsSession& aWs,
       
   126                                 CWsScreenDevice& aScreenDevice,
       
   127                                 RWindowBase& aWin,
       
   128                                 TRect aClipRect );
       
   129         void RestartDsaL();
       
   130         void CreateAbortDsaCmdL();
       
   131 
       
   132 #endif
       
   133 
    74 
   134     public:
    75     public:
   135         MMPXPlaybackUtility*                iPlaybackUtility;
    76         MMPXPlaybackUtility*                iPlaybackUtility;
   136 
       
   137         RArray<TMPXAspectRatio>             iAspectRatioArray;
       
   138         TInt                                iCurrentIndexForAspectRatio;
       
   139         TReal                               iDisplayAspectRatio;
       
   140 
       
   141         TRect                               iWindowRect;
       
   142 
       
   143         TReal32                             iTlXDiff;
       
   144         TReal32                             iTlYDiff;
       
   145         TReal32                             iBrXDiff;
       
   146         TReal32                             iBrYDiff;
       
   147 
       
   148         TInt                                iTransitionEffectCnt;
       
   149 
       
   150         CPeriodic*                          iResizingTimer;
       
   151         CMPXVideoViewWrapper*               iViewWrapper;
    77         CMPXVideoViewWrapper*               iViewWrapper;
   152 
       
   153 #ifdef SYMBIAN_BUILD_GCE
       
   154         CMediaClientVideoDisplay*           iVideoDisplay;
    78         CMediaClientVideoDisplay*           iVideoDisplay;
   155 
    79 
   156         RWindowBase*                        iWindowBase;
    80         TRect                               iRect;
   157         TBool                               iSurfaceCached;
    81         TInt                                iAspectRatio;
   158         TSurfaceId                          iSurfaceId;
    82         TInt                                iCommand;
   159         TRect                               iCropRect;
       
   160         TVideoAspectRatio                   iAspectRatio;
       
   161         TReal32                             iScaleWidth;
       
   162         TReal32                             iScaleHeight;
       
   163         TInt                                iHorizontalPosition;
       
   164         TInt                                iVerticalPosition;
       
   165         TVideoRotation                      iRotation;
       
   166         TAutoScaleType                      iAutoScale;   
       
   167 #else
       
   168         CDirectScreenAccess*                iDirectScreenAccess;
       
   169 #endif
       
   170 
       
   171 };
    83 };
   172 
    84 
   173 #endif // __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
    85 #endif // __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__