videoplayback/inc/mpxvideoplaybackdisplayhandler.h
changeset 0 96612d01cf9f
child 8 ce5ada96ab30
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     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 // Version : %version: 6 %
       
    19 
       
    20 
       
    21 #ifndef __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
       
    22 #define __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
       
    23 
       
    24 // INCLUDES
       
    25 
       
    26 #include <mpxmessage2.h>
       
    27 #include <MMFScalingCustomCommandConstants.h>
       
    28 
       
    29 #ifdef SYMBIAN_BUILD_GCE
       
    30 #include <mediaclientvideodisplay.h>
       
    31 #endif
       
    32 
       
    33 #include <mpxvideoplaybackdefs.h>
       
    34 
       
    35 //
       
    36 //  CLASS DECLARATION
       
    37 //
       
    38 class MMPXPlaybackUtility;
       
    39 class CMPXVideoPlaybackViewFileDetails;
       
    40 
       
    41 /*
       
    42  *  CMPXVideoPlaybackDisplayHandler
       
    43  *
       
    44  */
       
    45 class CMPXVideoPlaybackDisplayHandler : public CBase
       
    46 {
       
    47     //
       
    48     //  To save user's preference for scaling type in video ratio + screen ratio
       
    49     //
       
    50     typedef struct
       
    51     {
       
    52         TReal32         videoRatio;
       
    53         TReal32         screenRatio;
       
    54         TMMFScalingType scalingType;
       
    55     } TMPXAspectRatio ;
       
    56 
       
    57     public:
       
    58 
       
    59         ~CMPXVideoPlaybackDisplayHandler();
       
    60 
       
    61         static CMPXVideoPlaybackDisplayHandler* NewL( MMPXPlaybackUtility* aPlayUtil );
       
    62 
       
    63         void CreateDisplayWindowL( CWsScreenDevice& aScreenDevice, RWindow& aWin );
       
    64 
       
    65         void RemoveDisplayWindow();
       
    66 
       
    67         TMPXVideoDisplayCommand HandleVideoDisplayMessageL( CMPXMessage* aMessage );
       
    68 
       
    69         TInt SetAspectRatioL( TMPXVideoPlaybackCommand aCmd );
       
    70 
       
    71         TInt SetDefaultAspectRatioL( CMPXVideoPlaybackViewFileDetails* aFileDetails,
       
    72                                      TReal aDisplayAspectRatio );
       
    73 
       
    74     private:
       
    75 
       
    76         CMPXVideoPlaybackDisplayHandler( MMPXPlaybackUtility* aPlayUtil );
       
    77 
       
    78         void ConstructL();
       
    79 
       
    80         void LoadAspectRatioL();
       
    81 
       
    82         void SaveAspectRatioL();
       
    83 
       
    84 
       
    85 #ifdef SYMBIAN_BUILD_GCE
       
    86 
       
    87     private:
       
    88         void AddDisplayWindowL( CWsScreenDevice& aScreenDevice,
       
    89                                 RWindowBase& aWindowBase,
       
    90                                 RWindow* aWin );
       
    91 
       
    92         void SurfaceCreatedL( CMPXMessage* aMessage );
       
    93         void SurfaceChangedL( CMPXMessage* aMessage );
       
    94         void SurfaceRemoved();
       
    95         TInt SetNgaAspectRatioL( TMPXVideoPlaybackCommand aCmd );
       
    96 
       
    97 #endif
       
    98 
       
    99     private:
       
   100         MMPXPlaybackUtility*                iPlaybackUtility;
       
   101 
       
   102         RArray<TMPXAspectRatio>             iAspectRatioArray;
       
   103         TInt                                iCurrentIndexForAspectRatio;
       
   104         TReal                               iDisplayAspectRatio;
       
   105 
       
   106 #ifdef SYMBIAN_BUILD_GCE
       
   107         CMediaClientVideoDisplay*           iVideoDisplay;
       
   108 
       
   109         TBool                               iSurfaceCached;
       
   110         TSurfaceId                          iSurfaceId;
       
   111         TRect                               iCropRect;
       
   112         TVideoAspectRatio                   iAspectRatio;
       
   113         TReal32                             iScaleWidth;
       
   114         TReal32                             iScaleHeight;
       
   115         TInt                                iHorizontalPosition;
       
   116         TInt                                iVerticalPosition;
       
   117         TVideoRotation                      iRotation;
       
   118         TAutoScaleType                      iAutoScale;
       
   119 #endif
       
   120 
       
   121 };
       
   122 
       
   123 #endif // __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__