videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/videoplaybackdisplayhandler.cpp
changeset 55 4bfa887905cf
child 66 adb51f74b890
equal deleted inserted replaced
50:21fe8338c6bf 55:4bfa887905cf
       
     1 /*
       
     2 * Copyright (c) 2009 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:  9 %
       
    19 
       
    20 #include <sysutil.h>
       
    21 #include <s32file.h>
       
    22 #include <mpxcommand.h>
       
    23 #include <mpxcommandgeneraldefs.h>
       
    24 #include <mpxplaybackutility.h>
       
    25 #include <mpxvideoplaybackdefs.h>
       
    26 
       
    27 #include "mpxvideoviewwrapper.h"
       
    28 #include "videoplaybackdisplayhandler.h"
       
    29 #include "mpxvideoregion.h"
       
    30 #include "videoplaybackviewfiledetails.h"
       
    31 
       
    32 
       
    33 CVideoPlaybackDisplayHandler::CVideoPlaybackDisplayHandler( MMPXPlaybackUtility* aPlayUtil,
       
    34                                                             CMPXVideoViewWrapper* aViewWrapper )
       
    35     : iPlaybackUtility( aPlayUtil )
       
    36     , iViewWrapper( aViewWrapper )
       
    37 {
       
    38 }
       
    39 
       
    40 CVideoPlaybackDisplayHandler::~CVideoPlaybackDisplayHandler()
       
    41 {
       
    42 }
       
    43 
       
    44 CVideoPlaybackDisplayHandler*
       
    45 CVideoPlaybackDisplayHandler::NewL( MMPXPlaybackUtility* aPlayUtil,
       
    46                                     CMPXVideoViewWrapper* aViewWrapper )
       
    47 {
       
    48     MPX_ENTER_EXIT(_L("CVideoPlaybackDisplayHandler::NewL()"));
       
    49 
       
    50     CVideoPlaybackDisplayHandler* self =
       
    51         new(ELeave) CVideoPlaybackDisplayHandler( aPlayUtil, aViewWrapper );
       
    52 
       
    53     CleanupStack::PushL( self );
       
    54     self->ConstructL();
       
    55     CleanupStack::Pop();
       
    56     return self;
       
    57 }
       
    58 
       
    59 // -------------------------------------------------------------------------------------------------
       
    60 //  CVideoPlaybackDisplayHandler::ConstructL()
       
    61 // -------------------------------------------------------------------------------------------------
       
    62 //
       
    63 void CVideoPlaybackDisplayHandler::ConstructL()
       
    64 {
       
    65 }
       
    66 
       
    67 // -------------------------------------------------------------------------------------------------
       
    68 //   CVideoPlaybackDisplayHandler::CreateDisplayWindowL()
       
    69 // -------------------------------------------------------------------------------------------------
       
    70 //
       
    71 void CVideoPlaybackDisplayHandler::CreateDisplayWindowL(
       
    72                                           RWsSession& aWs,
       
    73                                           CWsScreenDevice& aScreenDevice,
       
    74                                           RWindow& aWin,
       
    75                                           TRect aDisplayRect )
       
    76 {
       
    77     Q_UNUSED( aWs );
       
    78     Q_UNUSED( aScreenDevice );
       
    79     Q_UNUSED( aWin );
       
    80     Q_UNUSED( aDisplayRect );
       
    81 }
       
    82 
       
    83 // -------------------------------------------------------------------------------------------------
       
    84 //   CVideoPlaybackDisplayHandler::RemoveDisplayWindow()
       
    85 // -------------------------------------------------------------------------------------------------
       
    86 //
       
    87 void CVideoPlaybackDisplayHandler::RemoveDisplayWindow()
       
    88 {
       
    89     if ( iVideoDisplay )
       
    90     {
       
    91         delete iVideoDisplay;
       
    92         iVideoDisplay = NULL;
       
    93     }
       
    94 }
       
    95 
       
    96 // -------------------------------------------------------------------------------------------------
       
    97 //   CVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL()
       
    98 // -------------------------------------------------------------------------------------------------
       
    99 //
       
   100 void CVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL( CMPXMessage* /*aMessage*/ )
       
   101 {
       
   102 }
       
   103 
       
   104 // -------------------------------------------------------------------------------------------------
       
   105 //   CVideoPlaybackDisplayHandler::SetAspectRatioL()
       
   106 // -------------------------------------------------------------------------------------------------
       
   107 //
       
   108 TInt CVideoPlaybackDisplayHandler::SetAspectRatioL( TMPXVideoPlaybackCommand aCmd )
       
   109 {
       
   110     iCommand = aCmd;
       
   111     
       
   112     switch ( aCmd )
       
   113     {
       
   114         case EPbCmdNaturalAspectRatio:
       
   115         {
       
   116             iAspectRatio = EMMFNatural;
       
   117             break;
       
   118         }
       
   119         case EPbCmdZoomAspectRatio:
       
   120         {
       
   121             iAspectRatio = EMMFZoom;
       
   122             break;
       
   123         }
       
   124         case EPbCmdStretchAspectRatio:
       
   125         {
       
   126             iAspectRatio = EMMFStretch;
       
   127             break;
       
   128         }
       
   129     }
       
   130 
       
   131     return iAspectRatio;
       
   132 }
       
   133 
       
   134 // -------------------------------------------------------------------------------------------------
       
   135 //   CVideoPlaybackDisplayHandler::SetDefaultAspectRatioL
       
   136 // -------------------------------------------------------------------------------------------------
       
   137 //
       
   138 TInt CVideoPlaybackDisplayHandler::SetDefaultAspectRatioL(
       
   139                                           VideoPlaybackViewFileDetails* aFileDetails,
       
   140                                           TReal32 aDisplayAspectRatio )
       
   141 {
       
   142     Q_UNUSED( aFileDetails );
       
   143     Q_UNUSED( aDisplayAspectRatio );
       
   144 
       
   145     return iAspectRatio;
       
   146 }
       
   147 
       
   148 // -------------------------------------------------------------------------------------------------
       
   149 //   CVideoPlaybackDisplayHandler::UpdateVideoRectL()
       
   150 // -------------------------------------------------------------------------------------------------
       
   151 //
       
   152 void CVideoPlaybackDisplayHandler::UpdateVideoRectL( TRect aClipRect, TBool transitionEffect  )
       
   153 {
       
   154     MPX_ENTER_EXIT(_L("CVideoPlaybackDisplayHandler::UpdateVideoRectL()"));
       
   155 
       
   156     Q_UNUSED( transitionEffect );
       
   157 
       
   158     iRect = aClipRect;
       
   159 }
       
   160 
       
   161 // End of File