videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackdisplayhandler.cpp
author hgs
Fri, 28 May 2010 09:45:19 +0300
changeset 39 f6d44a0cd476
parent 37 4eb2df7f7cbe
permissions -rw-r--r--
201021
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:   Implementation of video playback display handler
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
39
hgs
parents: 37
diff changeset
    18
// Version : %version:  7 %
34
hgs
parents:
diff changeset
    19
hgs
parents:
diff changeset
    20
#include <sysutil.h>
hgs
parents:
diff changeset
    21
#include <s32file.h>
hgs
parents:
diff changeset
    22
#include <mpxcommand.h>
hgs
parents:
diff changeset
    23
#include <mpxcommandgeneraldefs.h>
hgs
parents:
diff changeset
    24
#include <mpxplaybackutility.h>
hgs
parents:
diff changeset
    25
#include <mpxvideoplaybackdefs.h>
hgs
parents:
diff changeset
    26
hgs
parents:
diff changeset
    27
#include "mpxvideoviewwrapper.h"
hgs
parents:
diff changeset
    28
#include "mpxvideoplaybackdisplayhandler.h"
hgs
parents:
diff changeset
    29
#include "mpxvideoregion.h"
hgs
parents:
diff changeset
    30
#include "mpxvideoplaybackviewfiledetails.h"
hgs
parents:
diff changeset
    31
hgs
parents:
diff changeset
    32
hgs
parents:
diff changeset
    33
CMPXVideoPlaybackDisplayHandler::CMPXVideoPlaybackDisplayHandler( MMPXPlaybackUtility* aPlayUtil,
hgs
parents:
diff changeset
    34
                                                                  CMPXVideoViewWrapper* aViewWrapper )
hgs
parents:
diff changeset
    35
    : iPlaybackUtility( aPlayUtil )
hgs
parents:
diff changeset
    36
    , iViewWrapper( aViewWrapper )
hgs
parents:
diff changeset
    37
{
hgs
parents:
diff changeset
    38
}
hgs
parents:
diff changeset
    39
hgs
parents:
diff changeset
    40
CMPXVideoPlaybackDisplayHandler::~CMPXVideoPlaybackDisplayHandler()
hgs
parents:
diff changeset
    41
{
hgs
parents:
diff changeset
    42
}
hgs
parents:
diff changeset
    43
hgs
parents:
diff changeset
    44
CMPXVideoPlaybackDisplayHandler*
hgs
parents:
diff changeset
    45
CMPXVideoPlaybackDisplayHandler::NewL( MMPXPlaybackUtility* aPlayUtil,
hgs
parents:
diff changeset
    46
                                       CMPXVideoViewWrapper* aViewWrapper )
hgs
parents:
diff changeset
    47
{
hgs
parents:
diff changeset
    48
    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::NewL()"));
hgs
parents:
diff changeset
    49
hgs
parents:
diff changeset
    50
    CMPXVideoPlaybackDisplayHandler* self =
hgs
parents:
diff changeset
    51
        new(ELeave) CMPXVideoPlaybackDisplayHandler( aPlayUtil, aViewWrapper );
hgs
parents:
diff changeset
    52
hgs
parents:
diff changeset
    53
    CleanupStack::PushL( self );
hgs
parents:
diff changeset
    54
    self->ConstructL();
hgs
parents:
diff changeset
    55
    CleanupStack::Pop();
hgs
parents:
diff changeset
    56
    return self;
hgs
parents:
diff changeset
    57
}
hgs
parents:
diff changeset
    58
hgs
parents:
diff changeset
    59
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    60
//  CMPXVideoPlaybackDisplayHandler::ConstructL()
hgs
parents:
diff changeset
    61
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    62
//
hgs
parents:
diff changeset
    63
void CMPXVideoPlaybackDisplayHandler::ConstructL()
hgs
parents:
diff changeset
    64
{
hgs
parents:
diff changeset
    65
}
hgs
parents:
diff changeset
    66
hgs
parents:
diff changeset
    67
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    68
//   CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL()
hgs
parents:
diff changeset
    69
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    70
//
hgs
parents:
diff changeset
    71
void CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL(
hgs
parents:
diff changeset
    72
                                          RWsSession& aWs,
hgs
parents:
diff changeset
    73
                                          CWsScreenDevice& aScreenDevice,
hgs
parents:
diff changeset
    74
                                          RWindow& aWin,
hgs
parents:
diff changeset
    75
                                          TRect aDisplayRect )
hgs
parents:
diff changeset
    76
{
hgs
parents:
diff changeset
    77
    Q_UNUSED( aWs );
hgs
parents:
diff changeset
    78
    Q_UNUSED( aScreenDevice );
hgs
parents:
diff changeset
    79
    Q_UNUSED( aWin );
hgs
parents:
diff changeset
    80
    Q_UNUSED( aDisplayRect );
hgs
parents:
diff changeset
    81
}
hgs
parents:
diff changeset
    82
