videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoviewwrapper.cpp
author hgs
Fri, 06 Aug 2010 09:43:48 +0300
changeset 50 21fe8338c6bf
parent 44 518105d52e45
child 66 adb51f74b890
permissions -rw-r--r--
201031
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
44
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 base playback view
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
50
hgs
parents: 44
diff changeset
    18
// Version : %version: 7 %
44
hgs
parents:
diff changeset
    19
hgs
parents:
diff changeset
    20
hgs
parents:
diff changeset
    21
hgs
parents:
diff changeset
    22
//  Include Files
hgs
parents:
diff changeset
    23
hgs
parents:
diff changeset
    24
#include "mpxvideoviewwrapper.h"
hgs
parents:
diff changeset
    25
#include "videobaseplaybackview.h"
hgs
parents:
diff changeset
    26
#include "videoplaybackviewfiledetails.h"
hgs
parents:
diff changeset
    27
#include "mpxcommonvideoplaybackview.hrh"
hgs
parents:
diff changeset
    28
hgs
parents:
diff changeset
    29
//  Member Functions
hgs
parents:
diff changeset
    30
hgs
parents:
diff changeset
    31
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    32
// CMPXVideoViewWrapper::CMPXVideoViewWrapper()
hgs
parents:
diff changeset
    33
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    34
//
hgs
parents:
diff changeset
    35
CMPXVideoViewWrapper::CMPXVideoViewWrapper( VideoBasePlaybackView* aView )
50
hgs
parents: 44
diff changeset
    36
    : iView( aView )
44
hgs
parents:
diff changeset
    37
{
hgs
parents:
diff changeset
    38
}
hgs
parents:
diff changeset
    39
hgs
parents:
diff changeset
    40
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    41
// CMPXVideoViewWrapper::NewL()
hgs
parents:
diff changeset
    42
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    43
//
hgs
parents:
diff changeset
    44
CMPXVideoViewWrapper* CMPXVideoViewWrapper::NewL( VideoBasePlaybackView* aView )
hgs
parents:
diff changeset
    45
{
hgs
parents:
diff changeset
    46
    CMPXVideoViewWrapper* self = new (ELeave) CMPXVideoViewWrapper( aView );
hgs
parents:
diff changeset
    47
hgs
parents:
diff changeset
    48
    CleanupStack::PushL( self );
hgs
parents:
diff changeset
    49
    self->ConstructL();
hgs
parents:
diff changeset
    50
    CleanupStack::Pop();
hgs
parents:
diff changeset
    51
hgs
parents:
diff changeset
    52
    return self;
hgs
parents:
diff changeset
    53
}
hgs
parents:
diff changeset
    54
hgs
parents:
diff changeset
    55
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    56
//   CMPXVideoViewWrapper::ConstructL()
hgs
parents:
diff changeset
    57
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    58
//
hgs
parents:
diff changeset
    59
void CMPXVideoViewWrapper::ConstructL()
hgs
parents:
diff changeset
    60
{
50
hgs
parents: 44
diff changeset
    61
    iMediaRequested = EFalse;
44
hgs
parents:
diff changeset
    62
}
hgs
parents:
diff changeset
    63
hgs
parents:
diff changeset
    64
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    65
// CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
hgs
parents:
diff changeset
    66
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    67
//
hgs
parents:
diff changeset
    68
CMPXVideoViewWrapper::~CMPXVideoViewWrapper()
hgs
parents:
diff changeset
    69
{
hgs
parents:
diff changeset
    70
}
hgs
parents:
diff changeset
    71
hgs
parents:
diff changeset
    72
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    73
// CMPXVideoViewWrapper::IsLive()
hgs
parents:
diff changeset
    74
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    75
//
hgs
parents:
diff changeset
    76
TBool CMPXVideoViewWrapper::IsLive()
hgs
parents:
diff changeset
    77
{
hgs
parents:
diff changeset
    78
    return EFalse;
hgs
parents:
diff changeset
    79
}
hgs
parents:
diff changeset
    80
