videoplayback/inc/mpxvideoplaybackdisplayhandler.h
branchRCL_3
changeset 23 befca0ec475f
equal deleted inserted replaced
22:839377eedc2b 23:befca0ec475f
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Implementation of video playback display handler
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // Version : %version: 12 %
       
    20 
       
    21 
       
    22 #ifndef __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
       
    23 #define __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
       
    24 
       
    25 // INCLUDES
       
    26 
       
    27 #include <mpxmessage2.h>
       
    28 #include <MMFScalingCustomCommandConstants.h>
       
    29 #include <mediaclientvideodisplay.h>
       
    30 #include <mpxvideoplaybackdefs.h>
       
    31 
       
    32 //
       
    33 //  CLASS DECLARATION
       
    34 //
       
    35 class MMPXPlaybackUtility;
       
    36 class CMPXVideoPlaybackContainer;
       
    37 class CMPXVideoPlaybackViewFileDetails;
       
    38 
       
    39 /*
       
    40  *  CMPXVideoPlaybackDisplayHandler
       
    41  *
       
    42  */
       
    43 class CMPXVideoPlaybackDisplayHandler : public CBase
       
    44 {
       
    45     //
       
    46     //  To save user's preference for scaling type in video ratio + screen ratio
       
    47     //
       
    48     typedef struct
       
    49     {
       
    50         TReal32         videoRatio;
       
    51         TReal32         screenRatio;
       
    52         TMMFScalingType scalingType;
       
    53     } TMPXAspectRatio ;
       
    54 
       
    55     public:
       
    56 
       
    57         ~CMPXVideoPlaybackDisplayHandler();
       
    58 
       
    59         static CMPXVideoPlaybackDisplayHandler* NewL( MMPXPlaybackUtility* aPlayUtil,
       
    60                                                       CMPXVideoPlaybackContainer* aContainer );
       
    61 
       
    62         void CreateDisplayWindowL( CWsScreenDevice& aScreenDevice,
       
    63                                    RWindow& aWin,
       
    64                                    CMPXVideoPlaybackViewFileDetails* aFileDetails );
       
    65 
       
    66         void RemoveDisplayWindow();
       
    67 
       
    68         void HandleVideoDisplayMessageL( CMPXMessage* aMessage );
       
    69 
       
    70         void SetAspectRatioL( TMPXVideoPlaybackCommand aCmd );
       
    71 
       
    72         void DoHandleRealOneBitmapTimeoutL();
       
    73 
       
    74         TBool ShowAspectRatioIcon();
       
    75 
       
    76     private:
       
    77 
       
    78         CMPXVideoPlaybackDisplayHandler( MMPXPlaybackUtility* aPlayUtil,
       
    79                                          CMPXVideoPlaybackContainer* aContainer );
       
    80 
       
    81         void ConstructL();
       
    82 
       
    83         void LoadAspectRatioL();
       
    84 
       
    85         void SaveAspectRatioL();
       
    86 
       
    87         void AddDisplayWindowL( CWsScreenDevice& aScreenDevice,
       
    88                                 RWindowBase& aWindowBase,
       
    89                                 RWindow* aWin );
       
    90 
       
    91         void SurfaceCreatedL( CMPXMessage* aMessage );
       
    92         void SurfaceChangedL( CMPXMessage* aMessage );
       
    93         void SurfaceRemoved();
       
    94 
       
    95         void SignalSurfaceRemovedL();
       
    96 
       
    97         void AttachNewSurfaceToWindowL();
       
    98 
       
    99         void CalculateAspectRatioL();
       
   100 
       
   101         TBool IsAspectRatioEqual( TReal aRatio1, TReal aRatio2 );
       
   102 
       
   103         TReal CalculateVideoAspectRatio();
       
   104 
       
   105         void RemoveSurfaceFromPlaybackPluginL();
       
   106 
       
   107     private:
       
   108         MMPXPlaybackUtility*                iPlaybackUtility;
       
   109         CMPXVideoPlaybackContainer*         iContainer;
       
   110 
       
   111         RArray<TMPXAspectRatio>             iAspectRatioArray;
       
   112         TInt                                iCurrentIndexForAspectRatio;
       
   113 
       
   114         CMediaClientVideoDisplay*           iVideoDisplay;
       
   115 
       
   116         TBool                               iSurfaceCached;
       
   117         TSurfaceId                          iSurfaceId;
       
   118         TRect                               iCropRect;
       
   119         TVideoAspectRatio                   iAspectRatio;
       
   120         TReal32                             iScaleWidth;
       
   121         TReal32                             iScaleHeight;
       
   122         TInt                                iHorizontalPosition;
       
   123         TInt                                iVerticalPosition;
       
   124         TVideoRotation                      iRotation;
       
   125         TAutoScaleType                      iAutoScale;
       
   126 
       
   127         TReal                               iDisplayAspectRatio;
       
   128         TInt                                iVideoHeight;
       
   129         TInt                                iVideoWidth;
       
   130 };
       
   131 
       
   132 #endif // __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__