videoplayback/videoplaybackview/viewinc/videoplaybackdisplayhandler.h
changeset 66 adb51f74b890
parent 55 4bfa887905cf
equal deleted inserted replaced
63:4707a0db12f6 66:adb51f74b890
    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:  12 %
    18 // Version : %version:  14 %
    19 
    19 
    20 
    20 
    21 #ifndef __VIDEOPLAYBACKDISPLAYHANDLER_H__
    21 #ifndef __VIDEOPLAYBACKDISPLAYHANDLER_H__
    22 #define __VIDEOPLAYBACKDISPLAYHANDLER_H__
    22 #define __VIDEOPLAYBACKDISPLAYHANDLER_H__
    23 
    23 
    27 #include <MMFScalingCustomCommandConstants.h>
    27 #include <MMFScalingCustomCommandConstants.h>
    28 #include <mpxvideoplaybackdefs.h>
    28 #include <mpxvideoplaybackdefs.h>
    29 #include <mediaclientvideodisplay.h>
    29 #include <mediaclientvideodisplay.h>
    30 
    30 
    31 
    31 
    32 // 
    32 //
    33 //  CLASS DECLARATION
    33 //  CLASS DECLARATION
    34 //
    34 //
    35 class CVideoContainer;
    35 class CVideoContainer;
    36 class MMPXPlaybackUtility;
       
    37 class CMPXVideoViewWrapper;
    36 class CMPXVideoViewWrapper;
    38 class VideoPlaybackViewFileDetails;
    37 class VideoPlaybackViewFileDetails;
    39 
    38 
    40 /*
    39 /*
    41  *  CVideoPlaybackDisplayHandler
    40  *  CVideoPlaybackDisplayHandler
    50     {
    49     {
    51         TReal32         videoRatio;
    50         TReal32         videoRatio;
    52         TReal32         screenRatio;
    51         TReal32         screenRatio;
    53         TMMFScalingType scalingType;
    52         TMMFScalingType scalingType;
    54     } TMPXAspectRatio ;
    53     } TMPXAspectRatio ;
    55     
    54 
    56     public:
    55     public:
    57 
    56 
    58         ~CVideoPlaybackDisplayHandler();
    57         ~CVideoPlaybackDisplayHandler();
    59 
    58 
    60         static CVideoPlaybackDisplayHandler* NewL( MMPXPlaybackUtility* aPlayUtil,
    59         static CVideoPlaybackDisplayHandler* NewL( CMPXVideoViewWrapper* aViewWrapper );
    61                                                    CMPXVideoViewWrapper* aViewWrapper );
       
    62 
    60 
    63         void CreateDisplayWindowL( RWsSession& aWs,
    61         void CreateDisplayWindowL( RWsSession& aWs,
    64                                    CWsScreenDevice& aScreenDevice,
    62                                    CWsScreenDevice& aScreenDevice,
    65                                    RWindow& aWin,
    63                                    RWindow& aWin,
    66                                    TRect aDisplayRect );
    64                                    TRect aDisplayRect,
       
    65                                    VideoPlaybackViewFileDetails* aFileDetails );
    67 
    66 
    68         void RemoveDisplayWindow();
    67         void RemoveDisplayWindow();
    69 
    68 
    70         void HandleVideoDisplayMessageL( CMPXMessage* aMessage );
    69         void HandleVideoDisplayMessageL( CMPXMessage* aMessage );
    71 
    70 
    72         TInt SetAspectRatioL( TMPXVideoPlaybackCommand aCmd );
    71         TInt SetAspectRatioL( TMPXVideoPlaybackCommand aCmd );
    73         
    72 
    74         TInt SetDefaultAspectRatioL( VideoPlaybackViewFileDetails* aFileDetails, 
    73         TInt CalculateAspectRatioL();
    75                                      TReal32 aDisplayAspectRatio );
       
    76 
    74 
    77         void UpdateVideoRectL( TRect aRect, TBool transitionEffect );
    75         void UpdateVideoRectL( TRect aRect, TBool transitionEffect );
    78 
    76 
    79     private:
    77     private:
    80 
    78 
    81         CVideoPlaybackDisplayHandler( MMPXPlaybackUtility* aPlayUtil,
    79         CVideoPlaybackDisplayHandler( CMPXVideoViewWrapper* aViewWrapper );
    82                                       CMPXVideoViewWrapper* aViewWrapper );
       
    83 
    80 
    84         void ConstructL();
    81         void ConstructL();
    85         
    82 
    86         void LoadAspectRatioL();
    83         void LoadAspectRatioL();
    87         
    84 
    88         void SaveAspectRatioL();
    85         void SaveAspectRatioL();
    89 
    86 
    90         void SetVideoRectL( TRect aClipRect );
    87         void SetVideoRectL( TRect aClipRect );
    91 
    88 
    92         void CalculateVideoRectL();
    89         void CalculateVideoRectL();
   100 
    97 
   101         void SurfaceCreatedL( CMPXMessage* aMessage );
    98         void SurfaceCreatedL( CMPXMessage* aMessage );
   102         void SurfaceChangedL( CMPXMessage* aMessage );
    99         void SurfaceChangedL( CMPXMessage* aMessage );
   103         void SurfaceRemoved();
   100         void SurfaceRemoved();
   104         TInt SetNgaAspectRatioL( TMPXVideoPlaybackCommand aCmd );
   101         TInt SetNgaAspectRatioL( TMPXVideoPlaybackCommand aCmd );
       
   102         TBool IsAspectRatioEqual( TReal32 aRatio1, TReal32 aRatio2 );
   105 
   103 
   106     private:
   104     private:
   107         MMPXPlaybackUtility*                iPlaybackUtility;
       
   108 
       
   109         RArray<TMPXAspectRatio>             iAspectRatioArray;
   105         RArray<TMPXAspectRatio>             iAspectRatioArray;
   110         TInt                                iCurrentIndexForAspectRatio;
   106         TInt                                iCurrentIndexForAspectRatio;
   111         TReal                               iDisplayAspectRatio;
   107         TReal32                             iDisplayAspectRatio;
   112 
   108 
   113         TRect                               iWindowRect;
   109         TRect                               iWindowRect;
   114 
   110 
   115         TReal32                             iTlXDiff;
   111         TReal32                             iTlXDiff;
   116         TReal32                             iTlYDiff;
   112         TReal32                             iTlYDiff;
   134         TInt                                iHorizontalPosition;
   130         TInt                                iHorizontalPosition;
   135         TInt                                iVerticalPosition;
   131         TInt                                iVerticalPosition;
   136         TVideoRotation                      iRotation;
   132         TVideoRotation                      iRotation;
   137         TAutoScaleType                      iAutoScale;
   133         TAutoScaleType                      iAutoScale;
   138         CVideoContainer*                    iVideoContainer;
   134         CVideoContainer*                    iVideoContainer;
       
   135         VideoPlaybackViewFileDetails*       iFileDetails;
   139 };
   136 };
   140 
   137 
   141 #endif // __VIDEOPLAYBACKDISPLAYHANDLER_H__
   138 #endif // __VIDEOPLAYBACKDISPLAYHANDLER_H__