hgs
parents:
diff changeset
    81
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    82
// CMPXVideoViewWrapper::IsPlaylist()
hgs
parents:
diff changeset
    83
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    84
//
hgs
parents:
diff changeset
    85
TBool CMPXVideoViewWrapper::IsPlaylist()
hgs
parents:
diff changeset
    86
{
50
hgs
parents: 44
diff changeset
    87
    return EFalse;
44
hgs
parents:
diff changeset
    88
}
hgs
parents:
diff changeset
    89
hgs
parents:
diff changeset
    90
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    91
//   CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL()
hgs
parents:
diff changeset
    92
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
    93
//
hgs
parents:
diff changeset
    94
void CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL( int aCmd )
hgs
parents:
diff changeset
    95
{
hgs
parents:
diff changeset
    96
    Q_UNUSED( aCmd );
hgs
parents:
diff changeset
    97
}
hgs
parents:
diff changeset
    98
hgs
parents:
diff changeset
    99
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
   100
//   CMPXVideoViewWrapper::HandleCommandL()
hgs
parents:
diff changeset
   101
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
   102
//
hgs
parents:
diff changeset
   103
void CMPXVideoViewWrapper::HandleCommandL( TInt aCommand )
hgs
parents:
diff changeset
   104
{
hgs
parents:
diff changeset
   105
    switch ( aCommand )
hgs
parents:
diff changeset
   106
    {
hgs
parents:
diff changeset
   107
        case EMPXPbvCmdNextListItem:
hgs
parents:
diff changeset
   108
        {
50
hgs
parents: 44
diff changeset
   109
            SetFileDetails( EFalse );
hgs
parents: 44
diff changeset
   110
            break;
44
hgs
parents:
diff changeset
   111
        }
50
hgs
parents: 44
diff changeset
   112
44
hgs
parents:
diff changeset
   113
        case EMPXPbvCmdPreviousListItem:
hgs
parents:
diff changeset
   114
        {
50
hgs
parents: 44
diff changeset
   115
            SetFileDetails( ETrue );
hgs
parents: 44
diff changeset
   116
            break;
44
hgs
parents:
diff changeset
   117
        }
hgs
parents:
diff changeset
   118
    }
hgs
parents:
diff changeset
   119
hgs
parents:
diff changeset
   120
}
hgs
parents:
diff changeset
   121
hgs
parents:
diff changeset
   122
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
   123
// Request for the media object
hgs
parents:
diff changeset
   124
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
   125
//
hgs
parents:
diff changeset
   126
void CMPXVideoViewWrapper::RequestMediaL()
hgs
parents:
diff changeset
   127
{
hgs
parents:
diff changeset
   128
    iMediaRequested = ETrue;
50
hgs
parents: 44
diff changeset
   129
44
hgs
parents:
diff changeset
   130
    SetFileDetails( ETrue );
50
hgs
parents: 44
diff changeset
   131
44
hgs
parents:
diff changeset
   132
}
hgs
parents:
diff changeset
   133
hgs
parents:
diff changeset
   134
hgs
parents:
diff changeset
   135
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
   136
//   CMPXVideoViewWrapper::ActivateClosePlayerActiveObject
hgs
parents:
diff changeset
   137
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
   138
//
hgs
parents:
diff changeset
   139
void CMPXVideoViewWrapper::ActivateClosePlayerActiveObject()
hgs
parents:
diff changeset
   140
{
hgs
parents:
diff changeset
   141
    iClosePlayerAO = ETrue;
hgs
parents:
diff changeset
   142
}
hgs
parents:
diff changeset
   143
hgs
parents:
diff changeset
   144
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
   145
//   CMPXVideoViewWrapper::IsMultiItemPlaylist()
hgs
parents:
diff changeset
   146
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
   147
//
hgs
parents:
diff changeset
   148
TBool CMPXVideoViewWrapper::IsMultiItemPlaylist()
hgs
parents:
diff changeset
   149
{
hgs
parents:
diff changeset
   150
    return iFileDetails->mMultiItemPlaylist;
hgs
parents:
diff changeset
   151
}
hgs
parents:
diff changeset
   152
hgs
parents:
diff changeset
   153
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
   154