hgs
parents:
diff changeset
    83
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    84
//   CMPXVideoPlaybackDisplayHandler::RemoveDisplayWindow()
hgs
parents:
diff changeset
    85
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    86
//
hgs
parents:
diff changeset
    87
void CMPXVideoPlaybackDisplayHandler::RemoveDisplayWindow()
hgs
parents:
diff changeset
    88
{
hgs
parents:
diff changeset
    89
    if ( iVideoDisplay )
hgs
parents:
diff changeset
    90
    {
hgs
parents:
diff changeset
    91
        delete iVideoDisplay;
hgs
parents:
diff changeset
    92
        iVideoDisplay = NULL;
hgs
parents:
diff changeset
    93
    }
hgs
parents:
diff changeset
    94
}
hgs
parents:
diff changeset
    95
hgs
parents:
diff changeset
    96
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    97
//   CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL()
hgs
parents:
diff changeset
    98
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    99
//
39
hgs
parents: 37
diff changeset
   100
void CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL( CMPXMessage* /*aMessage*/ )
34
hgs
parents:
diff changeset
   101
{
hgs
parents:
diff changeset
   102
}
hgs
parents:
diff changeset
   103
hgs
parents:
diff changeset
   104
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
   105
//   CMPXVideoPlaybackDisplayHandler::SetAspectRatioL()
hgs
parents:
diff changeset
   106
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
   107
//
hgs
parents:
diff changeset
   108
TInt CMPXVideoPlaybackDisplayHandler::SetAspectRatioL( TMPXVideoPlaybackCommand aCmd )
hgs
parents:
diff changeset
   109
{
39
hgs
parents: 37
diff changeset
   110
    iCommand = aCmd;
hgs
parents: 37
diff changeset
   111
    
hgs
parents: 37
diff changeset
   112
    switch ( aCmd )
hgs
parents: 37
diff changeset
   113
    {
hgs
parents: 37
diff changeset
   114
        case EPbCmdNaturalAspectRatio:
hgs
parents: 37
diff changeset
   115
        {
hgs
parents: 37
diff changeset
   116
            iAspectRatio = EMMFNatural;
hgs
parents: 37
diff changeset
   117
            break;
hgs
parents: 37
diff changeset
   118
        }
hgs
parents: 37
diff changeset
   119
        case EPbCmdZoomAspectRatio:
hgs
parents: 37
diff changeset
   120
        {
hgs
parents: 37
diff changeset
   121
            iAspectRatio = EMMFZoom;
hgs
parents: 37
diff changeset
   122
            break;
hgs
parents: 37
diff changeset
   123
        }
hgs
parents: 37
diff changeset
   124
        case EPbCmdStretchAspectRatio:
hgs
parents: 37
diff changeset
   125
        {
hgs
parents: 37
diff changeset
   126
            iAspectRatio = EMMFStretch;
hgs
parents: 37
diff changeset
   127
            break;
hgs
parents: 37
diff changeset
   128
        }
hgs
parents: 37
diff changeset
   129
    }
34
hgs
parents:
diff changeset
   130
39
hgs
parents: 37
diff changeset
   131
    return iAspectRatio;
34
hgs
parents:
diff changeset
   132
}
hgs
parents:
diff changeset
   133
hgs
parents:
diff changeset
   134
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
   135
//   CMPXVideoPlaybackDisplayHandler::SetDefaultAspectRatioL
hgs
parents:
diff changeset
   136
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
   137
//
hgs
parents:
diff changeset
   138
TInt CMPXVideoPlaybackDisplayHandler::SetDefaultAspectRatioL(
hgs
parents:
diff changeset
   139
                                          QMPXVideoPlaybackViewFileDetails* aFileDetails,
37
hgs
parents: 34
diff changeset
   140
                                          TReal32 aDisplayAspectRatio )
34
hgs
parents:
diff changeset
   141
{
hgs
parents:
diff changeset
   142
    Q_UNUSED( aFileDetails );
hgs
parents:
diff changeset
   143
    Q_UNUSED( aDisplayAspectRatio );
hgs
parents:
diff changeset
   144
39
hgs
parents: 37
diff changeset
   145
    return iAspectRatio;
34
hgs
parents:
diff changeset
   146
}
hgs
parents:
diff changeset
   147
hgs
parents:
diff changeset
   148
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
   149
//   CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL()
hgs
parents:
diff changeset
   150
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
   151
//
39
hgs
parents: 37
diff changeset
   152
void CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL( TRect aClipRect, TBool transitionEffect  )
34
hgs
parents:
diff changeset
   153
{
hgs
parents:
diff changeset
   154
    MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL()"));
hgs
parents:
diff changeset
   155
39
hgs
parents: 37
diff changeset
   156
    Q_UNUSED( transitionEffect );
34
hgs
parents:
diff changeset
   157
39
hgs
parents: 37
diff changeset
   158
    iRect = aClipRect;
34
hgs
parents:
diff changeset
   159
}
hgs
parents:
diff changeset
   160
hgs
parents:
diff changeset
   161
// End of File