//   CMPXVideoViewWrapper::SetFileDetails()
hgs
parents:
diff changeset
   155
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
   156
//
hgs
parents:
diff changeset
   157
void CMPXVideoViewWrapper::SetFileDetails(TBool aDefault)
hgs
parents:
diff changeset
   158
{
hgs
parents:
diff changeset
   159
    if ( iFileDetails )
hgs
parents:
diff changeset
   160
    {
hgs
parents:
diff changeset
   161
        delete iFileDetails;
hgs
parents:
diff changeset
   162
        iFileDetails = NULL;
hgs
parents:
diff changeset
   163
    }
50
hgs
parents: 44
diff changeset
   164
hgs
parents: 44
diff changeset
   165
    iFileDetails = new VideoPlaybackViewFileDetails();
hgs
parents: 44
diff changeset
   166
hgs
parents: 44
diff changeset
   167
    _LIT(KTestMimeType, "video/3gp");
44
hgs
parents:
diff changeset
   168
    const QString qMimeType( (QChar*)KTestMimeType().Ptr(), KTestMimeType().Length() );
50
hgs
parents: 44
diff changeset
   169
    iFileDetails->mMimeType = qMimeType;
44
hgs
parents:
diff changeset
   170
hgs
parents:
diff changeset
   171
    _LIT(KTestTitle, "Test Video Title");
hgs
parents:
diff changeset
   172
    const QString qTitle( (QChar*)KTestTitle().Ptr(), KTestTitle().Length() );
50
hgs
parents: 44
diff changeset
   173
    iFileDetails->mTitle = qTitle;
44
hgs
parents:
diff changeset
   174
hgs
parents:
diff changeset
   175
    _LIT(KTestArtist, "TestArtist");
hgs
parents:
diff changeset
   176
    const QString qArtist( (QChar*)KTestArtist().Ptr(), KTestArtist().Length() );
hgs
parents:
diff changeset
   177
    iFileDetails->mArtist = qArtist;
hgs
parents:
diff changeset
   178
hgs
parents:
diff changeset
   179
    _LIT(KTestDescription, "Test Description");
hgs
parents:
diff changeset
   180
    const QString qDescription( (QChar*)KTestDescription().Ptr(), KTestDescription().Length() );
hgs
parents:
diff changeset
   181
    iFileDetails->mDescription = qDescription;
hgs
parents:
diff changeset
   182
hgs
parents:
diff changeset
   183
    _LIT(KTestLocation, "Test Location");
hgs
parents:
diff changeset
   184
    const QString qLocation( (QChar*)KTestLocation().Ptr(), KTestLocation().Length() );
hgs
parents:
diff changeset
   185
    iFileDetails->mLocation = qLocation;
hgs
parents:
diff changeset
   186
hgs
parents:
diff changeset
   187
    _LIT(KTestCopyright, "Test Copyright");
hgs
parents:
diff changeset
   188
    const QString qCopyright( (QChar*)KTestCopyright().Ptr(), KTestCopyright().Length() );
hgs
parents:
diff changeset
   189
    iFileDetails->mCopyright = qCopyright;
hgs
parents:
diff changeset
   190
hgs
parents:
diff changeset
   191
    _LIT(KTestLanguage, "Test Language");
hgs
parents:
diff changeset
   192
    const QString qLanguage( (QChar*)KTestLanguage().Ptr(), KTestLanguage().Length() );
hgs
parents:
diff changeset
   193
    iFileDetails->mLanguage = qLanguage;
hgs
parents:
diff changeset
   194
hgs
parents:
diff changeset
   195
    _LIT(KTestKeywords, "Test Keywords");
hgs
parents:
diff changeset
   196
    const QString qKeywords( (QChar*)KTestKeywords().Ptr(), KTestKeywords().Length() );
hgs
parents:
diff changeset
   197
    iFileDetails->mKeywords = qKeywords;
hgs
parents:
diff changeset
   198
hgs
parents:
diff changeset
   199
    if ( aDefault )
hgs
parents:
diff changeset
   200
    {
hgs
parents:
diff changeset
   201
        _LIT(KTestClipName, "testClip.3gp");
hgs
parents:
diff changeset
   202
        const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
50
hgs
parents: 44
diff changeset
   203
        iFileDetails->mClipName = qClipname;
44
hgs
parents:
diff changeset
   204
    }
hgs
parents:
diff changeset
   205
    else
hgs
parents:
diff changeset
   206
    {
hgs
parents:
diff changeset
   207
        _LIT(KTestClipName, "nextClip.3gp");
hgs
parents:
diff changeset
   208
        const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
50
hgs
parents: 44
diff changeset
   209
        iFileDetails->mClipName = qClipname;
44
hgs
parents:
diff changeset
   210
    }
50
hgs
parents: 44
diff changeset
   211
hgs
parents: 44
diff changeset
   212
44
hgs
parents:
diff changeset
   213
    iFileDetails->mPlaybackMode = EMPXVideoLocal;
hgs
parents:
diff changeset
   214
    iFileDetails->mSeekable = true;
hgs
parents:
diff changeset
   215
    iFileDetails->mPausableStream = true;
hgs
parents:
diff changeset
   216
    iFileDetails->mAudioEnabled = true;
hgs
parents:
diff changeset
   217
    iFileDetails->mVideoEnabled = true;
hgs
parents:
diff changeset
   218
    iFileDetails->mPartialPlayback = false;
hgs
parents:
diff changeset
   219
    iFileDetails->mRNFormat = false;
hgs
parents:
diff changeset
   220
    iFileDetails->mDuration = 100;
hgs
parents:
diff changeset
   221
    iFileDetails->mTvOutConnected  = false;
hgs
parents:
diff changeset
   222
    iFileDetails->mDrmProtected = false;
hgs
parents:
diff changeset
   223
    iFileDetails->mMultiItemPlaylist = false;
hgs
parents:
diff changeset
   224
    iFileDetails->mVideoHeight = 320;
hgs
parents:
diff changeset
   225
    iFileDetails->mVideoWidth  = 240;
50
hgs
parents: 44
diff changeset
   226
    iFileDetails->mBitRate = 16000;
44
hgs
parents:
diff changeset
   227
}
hgs
parents:
diff changeset
   228
hgs
parents:
diff changeset
   229
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
   230
//   CMPXVideoViewWrapper::IssueVideoAppForegroundCmd()
hgs
parents:
diff changeset
   231
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
   232
//
hgs
parents:
diff changeset
   233
void CMPXVideoViewWrapper::IssueVideoAppForegroundCmdL( TBool aForeground )
hgs
parents:
diff changeset
   234
{
hgs
parents:
diff changeset
   235
    iForeground = aForeground;
hgs
parents:
diff changeset
   236
}
hgs
parents:
diff changeset
   237
hgs
parents:
diff changeset
   238
hgs
parents:
diff changeset
   239
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
   240
//   CMPXVideoViewWrapper::UpdateVideoRectDone()
hgs
parents:
diff changeset
   241
// -------------------------------------------------------------------------------------------------
hgs
parents:
diff changeset
   242
//
hgs
parents:
diff changeset
   243
void CMPXVideoViewWrapper::UpdateVideoRectDone()
hgs
parents:
diff changeset
   244
{
hgs
parents:
diff changeset
   245
}
50
hgs
parents: 44
diff changeset
   246
hgs
parents: 44
diff changeset
   247
// -------------------------------------------------------------------------------------------------
hgs
parents: 44
diff changeset
   248
//   CMPXVideoViewWrapper::SurfacedAttached()
hgs
parents: 44
diff changeset
   249
// -------------------------------------------------------------------------------------------------
hgs
parents: 44
diff changeset
   250
//
hgs
parents: 44
diff changeset
   251
void CMPXVideoViewWrapper::SurfacedAttached( TBool aAttached )
hgs
parents: 44
diff changeset
   252
{
hgs
parents: 44
diff changeset
   253
    iAttatched = aAttached;
hgs
parents: 44
diff changeset
   254
}
hgs
parents: 44
diff changeset
   255
44
hgs
parents:
diff changeset
   256
// EOF