os/mm/mmlibs/mmfw/src/Client/Video/mmfclientvideoplayer.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
sl@0
    17
#include <mmf/common/mmfstandardcustomcommands.h>  
sl@0
    18
#include <mmf/common/mmfvideo.h>
sl@0
    19
#include <mmf/common/mmfpaniccodes.h>
sl@0
    20
#include <mmf/server/mmfdes.h>
sl@0
    21
#include <mmf/server/mmffile.h>
sl@0
    22
#include <videoplayer.h>
sl@0
    23
#include "mmfvideocallback.h"
sl@0
    24
#include "VideoPlayerBody.h"
sl@0
    25
#include "mmfvideopaniccodes.h"
sl@0
    26
#include "mmfclientvideocommon.h"
sl@0
    27
sl@0
    28
sl@0
    29
void Panic(TInt aPanicCode)
sl@0
    30
	{
sl@0
    31
	_LIT(KMMFMediaClientVideoPanicCategory, "MMFVideoClient");
sl@0
    32
	User::Panic(KMMFMediaClientVideoPanicCategory, aPanicCode);
sl@0
    33
	}
sl@0
    34
sl@0
    35
/**
sl@0
    36
Constructs and initialises a new instance of the video player utility.
sl@0
    37
sl@0
    38
This function leaves if the video player utility object cannot be created.
sl@0
    39
sl@0
    40
@param  aObserver
sl@0
    41
        A client class to receive notifications from the video player.
sl@0
    42
@param  aPriority
sl@0
    43
        The Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and 
sl@0
    44
        EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request.
sl@0
    45
@param  aPref
sl@0
    46
        The Priority Preference - an additional audio policy parameter. The suggested default is 
sl@0
    47
        EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional 
sl@0
    48
        values may be supported by given phones and/or platforms, but should not be depended upon by 
sl@0
    49
        portable code.
sl@0
    50
@param  aWs
sl@0
    51
        The window server session id.
sl@0
    52
@param  aScreenDevice
sl@0
    53
        The software device screen.
sl@0
    54
@param  aWindow
sl@0
    55
        The display window.
sl@0
    56
@param  aScreenRect
sl@0
    57
        The dimensions of the display window.
sl@0
    58
@param  aClipRect
sl@0
    59
        The area of the video clip to display in the window.
sl@0
    60
sl@0
    61
@return A pointer to the new video player utility object.
sl@0
    62
sl@0
    63
@since 7.0s
sl@0
    64
sl@0
    65
Note: The Priority Value and Priority Preference are used primarily when deciding what to do when
sl@0
    66
several audio clients attempt to play or record simultaneously. In addition to the Priority Value and Preference, 
sl@0
    67
the adaptation may consider other parameters such as the SecureId and Capabilities of the client process. 
sl@0
    68
Whatever, the decision  as to what to do in such situations is up to the audio adaptation, and may
sl@0
    69
vary between different phones. Portable applications are advised not to assume any specific behaviour. 
sl@0
    70
*/
sl@0
    71
EXPORT_C CVideoPlayerUtility* CVideoPlayerUtility::NewL(MVideoPlayerUtilityObserver& aObserver,
sl@0
    72
														TInt aPriority,
sl@0
    73
														TInt aPref,
sl@0
    74
														RWsSession& aWs,
sl@0
    75
														CWsScreenDevice& aScreenDevice,
sl@0
    76
														RWindowBase& aWindow,
sl@0
    77
														const TRect& aScreenRect,
sl@0
    78
														const TRect& aClipRect)
sl@0
    79
	{
sl@0
    80
	CVideoPlayerUtility* s = new(ELeave) CVideoPlayerUtility();
sl@0
    81
	CleanupStack::PushL(s);
sl@0
    82
	s->iBody = CBody::NewL(s, aObserver, aPriority, aPref, aWs, aScreenDevice,
sl@0
    83
												aWindow, aScreenRect, aClipRect);
sl@0
    84
	CleanupStack::Pop();
sl@0
    85
	return s;
sl@0
    86
	}
sl@0
    87
sl@0
    88
/**
sl@0
    89
Destructor. Closes any open video clips and frees any resources held by the Video Player.
sl@0
    90
sl@0
    91
@since  7.0s
sl@0
    92
*/
sl@0
    93
CVideoPlayerUtility::~CVideoPlayerUtility()
sl@0
    94
	{
sl@0
    95
	delete iBody;
sl@0
    96
	}
sl@0
    97
sl@0
    98
/**
sl@0
    99
Opens a video clip from a file.
sl@0
   100
sl@0
   101
This function opens a video clip from a file using an optionally specified plugin. If no controller
sl@0
   102
plugin is specified, this function searches through a list of all available plugins and attempts to 
sl@0
   103
use each one until successful or the end of the list is reached.
sl@0
   104
sl@0
   105
Once the opening of the video clip is complete, successfully or otherwise, the callback function 
sl@0
   106
MVideoPlayerUtilityObserver::MvpuoOpenComplete() is called.
sl@0
   107
sl@0
   108
This function leaves if errors are encountered opening the specified video clip file, or in initialising a 
sl@0
   109
specified/unspecified controller plugin.
sl@0
   110
sl@0
   111
This function can leave with one of the specified error codes. Most open failures
sl@0
   112
will however be reported through the MVideoPlayerUtilityObserver interface.
sl@0
   113
sl@0
   114
From Symbian release v9.5 onwards, this function will enable graphics surface use if the controller supports it. 
sl@0
   115
If this function is called through an instance of the derived class CVideoPlayerUtility2 and the controller doesn't support graphics surfaces, 
sl@0
   116
it fails with KErrNotSupported.
sl@0
   117
sl@0
   118
@param  aFileName
sl@0
   119
        The full path name of the file containing the video data.
sl@0
   120
@param  aControllerUid
sl@0
   121
        If specified, it will force the video player to use the
sl@0
   122
		controller with the given UID.
sl@0
   123
sl@0
   124
@since  7.0s
sl@0
   125
*/
sl@0
   126
EXPORT_C void CVideoPlayerUtility::OpenFileL(const TDesC& aFileName, TUid aControllerUid)
sl@0
   127
	{
sl@0
   128
	iBody->OpenFileL(aFileName, aControllerUid);
sl@0
   129
	}
sl@0
   130
sl@0
   131
/**
sl@0
   132
Opens a video clip from a file.
sl@0
   133
sl@0
   134
This function opens a video clip from a file using an optionally specified plugin. If no controller
sl@0
   135
plugin is specified, this function searches through a list of all available plugins and attempts to 
sl@0
   136
use each one until successful or the end of the list is reached.
sl@0
   137
sl@0
   138
Once the opening of the video clip is complete, successfully or otherwise, the callback function 
sl@0
   139
MVideoPlayerUtilityObserver::MvpuoOpenComplete() is called.
sl@0
   140
sl@0
   141
This function leaves if errors are encountered opening the specified video clip file, or in initialising a 
sl@0
   142
specified/unspecified controller plugin.
sl@0
   143
sl@0
   144
This function can leave with one of the specified error codes. Most open failures
sl@0
   145
will however be reported through the MVideoPlayerUtilityObserver interface.
sl@0
   146
sl@0
   147
From Symbian release v9.5 onwards, this function will enable graphics surface use if the controller supports it. 
sl@0
   148
If this function is called through an instance of the derived class CVideoPlayerUtility2 and the controller doesn't support graphics surfaces, 
sl@0
   149
it fails with KErrNotSupported.
sl@0
   150
sl@0
   151
@param  aFile
sl@0
   152
        An open handle to a file containing the video clip
sl@0
   153
@param  aControllerUid
sl@0
   154
        If specified, it will force the video player to use the
sl@0
   155
		controller with the given UID.
sl@0
   156
sl@0
   157
@since  7.0s
sl@0
   158
*/
sl@0
   159
EXPORT_C void CVideoPlayerUtility::OpenFileL(const RFile& aFile, TUid aControllerUid)
sl@0
   160
	{
sl@0
   161
	iBody->OpenFileL(aFile, aControllerUid);
sl@0
   162
	}
sl@0
   163
sl@0
   164
sl@0
   165
/**
sl@0
   166
Opens a video clip from a file.
sl@0
   167
sl@0
   168
This function opens a video clip from a file using an optionally specified plugin. If no controller
sl@0
   169
plugin is specified, this function searches through a list of all available plugins and attempts to 
sl@0
   170
use each one until successful or the end of the list is reached.
sl@0
   171
sl@0
   172
Once the opening of the video clip is complete, successfully or otherwise, the callback function 
sl@0
   173
MVideoPlayerUtilityObserver::MvpuoOpenComplete() is called.
sl@0
   174
sl@0
   175
This function leaves if errors are encountered opening the specified video clip file, or in initialising a 
sl@0
   176
specified/unspecified controller plugin.
sl@0
   177
sl@0
   178
This function can leave with one of the specified error codes. Most open failures
sl@0
   179
will however be reported through the MVideoPlayerUtilityObserver interface.
sl@0
   180
sl@0
   181
From Symbian release v9.5 onwards, this function will enable graphics surface use if the controller supports it. 
sl@0
   182
If this function is called through an instance of the derived class CVideoPlayerUtility2 and the controller doesn't support graphics surfaces, 
sl@0
   183
it fails with KErrNotSupported.
sl@0
   184
sl@0
   185
@param  aSource
sl@0
   186
        A filename or an open handle to a file containing the video clip
sl@0
   187
@param  aControllerUid
sl@0
   188
        If specified, it will force the video player to use the
sl@0
   189
		controller with the given UID.
sl@0
   190
*/
sl@0
   191
EXPORT_C void CVideoPlayerUtility::OpenFileL(const TMMSource& aSource, TUid aControllerUid)
sl@0
   192
	{
sl@0
   193
	iBody->OpenFileL(aSource, aControllerUid);
sl@0
   194
	}
sl@0
   195
sl@0
   196
/**
sl@0
   197
Opens a video clip contained in a descriptor.
sl@0
   198
sl@0
   199
This function opens a video clip contained as binary data in a descriptor using an optionally specified 
sl@0
   200
plugin. If no controller plugin is specified, this function searches through a list of all available 
sl@0
   201
plugins and attempts to use each one until successful or the end of the list is reached.
sl@0
   202
sl@0
   203
Once the opening of the video clip is complete, successfully or otherwise, the callback function 
sl@0
   204
MVideoPlayerUtilityObserver::MvpuoOpenComplete() is called.
sl@0
   205
sl@0
   206
This function can leave with one of the specified error codes. Most open failures will however be
sl@0
   207
reported through the interface.
sl@0
   208
sl@0
   209
From Symbian release v9.5 onwards, this function will enable graphics surface use if the controller supports it. 
sl@0
   210
If this function is called through an instance of the derived class CVideoPlayerUtility2 and the controller doesn't support graphics surfaces, 
sl@0
   211
it fails with KErrNotSupported.
sl@0
   212
sl@0
   213
@param  aDescriptor
sl@0
   214
        The descriptor containing the video clip
sl@0
   215
@param  aControllerUid
sl@0
   216
        If specified, it will force the video player to use the
sl@0
   217
        controller with the given UID.
sl@0
   218
sl@0
   219
@since  7.0s
sl@0
   220
*/
sl@0
   221
EXPORT_C void CVideoPlayerUtility::OpenDesL(const TDesC8& aDescriptor, TUid aControllerUid)
sl@0
   222
	{
sl@0
   223
	iBody->OpenDesL(aDescriptor, aControllerUid);
sl@0
   224
	}
sl@0
   225
sl@0
   226
/**
sl@0
   227
Opens a video clip from a URL.
sl@0
   228
sl@0
   229
This function opens a video clip stored at a specified URL and identified by a MIME type. In addition
sl@0
   230
a plugin can be specified if necessary. If no controller plugin is specified, this function searches 
sl@0
   231
through a list of all available plugins and attempts to use each one until successful or the end 
sl@0
   232
of the list is reached.
sl@0
   233
sl@0
   234
Once the opening of the video clip is complete, successfully or otherwise, the callback function 
sl@0
   235
MVideoPlayerUtilityObserver::MvpuoOpenComplete() is called.
sl@0
   236
sl@0
   237
This function can leave with one of the specified error codes. Most open failures
sl@0
   238
will however be reported through the MVideoPlayerUtilityObserver interface.
sl@0
   239
sl@0
   240
From Symbian release v9.5 onwards, this function will enable graphics surface use if the controller supports it. 
sl@0
   241
If this function is called through an instance of the derived class CVideoPlayerUtility2 and the controller doesn't support graphics surfaces, 
sl@0
   242
it fails with KErrNotSupported.
sl@0
   243
sl@0
   244
@param  aUrl
sl@0
   245
        The URL of the video clip to open.
sl@0
   246
@param  aIapId
sl@0
   247
        The Id of the internet access point to use
sl@0
   248
@param  aMimeType
sl@0
   249
        The MIME type associated with this video clip. This is
sl@0
   250
        used to determine the format of the video clip.
sl@0
   251
@param  aControllerUid
sl@0
   252
        If specified, it will force the video player to use the controller with the given Uid.
sl@0
   253
sl@0
   254
@since  7.0s
sl@0
   255
*/
sl@0
   256
EXPORT_C void CVideoPlayerUtility::OpenUrlL(const TDesC& aUrl, TInt aIapId, const TDesC8& aMimeType, TUid aControllerUid)
sl@0
   257
	{
sl@0
   258
	iBody->OpenUrlL(aUrl, aIapId, aMimeType, aControllerUid);
sl@0
   259
	}
sl@0
   260
sl@0
   261
/**
sl@0
   262
Closes the video clip.
sl@0
   263
sl@0
   264
@since 7.0s
sl@0
   265
*/
sl@0
   266
EXPORT_C void CVideoPlayerUtility::Close()
sl@0
   267
	{
sl@0
   268
	iBody->Close();
sl@0
   269
	}
sl@0
   270
sl@0
   271
/**
sl@0
   272
Begins playback of the initialised video sample at the current volume and priority levels.
sl@0
   273
sl@0
   274
When playing of the video sample is complete, successfully or otherwise, the callback function
sl@0
   275
MVideoPlayerUtilityObserver::MvpuoPlayComplete() is called.
sl@0
   276
sl@0
   277
@since 7.0s
sl@0
   278
*/
sl@0
   279
EXPORT_C void CVideoPlayerUtility::Play()
sl@0
   280
	{
sl@0
   281
	iBody->Play();
sl@0
   282
	}
sl@0
   283
sl@0
   284
/**
sl@0
   285
Begins playback of the initialised video sample at the specified start and end points.
sl@0
   286
sl@0
   287
When playing of the video sample is complete, successfully or otherwise, the callback function
sl@0
   288
MVideoPlayerUtilityObserver::MvpuoPlayComplete() is called.
sl@0
   289
sl@0
   290
@param  aStartTime
sl@0
   291
        The point at which to start playback.
sl@0
   292
@param  aEndTime
sl@0
   293
        The point at which to terminate playback.
sl@0
   294
sl@0
   295
@since 7.0s
sl@0
   296
*/
sl@0
   297
EXPORT_C void CVideoPlayerUtility::Play(const TTimeIntervalMicroSeconds& aStartTime, const TTimeIntervalMicroSeconds& aEndTime)
sl@0
   298
	{
sl@0
   299
	iBody->Play(aStartTime, aEndTime);
sl@0
   300
	}
sl@0
   301
sl@0
   302
/**
sl@0
   303
Stops playback of the video sample as soon as is possible. 
sl@0
   304
sl@0
   305
If the video sample is playing, playback is stopped as soon as possible.
sl@0
   306
sl@0
   307
If playback is already complete, this function has no effect.
sl@0
   308
sl@0
   309
The position is reset to the beginning of the file.
sl@0
   310
sl@0
   311
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
sl@0
   312
        another of the system-wide error codes.
sl@0
   313
sl@0
   314
@since  7.0s
sl@0
   315
*/
sl@0
   316
EXPORT_C TInt CVideoPlayerUtility::Stop()
sl@0
   317
	{
sl@0
   318
	return iBody->Stop();
sl@0
   319
	}
sl@0
   320
sl@0
   321
/**
sl@0
   322
Video playback is paused. The current position is maintained and playback can be
sl@0
   323
resumed by calling Play.
sl@0
   324
sl@0
   325
@since 7.0s
sl@0
   326
*/
sl@0
   327
EXPORT_C void CVideoPlayerUtility::PauseL()
sl@0
   328
	{
sl@0
   329
	iBody->PauseL();
sl@0
   330
	}
sl@0
   331
sl@0
   332
/**
sl@0
   333
Sets the playback volume for the audio track of the video clip.
sl@0
   334
sl@0
   335
The volume can be changed before or during playback and is effective immediately. The volume can
sl@0
   336
be set to any value between zero (mute) and the maximum permissible volume
sl@0
   337
(determined using MaxVolume()).
sl@0
   338
sl@0
   339
To determine if the current video clip contains an audio track, use AudioEnabledL().
sl@0
   340
sl@0
   341
sl@0
   342
@param  aVolume
sl@0
   343
        The volume, between 0 and MaxVolume().
sl@0
   344
sl@0
   345
@since 7.0s
sl@0
   346
*/
sl@0
   347
EXPORT_C void CVideoPlayerUtility::SetVolumeL(TInt aVolume)
sl@0
   348
	{
sl@0
   349
	iBody->SetVolumeL(aVolume);
sl@0
   350
	}
sl@0
   351
sl@0
   352
sl@0
   353
//
sl@0
   354
// Sends custom command to the plugin controller.
sl@0
   355
// Passes handle and size of the drawable window.
sl@0
   356
//
sl@0
   357
/**
sl@0
   358
Sets the display window. This is used to provide the video controller with an area of
sl@0
   359
the display to render the current video frame.
sl@0
   360
sl@0
   361
From Symbian release 9.5 onwards this method is not supported when called on an instance of CVideoPlayerUtility2, and will always 
sl@0
   362
leave with KErrNotSupported.
sl@0
   363
sl@0
   364
sl@0
   365
@param  aWs
sl@0
   366
        The window server session ID.
sl@0
   367
@param  aScreenDevice
sl@0
   368
        The software device screen.
sl@0
   369
@param  aWindow
sl@0
   370
        The window to display.
sl@0
   371
@param  aScreenRect
sl@0
   372
        The dimensions of the display window.
sl@0
   373
@param  aClipRect
sl@0
   374
        The area of the video clip to display in the window.
sl@0
   375
sl@0
   376
@since 7.0s
sl@0
   377
*/
sl@0
   378
EXPORT_C void CVideoPlayerUtility::SetDisplayWindowL(RWsSession& aWs, CWsScreenDevice& aScreenDevice,
sl@0
   379
													 RWindowBase& aWindow, const TRect& aScreenRect,
sl@0
   380
													 const TRect& aClipRect)
sl@0
   381
	{
sl@0
   382
	iBody->SetDisplayWindowL(aWs, aScreenDevice, aWindow, aScreenRect, aClipRect);
sl@0
   383
	}
sl@0
   384
sl@0
   385
/**
sl@0
   386
Returns the video frame rate in frames/second.
sl@0
   387
sl@0
   388
@return The video frame rate (frames/second).
sl@0
   389
sl@0
   390
@since  7.0s
sl@0
   391
*/
sl@0
   392
EXPORT_C TReal32 CVideoPlayerUtility::VideoFrameRateL() const
sl@0
   393
	{
sl@0
   394
	return iBody->VideoFrameRateL();
sl@0
   395
	}
sl@0
   396
sl@0
   397
/**
sl@0
   398
Gets the video frame size.
sl@0
   399
sl@0
   400
@param  aSize
sl@0
   401
        The video frame size
sl@0
   402
sl@0
   403
@since 7.0s
sl@0
   404
*/
sl@0
   405
EXPORT_C void CVideoPlayerUtility::VideoFrameSizeL(TSize& aSize) const
sl@0
   406
	{
sl@0
   407
	iBody->VideoFrameSizeL(aSize);
sl@0
   408
	}
sl@0
   409
sl@0
   410
/**
sl@0
   411
Returns the current playback volume for the audio track of the video clip.
sl@0
   412
sl@0
   413
@return A value between 0 (mute) and the maximum volume returned by MaxVolume().
sl@0
   414
sl@0
   415
@since  7.0s
sl@0
   416
*/
sl@0
   417
EXPORT_C TInt CVideoPlayerUtility::Volume() const
sl@0
   418
	{
sl@0
   419
	return iBody->Volume();
sl@0
   420
	}
sl@0
   421
sl@0
   422
/**
sl@0
   423
Sets the current playback balance for the audio track of the video clip.
sl@0
   424
sl@0
   425
The balance can be any value between KMMFBalanceMaxLeft and KMMFBalanceMaxRight,
sl@0
   426
the default value being KMMFBalanceCenter.
sl@0
   427
sl@0
   428
@param  aBalance
sl@0
   429
        The balance value to set.
sl@0
   430
sl@0
   431
@since 7.0s
sl@0
   432
*/
sl@0
   433
EXPORT_C void CVideoPlayerUtility::SetBalanceL(TInt aBalance)
sl@0
   434
	{
sl@0
   435
	iBody->SetBalanceL(aBalance);
sl@0
   436
	}
sl@0
   437
sl@0
   438
/**
sl@0
   439
Returns the current balance setting for the audio track of the video clip.
sl@0
   440
sl@0
   441
@return A balance value between KMMFBalanceMaxLeft and KMMFBalanceMaxRight.
sl@0
   442
sl@0
   443
@since  7.0s
sl@0
   444
*/
sl@0
   445
EXPORT_C TInt CVideoPlayerUtility::Balance() const
sl@0
   446
	{
sl@0
   447
	return iBody->Balance();
sl@0
   448
	}
sl@0
   449
sl@0
   450
/**
sl@0
   451
Returns the video format's MIME type.
sl@0
   452
sl@0
   453
@return The video clip's MIME type.
sl@0
   454
sl@0
   455
@since  7.0s
sl@0
   456
@see    NumberOfMetaDataEntriesL
sl@0
   457
*/
sl@0
   458
EXPORT_C const TDesC8& CVideoPlayerUtility::VideoFormatMimeType() const
sl@0
   459
	{
sl@0
   460
	return iBody->VideoFormatMimeType();
sl@0
   461
	}
sl@0
   462
sl@0
   463
/**
sl@0
   464
Returns the number of meta data entries associated with this clip.
sl@0
   465
sl@0
   466
@return The number of meta data entries.
sl@0
   467
sl@0
   468
@since 7.0s
sl@0
   469
*/
sl@0
   470
EXPORT_C TInt CVideoPlayerUtility::NumberOfMetaDataEntriesL() const
sl@0
   471
	{
sl@0
   472
	return iBody->NumberOfMetaDataEntriesL();
sl@0
   473
	}
sl@0
   474
sl@0
   475
/**
sl@0
   476
Returns a meta data entry from the clip.
sl@0
   477
sl@0
   478
@param  aMetaDataIndex
sl@0
   479
        The index of the meta data entry to retrieve.
sl@0
   480
sl@0
   481
@return The metadata entry requested.
sl@0
   482
sl@0
   483
@since  7.0s
sl@0
   484
@see    NumberOfMetaDataEntriesL
sl@0
   485
*/
sl@0
   486
EXPORT_C CMMFMetaDataEntry* CVideoPlayerUtility::MetaDataEntryL(TInt aMetaDataIndex) const
sl@0
   487
	{
sl@0
   488
	return iBody->MetaDataEntryL(aMetaDataIndex);
sl@0
   489
	}
sl@0
   490
sl@0
   491
/**
sl@0
   492
Sets the playback priority. 
sl@0
   493
sl@0
   494
This is used to arbitrate between multiple objects simultaneously trying to accesses
sl@0
   495
the sound hardware.
sl@0
   496
sl@0
   497
@param  aPriority
sl@0
   498
        The Priority Value.
sl@0
   499
@param  aPref
sl@0
   500
        The Priority Preference.
sl@0
   501
sl@0
   502
@see CVideoPlayerUtility::NewL()
sl@0
   503
sl@0
   504
@since 7.0s
sl@0
   505
sl@0
   506
*/
sl@0
   507
EXPORT_C void CVideoPlayerUtility::SetPriorityL(TInt aPriority, TInt aPref)
sl@0
   508
	{
sl@0
   509
	iBody->SetPriorityL(aPriority, aPref);
sl@0
   510
	}
sl@0
   511
sl@0
   512
/**
sl@0
   513
Get the current playback priority. This is used to arbitrate between simultaneous accesses of
sl@0
   514
the sound hardware.
sl@0
   515
sl@0
   516
@param  aPriority
sl@0
   517
        On return, contains the priority level, EMdaPriorityMin client can be interrupted by any
sl@0
   518
        other client, EMdaPriorityNormal client can only be interrupted by a client with a higher 
sl@0
   519
        priority or EMdaPriorityMax client cannot be interrupted by other clients.
sl@0
   520
@param  aPref
sl@0
   521
        On return, contains the time and quality preferences, enumerated in TMdaPriorityPreference.
sl@0
   522
sl@0
   523
@since 7.0s
sl@0
   524
*/
sl@0
   525
EXPORT_C void CVideoPlayerUtility::PriorityL(TInt& aPriority, TMdaPriorityPreference& aPref) const 
sl@0
   526
	{
sl@0
   527
	iBody->PriorityL(aPriority, aPref);
sl@0
   528
	}
sl@0
   529
sl@0
   530
/**
sl@0
   531
Sets the position within the video clip from where to start playback.
sl@0
   532
sl@0
   533
@param  aPosition
sl@0
   534
        Position from start of clip in microseconds.
sl@0
   535
sl@0
   536
@since 7.0s
sl@0
   537
*/
sl@0
   538
EXPORT_C void CVideoPlayerUtility::SetPositionL(const TTimeIntervalMicroSeconds& aPosition)
sl@0
   539
	{
sl@0
   540
	iBody->SetPositionL(aPosition);
sl@0
   541
	}
sl@0
   542
sl@0
   543
/**
sl@0
   544
Returns the duration of video clip in mircoseconds.
sl@0
   545
sl@0
   546
@return The duration of clip in microseconds.
sl@0
   547
sl@0
   548
@since  7.0s
sl@0
   549
*/
sl@0
   550
EXPORT_C TTimeIntervalMicroSeconds CVideoPlayerUtility::DurationL() const
sl@0
   551
	{
sl@0
   552
	return iBody->DurationL();
sl@0
   553
	}
sl@0
   554
sl@0
   555
/**
sl@0
   556
Returns the current playback position.
sl@0
   557
sl@0
   558
@return The current position from the start of the clip in microseconds.
sl@0
   559
sl@0
   560
@since  7.0s
sl@0
   561
*/
sl@0
   562
EXPORT_C TTimeIntervalMicroSeconds CVideoPlayerUtility::PositionL() const
sl@0
   563
	{
sl@0
   564
	return iBody->PositionL();
sl@0
   565
	}
sl@0
   566
sl@0
   567
/**
sl@0
   568
Returns an integer representing the maximum volume that the audio track can support.
sl@0
   569
sl@0
   570
This is the maximum value that can be passed to SetVolumeL(). This value is platform 
sl@0
   571
independent, but is always greater than or equal to one.
sl@0
   572
sl@0
   573
@return The naximum playback volume.
sl@0
   574
sl@0
   575
@since  7.0s
sl@0
   576
*/
sl@0
   577
EXPORT_C TInt CVideoPlayerUtility::MaxVolume() const
sl@0
   578
	{
sl@0
   579
	return iBody->MaxVolume();
sl@0
   580
	}
sl@0
   581
sl@0
   582
/**
sl@0
   583
Gets the current frame. The current frame is requested, and will be sent to
sl@0
   584
the client asynchrynously via the MvpuoFrameReady callback.
sl@0
   585
sl@0
   586
@param  aDisplayMode
sl@0
   587
        The display mode for the retrieved frame.
sl@0
   588
sl@0
   589
@since  7.0s
sl@0
   590
*/
sl@0
   591
EXPORT_C void CVideoPlayerUtility::GetFrameL(TDisplayMode aDisplayMode)
sl@0
   592
	{
sl@0
   593
	iBody->GetFrameL(aDisplayMode);
sl@0
   594
	}
sl@0
   595
sl@0
   596
/**
sl@0
   597
Gets the current frame. The current frame is requested, and will be sent to
sl@0
   598
the client asynchrynously via the MvpuoFrameReady callback.
sl@0
   599
sl@0
   600
@param  aDisplayMode
sl@0
   601
        The display mode for the retrieved frame.
sl@0
   602
@param  aIntent
sl@0
   603
        The DRM Intent to pass to the controller.
sl@0
   604
*/
sl@0
   605
EXPORT_C void CVideoPlayerUtility::GetFrameL(TDisplayMode aDisplayMode, ContentAccess::TIntent aIntent)
sl@0
   606
	{
sl@0
   607
	iBody->GetFrameL(aDisplayMode, ETrue, aIntent);
sl@0
   608
	}
sl@0
   609
sl@0
   610
/**
sl@0
   611
Returns the video bit rate.
sl@0
   612
sl@0
   613
@return The video bit rate in bits/second.
sl@0
   614
sl@0
   615
@since  7.0s
sl@0
   616
*/
sl@0
   617
EXPORT_C TInt CVideoPlayerUtility::VideoBitRateL() const
sl@0
   618
	{
sl@0
   619
	return iBody->VideoBitRateL();
sl@0
   620
	}
sl@0
   621
sl@0
   622
/**
sl@0
   623
Returns the audio bit rate in bits/second.
sl@0
   624
sl@0
   625
@return The audio bit rate (bits/second).
sl@0
   626
sl@0
   627
@since  7.0s
sl@0
   628
*/
sl@0
   629
EXPORT_C TInt CVideoPlayerUtility::AudioBitRateL() const
sl@0
   630
	{
sl@0
   631
	return iBody->AudioBitRateL();
sl@0
   632
	}
sl@0
   633
sl@0
   634
/**
sl@0
   635
Returns whether the current clip has an audio stream and audio playback
sl@0
   636
is enabled. This method will return EFalse if the clip does no have an
sl@0
   637
audio track or if audio playback has been disabled with
sl@0
   638
SetAudioEnabledL().
sl@0
   639
sl@0
   640
@return ETrue if an audio track is present and audio playback is
sl@0
   641
        enabled, otherwise EFalse.
sl@0
   642
sl@0
   643
@since  7.0s
sl@0
   644
*/
sl@0
   645
EXPORT_C TBool CVideoPlayerUtility::AudioEnabledL() const
sl@0
   646
	{
sl@0
   647
	return iBody->AudioEnabledL();
sl@0
   648
	}
sl@0
   649
sl@0
   650
EXPORT_C void Reserved2()
sl@0
   651
	{
sl@0
   652
	// reserved function replacing removed VideoTypeL() method
sl@0
   653
	// this function should never be called hence generate a
sl@0
   654
	// panic with code ENoVideoTypeL
sl@0
   655
	Panic( ENoVideoTypeL );
sl@0
   656
	}
sl@0
   657
sl@0
   658
/**
sl@0
   659
Returns the codec used for the audio component of the video clip.
sl@0
   660
sl@0
   661
@return The four character code representing the audio codec.
sl@0
   662
sl@0
   663
@since  7.0s
sl@0
   664
*/
sl@0
   665
EXPORT_C TFourCC CVideoPlayerUtility::AudioTypeL() const
sl@0
   666
	{
sl@0
   667
	return iBody->AudioTypeL();
sl@0
   668
	}
sl@0
   669
sl@0
   670
/**
sl@0
   671
Gets the progress of video clip loading/rebuffering.
sl@0
   672
sl@0
   673
@param aPercentageProgress
sl@0
   674
       The percentage of loading/rebuffering complete. The parameter
sl@0
   675
       is zero if loading has not begun and 100 if loading has already completed.
sl@0
   676
sl@0
   677
@since 7.0s
sl@0
   678
*/
sl@0
   679
EXPORT_C void CVideoPlayerUtility::GetVideoLoadingProgressL(TInt& aPercentageProgress)
sl@0
   680
	{
sl@0
   681
	iBody->GetVideoLoadingProgressL(aPercentageProgress);
sl@0
   682
	}
sl@0
   683
sl@0
   684
/**
sl@0
   685
Sends a synchronous custom command to the controller.
sl@0
   686
sl@0
   687
@param  aDestination
sl@0
   688
        The destination of the message, consisting of the UID of
sl@0
   689
        the interface of this message.
sl@0
   690
@param  aFunction
sl@0
   691
        The function number to indicate which function is to be called
sl@0
   692
        on the interface defined in the aDestination parameter.
sl@0
   693
@param  aDataTo1
sl@0
   694
        A reference to the first chunk of data to be copied to the controller
sl@0
   695
        framework. The exact contents of the data are dependent on the
sl@0
   696
        interface being called.  Can be KNullDesC8.
sl@0
   697
@param  aDataTo2
sl@0
   698
        A reference to the second chunk of data to be copied to the controller
sl@0
   699
        framework. The exact contents of the data are dependent on the
sl@0
   700
        interface being called.  Can be KNullDesC8.
sl@0
   701
@param  aDataFrom
sl@0
   702
        A reference to an area of memory to which the controller framework will
sl@0
   703
        write any data to be passed back to the client.  Can't be KNullDesC8.
sl@0
   704
sl@0
   705
@return The result of the request. The exact range of values is dependent on the interface.
sl@0
   706
sl@0
   707
@since  7.0s
sl@0
   708
*/
sl@0
   709
EXPORT_C TInt CVideoPlayerUtility::CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom)
sl@0
   710
	{
sl@0
   711
	return iBody->CustomCommandSync(aDestination, aFunction, aDataTo1, aDataTo2, aDataFrom);
sl@0
   712
	}
sl@0
   713
sl@0
   714
/**
sl@0
   715
Sends a synchronous custom command to the controller.
sl@0
   716
sl@0
   717
@param  aDestination
sl@0
   718
        The destination of the message, consisting of the uid of
sl@0
   719
        the interface of this message.
sl@0
   720
@param  aFunction
sl@0
   721
        The function number to indicate which function is to be called
sl@0
   722
        on the interface defined in the aDestination parameter.
sl@0
   723
@param  aDataTo1
sl@0
   724
        A reference to the first chunk of data to be copied to the controller
sl@0
   725
        framework. The exact contents of the data are dependent on the
sl@0
   726
        interface being called.  Can be KNullDesC8.
sl@0
   727
@param  aDataTo2
sl@0
   728
        A reference to the second chunk of data to be copied to the controller
sl@0
   729
        framework. The exact contents of the data are dependent on the
sl@0
   730
        interface being called.  Can be KNullDesC8.
sl@0
   731
sl@0
   732
@return The result of the request. The exact range of values is dependent on the interface.
sl@0
   733
sl@0
   734
@since  7.0s
sl@0
   735
*/
sl@0
   736
EXPORT_C TInt CVideoPlayerUtility::CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2)
sl@0
   737
	{
sl@0
   738
	return iBody->CustomCommandSync(aDestination, aFunction, aDataTo1, aDataTo2);
sl@0
   739
	}
sl@0
   740
sl@0
   741
/**
sl@0
   742
Sends an asynchronous custom command to the controller.
sl@0
   743
sl@0
   744
Note: 
sl@0
   745
This method will return immediately.  The RunL of the active object owning the
sl@0
   746
aStatus parameter will be called when the command is completed by the
sl@0
   747
controller framework.
sl@0
   748
sl@0
   749
@param  aDestination
sl@0
   750
        The destination of the message, consisting of the uid of
sl@0
   751
        the interface of this message.
sl@0
   752
@param  aFunction
sl@0
   753
        The function number to indicate which function is to be called
sl@0
   754
        on the interface defined in the aDestination parameter.
sl@0
   755
@param  aDataTo1
sl@0
   756
        A reference to the first chunk of data to be copied to the controller
sl@0
   757
        framework. The exact contents of the data are dependent on the
sl@0
   758
        interface being called.  Can be KNullDesC8.
sl@0
   759
@param  aDataTo2
sl@0
   760
        A reference to the second chunk of data to be copied to the controller
sl@0
   761
        framework. The exact contents of the data are dependent on the
sl@0
   762
        interface being called.  Can be KNullDesC8.
sl@0
   763
@param  aDataFrom
sl@0
   764
        A reference to an area of memory to which the controller framework will
sl@0
   765
        write any data to be passed back to the client.  Can't be KNullDesC8.
sl@0
   766
@param  aStatus
sl@0
   767
        The TRequestStatus of an active object.  This will contain the
sl@0
   768
        result of the request on completion.  The exact range of
sl@0
   769
        result values is dependent on the interface.
sl@0
   770
sl@0
   771
@since  7.0s
sl@0
   772
*/
sl@0
   773
EXPORT_C void CVideoPlayerUtility::CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus)
sl@0
   774
	{
sl@0
   775
	iBody->CustomCommandAsync(aDestination, aFunction, aDataTo1, aDataTo2, aDataFrom, aStatus);
sl@0
   776
	}
sl@0
   777
sl@0
   778
/**
sl@0
   779
Send a asynchronous custom command to the controller.
sl@0
   780
sl@0
   781
Note: 
sl@0
   782
This method will return immediately.  The RunL of the active object owning the
sl@0
   783
aStatus parameter will be called when the command is completed by the
sl@0
   784
controller framework.
sl@0
   785
sl@0
   786
@param  aDestination
sl@0
   787
        The destination of the message, consisting of the uid of
sl@0
   788
        the interface of this message.
sl@0
   789
@param  aFunction
sl@0
   790
        The function number to indicate which function is to be called
sl@0
   791
        on the interface defined in the aDestination parameter.
sl@0
   792
@param  aDataTo1
sl@0
   793
        A reference to the first chunk of data to be copied to the controller
sl@0
   794
        framework. The exact contents of the data are dependent on the
sl@0
   795
        interface being called.  Can be KNullDesC8.
sl@0
   796
@param  aDataTo2
sl@0
   797
        A reference to the second chunk of data to be copied to the controller
sl@0
   798
        framework. The exact contents of the data are dependent on the
sl@0
   799
        interface being called.  Can be KNullDesC8.
sl@0
   800
@param  aStatus
sl@0
   801
        The TRequestStatus of an active object.  This will contain the
sl@0
   802
        result of the request on completion.  The exact range of
sl@0
   803
        result values is dependent on the interface.
sl@0
   804
sl@0
   805
@since  7.0s
sl@0
   806
*/
sl@0
   807
EXPORT_C void CVideoPlayerUtility::CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus)
sl@0
   808
	{
sl@0
   809
	iBody->CustomCommandAsync(aDestination, aFunction, aDataTo1, aDataTo2, aStatus);
sl@0
   810
	}
sl@0
   811
	
sl@0
   812
/**
sl@0
   813
Register to receive notifications of video clip loading/rebuffering.
sl@0
   814
sl@0
   815
When a video clip is being streamed in, it may require rebuffering from time to time. This function 
sl@0
   816
"switches on" callbacks that report the status of the rebuffering.
sl@0
   817
sl@0
   818
The two callbacks that can be sent are MVideoLoadingObserver::MvloLoadingStarted() and 
sl@0
   819
MVideoLoadingObserver::MvloLoadingComplete().
sl@0
   820
sl@0
   821
@param  aCallback
sl@0
   822
        The object to receive video loading notifications.
sl@0
   823
sl@0
   824
@since 7.0s
sl@0
   825
*/
sl@0
   826
EXPORT_C void CVideoPlayerUtility::RegisterForVideoLoadingNotification(MVideoLoadingObserver& aCallback)
sl@0
   827
	{
sl@0
   828
	iBody->RegisterForVideoLoadingNotification(aCallback);
sl@0
   829
	}
sl@0
   830
sl@0
   831
/**
sl@0
   832
Sets the video frame rate.
sl@0
   833
sl@0
   834
@param  aFramesPerSecond
sl@0
   835
        The number of frames per second to request.
sl@0
   836
sl@0
   837
@since 7.0s
sl@0
   838
*/
sl@0
   839
EXPORT_C void CVideoPlayerUtility::SetVideoFrameRateL(TReal32 aFramesPerSecond)
sl@0
   840
	{
sl@0
   841
	iBody->SetVideoFrameRateL(aFramesPerSecond);
sl@0
   842
	}
sl@0
   843
sl@0
   844
/**
sl@0
   845
Requests the video controller to redraw the current frame.
sl@0
   846
sl@0
   847
@since 7.0s
sl@0
   848
*/
sl@0
   849
EXPORT_C void CVideoPlayerUtility::RefreshFrameL()
sl@0
   850
	{
sl@0
   851
	iBody->RefreshFrameL();
sl@0
   852
	}
sl@0
   853
sl@0
   854
/**
sl@0
   855
Rotates the video image on the screen.
sl@0
   856
sl@0
   857
@param  aRotation
sl@0
   858
        The desired rotation to apply in 90 degree increments.
sl@0
   859
sl@0
   860
@see    RotationL
sl@0
   861
@since  7.0s
sl@0
   862
*/
sl@0
   863
EXPORT_C void CVideoPlayerUtility::SetRotationL(TVideoRotation aRotation)
sl@0
   864
	{
sl@0
   865
	iBody->SetRotationL(aRotation);
sl@0
   866
	}
sl@0
   867
sl@0
   868
/**
sl@0
   869
Query the rotation that is currently applied to the video image.
sl@0
   870
sl@0
   871
@return The applied rotation
sl@0
   872
sl@0
   873
@since 7.0s
sl@0
   874
@see   SetRotationL
sl@0
   875
*/
sl@0
   876
EXPORT_C TVideoRotation CVideoPlayerUtility::RotationL() const
sl@0
   877
	{
sl@0
   878
	return iBody->RotationL();
sl@0
   879
	}
sl@0
   880
sl@0
   881
/**
sl@0
   882
Scales the video image to a specified percentage of its original size.
sl@0
   883
sl@0
   884
@param  aWidthPercentage
sl@0
   885
        The percentage (100 = original size) to be used to scale the width of the video image
sl@0
   886
@param  aHeightPercentage
sl@0
   887
        The percentage (100 = original size) to be used to scale the height of the video image. 
sl@0
   888
        If this is not equal to aWidthPercentage then the image may be distorted.
sl@0
   889
@param  aAntiAliasFiltering
sl@0
   890
        A boolean specifying if anti-aliasing should be used. True if anti-aliasing filtering 
sl@0
   891
        should be used.  If the plugin does not	support this kind of processing, 
sl@0
   892
        this value will be ignored.
sl@0
   893
sl@0
   894
@since  7.0s
sl@0
   895
@see    GetScaleFactorL
sl@0
   896
*/
sl@0
   897
EXPORT_C void CVideoPlayerUtility::SetScaleFactorL(TReal32 aWidthPercentage, TReal32 aHeightPercentage, TBool aAntiAliasFiltering)
sl@0
   898
	{
sl@0
   899
	iBody->SetScaleFactorL(aWidthPercentage, aHeightPercentage, aAntiAliasFiltering);
sl@0
   900
	}
sl@0
   901
sl@0
   902
/**
sl@0
   903
Gets the scale factor currently applied to the video image.
sl@0
   904
sl@0
   905
@param  aWidthPercentage
sl@0
   906
        On function return, contains the current scaling percentage applied to the width of the
sl@0
   907
        video image (100 = original size).
sl@0
   908
@param  aHeightPercentage
sl@0
   909
        On function return, contains the current scaling percentage applied to the height of the
sl@0
   910
        of the video image (100 = original size).
sl@0
   911
@param  aAntiAliasFiltering
sl@0
   912
        The boolean specifying if anit-aliasing is being used.
sl@0
   913
sl@0
   914
@since  7.0s
sl@0
   915
@see    SetScaleFactorL
sl@0
   916
*/
sl@0
   917
EXPORT_C void CVideoPlayerUtility::GetScaleFactorL(TReal32& aWidthPercentage, TReal32& aHeightPercentage, TBool& aAntiAliasFiltering) const
sl@0
   918
	{
sl@0
   919
	iBody->GetScaleFactorL(aWidthPercentage, aHeightPercentage, aAntiAliasFiltering);
sl@0
   920
	}
sl@0
   921
sl@0
   922
/**
sl@0
   923
Selects a region of the video image to be displayed.
sl@0
   924
sl@0
   925
@param  aCropRegion
sl@0
   926
        The dimensions of the crop region, relative to the video image.
sl@0
   927
sl@0
   928
@since 7.0s
sl@0
   929
@see   GetCropRegionL
sl@0
   930
*/
sl@0
   931
EXPORT_C void CVideoPlayerUtility::SetCropRegionL(const TRect& aCropRegion)
sl@0
   932
	{
sl@0
   933
	iBody->SetCropRegionL(aCropRegion);
sl@0
   934
	}
sl@0
   935
sl@0
   936
/**
sl@0
   937
Gets the crop region currently applied to the image.
sl@0
   938
sl@0
   939
@param  aCropRegion
sl@0
   940
        The dimensions of the crop region, relative to the video image. If no
sl@0
   941
        crop region has been applied, the full dimensions of the video image will
sl@0
   942
        be returned.
sl@0
   943
sl@0
   944
@since 7.0s
sl@0
   945
@see   SetCropRegionL
sl@0
   946
*/
sl@0
   947
EXPORT_C void CVideoPlayerUtility::GetCropRegionL(TRect& aCropRegion) const
sl@0
   948
	{
sl@0
   949
	iBody->GetCropRegionL(aCropRegion);
sl@0
   950
	}
sl@0
   951
sl@0
   952
/**
sl@0
   953
Prepares the video clip to be accessed.
sl@0
   954
sl@0
   955
A call to this method tells the loaded controller plugin to finalise its configuration
sl@0
   956
and to prepare to start reading the video clip.  It is not possible to play the video clip
sl@0
   957
or query any of its properties (e.g. duration, meta data etc.) until this method has signalled
sl@0
   958
its completion (successful or otherwise) via the callback MvpuoPrepareComplete.
sl@0
   959
sl@0
   960
@since  7.0s
sl@0
   961
*/
sl@0
   962
EXPORT_C void CVideoPlayerUtility::Prepare()
sl@0
   963
	{
sl@0
   964
	iBody->Prepare();
sl@0
   965
	}
sl@0
   966
sl@0
   967
/**
sl@0
   968
Returns the controller implementation information associated with the current controller.
sl@0
   969
sl@0
   970
@return The controller implementation structure associated with the controller.
sl@0
   971
sl@0
   972
@since 7.0s
sl@0
   973
*/
sl@0
   974
EXPORT_C const CMMFControllerImplementationInformation& CVideoPlayerUtility::ControllerImplementationInformationL()
sl@0
   975
	{
sl@0
   976
	return iBody->ControllerImplementationInformationL();
sl@0
   977
	}
sl@0
   978
sl@0
   979
/**
sl@0
   980
Gets a controller's DRM custom command implementation.
sl@0
   981
sl@0
   982
@return A pointer to a controller's DRM custom command implementation, or NULL
sl@0
   983
if the controller does not support it.
sl@0
   984
*/
sl@0
   985
EXPORT_C MMMFDRMCustomCommand* CVideoPlayerUtility::GetDRMCustomCommand()
sl@0
   986
	{
sl@0
   987
	return iBody->GetDRMCustomCommand();
sl@0
   988
	}
sl@0
   989
sl@0
   990
sl@0
   991
/**
sl@0
   992
Enables a client application to stop the video player from using direct screen access (DSA).
sl@0
   993
sl@0
   994
From Symbian release 9.5 onwards this method is not supported when called on an instance of CVideoPlayerUtility2, and will always 
sl@0
   995
leave with KErrNotSupported.
sl@0
   996
sl@0
   997
This function leaves if errors are encountered when trying to stop DSA.
sl@0
   998
*/
sl@0
   999
EXPORT_C void CVideoPlayerUtility::StopDirectScreenAccessL()
sl@0
  1000
	{
sl@0
  1001
	iBody->StopDirectScreenAccessL();
sl@0
  1002
	}
sl@0
  1003
sl@0
  1004
/**
sl@0
  1005
Enables a client application to start the video player using direct screen access (DSA).
sl@0
  1006
sl@0
  1007
From Symbian release 9.5 onwards this method is not supported when called on an instance of CVideoPlayerUtility2, and will always 
sl@0
  1008
leave with KErrNotSupported.
sl@0
  1009
sl@0
  1010
This function leaves if errors are encountered when trying to start DSA.
sl@0
  1011
*/
sl@0
  1012
EXPORT_C void CVideoPlayerUtility::StartDirectScreenAccessL()
sl@0
  1013
	{
sl@0
  1014
	iBody->StartDirectScreenAccessL();
sl@0
  1015
	}
sl@0
  1016
sl@0
  1017
/**
sl@0
  1018
Registers for notification, when audio resource is available.
sl@0
  1019
sl@0
  1020
@param	aCallback
sl@0
  1021
      	Observer interface for audio resource notification event
sl@0
  1022
      	
sl@0
  1023
@param 	aNotificationEventId
sl@0
  1024
 		The Event for which the client registers.
sl@0
  1025
 	
sl@0
  1026
@param 	aNotificationRegistrationData
sl@0
  1027
		Data specific to notification registration.This has been reserved for future use and its value should be NULL.
sl@0
  1028
	
sl@0
  1029
@return An error code indicating if the registration is successful. KErrNone on success, 
sl@0
  1030
	otherwise another of the system-wide error codes.
sl@0
  1031
*/
sl@0
  1032
EXPORT_C TInt CVideoPlayerUtility::RegisterAudioResourceNotification(MMMFAudioResourceNotificationCallback& aCallback, TUid aNotificationEventId, const TDesC8& aNotificationRegistrationData)
sl@0
  1033
	{
sl@0
  1034
	return iBody->RegisterAudioResourceNotification(aCallback, aNotificationEventId, aNotificationRegistrationData);	
sl@0
  1035
	}
sl@0
  1036
sl@0
  1037
/**
sl@0
  1038
Cancels the registration for audio resource notification.
sl@0
  1039
sl@0
  1040
@param  aNotificationEventId
sl@0
  1041
	The Event to be cancellled.
sl@0
  1042
	
sl@0
  1043
@return An error code indicating if the cancellation is successful. KErrNone on success, 
sl@0
  1044
	otherwise another of the system-wide error codes.
sl@0
  1045
*/
sl@0
  1046
EXPORT_C TInt CVideoPlayerUtility::CancelRegisterAudioResourceNotification(TUid aNotificationEventId)
sl@0
  1047
	{
sl@0
  1048
	return iBody->CancelRegisterAudioResourceNotification(aNotificationEventId);
sl@0
  1049
	}
sl@0
  1050
sl@0
  1051
/**
sl@0
  1052
Waits for the client to resume the play even after the default timer expires.
sl@0
  1053
Unless the client completes the play no other client gets notification.
sl@0
  1054
sl@0
  1055
@return An error code indicating if the function call is successful. KErrNone on success, 
sl@0
  1056
		otherwise another of the system-wide error codes.
sl@0
  1057
*/
sl@0
  1058
EXPORT_C TInt CVideoPlayerUtility::WillResumePlay()
sl@0
  1059
	{
sl@0
  1060
	return iBody->WillResumePlay();	
sl@0
  1061
	}
sl@0
  1062
sl@0
  1063
/**
sl@0
  1064
Sets the initial screen to be used for the video display.
sl@0
  1065
sl@0
  1066
From Symbian release 9.5 onwards this method is not supported when called on an instance of CVideoPlayerUtility2, and will always 
sl@0
  1067
leave with KErrNotSupported.
sl@0
  1068
sl@0
  1069
@param  aScreenNumber
sl@0
  1070
        The screen number of the device.
sl@0
  1071
sl@0
  1072
@return KErrNotSupported if the secondary screen display is not supported in Multimedia Framework or 
sl@0
  1073
from Symbian release 9.5 onwards when called on an instance of CVideoPlayerUtility2. KErrNone on success.
sl@0
  1074
*/
sl@0
  1075
EXPORT_C TInt CVideoPlayerUtility::SetInitScreenNumber(TInt aScreenNumber)
sl@0
  1076
	{
sl@0
  1077
	return iBody->SetInitScreenNumber(aScreenNumber);
sl@0
  1078
	}
sl@0
  1079
	
sl@0
  1080
_LIT(KMMFMediaClientVideoPanicCategory, "MediaClientVideo");
sl@0
  1081
GLDEF_C void Panic(TMmfVideoPanic aError)
sl@0
  1082
	{
sl@0
  1083
	User::Panic(KMMFMediaClientVideoPanicCategory, aError);
sl@0
  1084
	}
sl@0
  1085
sl@0
  1086
/**
sl@0
  1087
Set video playback velocity relative to the normal video clip speed.
sl@0
  1088
This method can be used for fast forward, rewind, and slow-motion
sl@0
  1089
playback, depending on the capabilities of the underlying play-controller
sl@0
  1090
implementation and the characteristics of the video clip. Velocity set
sl@0
  1091
in this call will take effect immediately. Additionally,
sl@0
  1092
playback velocity cannot be changed for streamed video. Use
sl@0
  1093
GetPlayRateCapabilitiesL() to determine what playback modes are
sl@0
  1094
available.
sl@0
  1095
sl@0
  1096
Note that due to performance reasons, it may not be possible to perform
sl@0
  1097
fast forward or rewind at the requested speed. If that happens, the
sl@0
  1098
play-controller will use the nearest available velocity. This is not
sl@0
  1099
considered an error and the method will not leave. User can query
sl@0
  1100
velocity in effect by calling PlayVelocityL().
sl@0
  1101
sl@0
  1102
The default playback velocity is 100.
sl@0
  1103
Play velocity is persistent across stop play calls on utility. 
sl@0
  1104
That is SetPlayVelocityL(),call StopL(),then PlayL() will play with 
sl@0
  1105
the velocity set in most recent call. On opening different
sl@0
  1106
file the velocity will default to 100.
sl@0
  1107
sl@0
  1108
This function quits or exits leaving any of the system wide error codes.
sl@0
  1109
Common error codes are listed below.
sl@0
  1110
sl@0
  1111
@param aVelocity Playback velocity as a percentage relative to the
sl@0
  1112
                 normal video clip speed. Use 100 for normal-speed
sl@0
  1113
                 forward playback and negative value for reverse. Values above
sl@0
  1114
                 100 and below 0 correspond to fast forward and
sl@0
  1115
                 rewind respectively, while values 1 to 100 represent
sl@0
  1116
                 slow-motioned playback.
sl@0
  1117
sl@0
  1118
@pre Playback has been started, but may be paused.
sl@0
  1119
sl@0
  1120
@see CVideoPlayerUtility::GetPlayRateCapabilitiesL()
sl@0
  1121
sl@0
  1122
@leave KErrNotSupported The requested playback velocity is not
sl@0
  1123
         supported.
sl@0
  1124
@leave KErrNotReady Playback has not yet been started
sl@0
  1125
sl@0
  1126
@publishedPartner
sl@0
  1127
*/
sl@0
  1128
EXPORT_C void CVideoPlayerUtility::SetPlayVelocityL(TInt aVelocity)
sl@0
  1129
	{
sl@0
  1130
	iBody->SetPlayVelocityL(aVelocity);
sl@0
  1131
	}
sl@0
  1132
sl@0
  1133
/**
sl@0
  1134
Returns the current playback velocity. If setting play velocity is
sl@0
  1135
not supported or velocity is not set this will return default play velocity
sl@0
  1136
100 corresponding to normal playback.
sl@0
  1137
sl@0
  1138
If implementation is not supporting the velocity set with SetPlayVelocityL
sl@0
  1139
it will default to the nearest velocity. In this case this API will return
sl@0
  1140
the value it has defaulted to.
sl@0
  1141
sl@0
  1142
If an error occurs, this function leaves with any of the system
sl@0
  1143
wide error codes. Common error codes are listed below.
sl@0
  1144
sl@0
  1145
@return The current playback velocity as a percentage relative to the
sl@0
  1146
        normal video clip speed.
sl@0
  1147
sl@0
  1148
@pre Playback has been started, but may be paused.
sl@0
  1149
sl@0
  1150
@see CVideoPlayerUtility::SetPlayVelocityL()
sl@0
  1151
sl@0
  1152
@leave KErrNotReady Playback has not yet been started
sl@0
  1153
sl@0
  1154
@publishedPartner
sl@0
  1155
*/
sl@0
  1156
EXPORT_C TInt CVideoPlayerUtility::PlayVelocityL() const
sl@0
  1157
	{
sl@0
  1158
	return iBody->PlayVelocityL();
sl@0
  1159
	}
sl@0
  1160
sl@0
  1161
/**
sl@0
  1162
Steps the current video playback position forward or backward by a
sl@0
  1163
number of frames. Frame step is only available when playback is paused.
sl@0
  1164
sl@0
  1165
Support for frame stepping may depend on the underlying play-controller
sl@0
  1166
implementation and the video clip open. Additionally, frame step is
sl@0
  1167
typically not available in streamed playback. Use GetPlayRateCapabilitiesL()
sl@0
  1168
to query if frame step is currently possible. Application may check the
sl@0
  1169
value of the current positon after stepping through several frames by calling
sl@0
  1170
PositionL() API.
sl@0
  1171
sl@0
  1172
Implementations may not be able to step exactly the number of frames
sl@0
  1173
requested, especially when stepping backwards. If this happens, the
sl@0
  1174
play-controller will step to a frame close to the one requested. This is
sl@0
  1175
not considered an error.
sl@0
  1176
sl@0
  1177
This function quits or exits leaving any of the system wide error codes.
sl@0
  1178
Common error codes are listed below.
sl@0
  1179
sl@0
  1180
@param aStep The number of frames to step. Use positive values for
sl@0
  1181
             stepping forward and negative values for stepping
sl@0
  1182
             back.
sl@0
  1183
sl@0
  1184
@pre Playback has been started and is currently paused. 
sl@0
  1185
	 That means this API can be called only in paused state.
sl@0
  1186
sl@0
  1187
@see CVideoPlayerUtility::GetPlayRateCapabilitiesL()
sl@0
  1188
sl@0
  1189
@leave KErrNotSupported Frame step is not supported. Note that some
sl@0
  1190
         implementations may support step forward but not step backward.
sl@0
  1191
@leave KErrNotReady Playback has not yet been started or is not in paused state.
sl@0
  1192
sl@0
  1193
@publishedPartner
sl@0
  1194
*/
sl@0
  1195
EXPORT_C void CVideoPlayerUtility::StepFrameL(TInt aStep)
sl@0
  1196
	{
sl@0
  1197
	iBody->StepFrameL(aStep);
sl@0
  1198
	}
sl@0
  1199
sl@0
  1200
/**
sl@0
  1201
Queries the current playback rate capabilities. The capabilities
sl@0
  1202
describe whether fast forward, reverse playback, slow motion, or
sl@0
  1203
step backward or forward is possible. The capabilities may depend on
sl@0
  1204
the controller implementation and the video clip. Additionally,
sl@0
  1205
only normal-speed forward playback is typically possible in streamed playback.
sl@0
  1206
sl@0
  1207
This function quits or exits leaving any of the system wide error codes.
sl@0
  1208
Common error codes are listed below.
sl@0
  1209
sl@0
  1210
@param aCapabilities Playback rate capabilities
sl@0
  1211
sl@0
  1212
@pre The video clip has been opened
sl@0
  1213
sl@0
  1214
@leave KErrNotReady The video clip has not yet been opened
sl@0
  1215
sl@0
  1216
@publishedPartner
sl@0
  1217
*/
sl@0
  1218
EXPORT_C void CVideoPlayerUtility::GetPlayRateCapabilitiesL(TVideoPlayRateCapabilities& aCapabilities)const
sl@0
  1219
	{
sl@0
  1220
	iBody->GetPlayRateCapabilitiesL(aCapabilities);
sl@0
  1221
	}
sl@0
  1222
sl@0
  1223
/**
sl@0
  1224
Enables or disables video playback. This function is used to disable
sl@0
  1225
video playback in a video clip to play only the audio track. By default
sl@0
  1226
video playback is always enabled if the clip has a video track.
sl@0
  1227
sl@0
  1228
This method can be called after the video clip has been opened, but
sl@0
  1229
only before calling Prepare().
sl@0
  1230
sl@0
  1231
This function quits or exits leaving any of the system wide error codes.
sl@0
  1232
Common error codes are listed below.
sl@0
  1233
sl@0
  1234
@param aVideoEnabled ETrue to enable video playback, EFalse to disable
sl@0
  1235
sl@0
  1236
@pre The video clip has been opened by the client and Prepare() has not been called.
sl@0
  1237
sl@0
  1238
@leave KErrNotSupported This method is not supported -- video playback
sl@0
  1239
         is always enabled. 
sl@0
  1240
@leave KErrNotReady The clip has not been opened or the client has
sl@0
  1241
         already called Prepare().
sl@0
  1242
sl@0
  1243
@publishedPartner
sl@0
  1244
*/
sl@0
  1245
EXPORT_C void CVideoPlayerUtility::SetVideoEnabledL(TBool aVideoEnabled)
sl@0
  1246
	{
sl@0
  1247
	iBody->SetVideoEnabledL(aVideoEnabled);
sl@0
  1248
	}
sl@0
  1249
sl@0
  1250
/**
sl@0
  1251
Queries whether video playback is currently enabled or not.
sl@0
  1252
If an error occurs, this function leaves with any of the system
sl@0
  1253
wide error codes. Common error codes are listed below.
sl@0
  1254
sl@0
  1255
@return ETrue if video playback is enabled, EFalse if not.
sl@0
  1256
sl@0
  1257
@publishedPartner
sl@0
  1258
*/
sl@0
  1259
EXPORT_C TBool CVideoPlayerUtility::VideoEnabledL() const
sl@0
  1260
	{
sl@0
  1261
	return iBody->VideoEnabledL();
sl@0
  1262
	}
sl@0
  1263
sl@0
  1264
/**
sl@0
  1265
Enables or disables audio playback. This function is used to disable
sl@0
  1266
audio playback in a video clip to play only the video track. By default
sl@0
  1267
audio playback is always enabled if the clip has an audio track.
sl@0
  1268
sl@0
  1269
This method can be called after the video clip has been opened, but
sl@0
  1270
only before calling Prepare().
sl@0
  1271
sl@0
  1272
This function quits or exits leaving any of the system wide error codes.
sl@0
  1273
Common error codes are listed below.
sl@0
  1274
sl@0
  1275
@param aAudioEnabled ETrue to enable audio playback, EFalse to disable
sl@0
  1276
sl@0
  1277
@pre The video clip has been opened by the client and Prepare() has not been called.
sl@0
  1278
sl@0
  1279
@leave KErrNotSupported This method is not supported -- audio playback
sl@0
  1280
         is always enabled
sl@0
  1281
@leave KErrNotReady The clip has not been opened or the client has
sl@0
  1282
         already called Prepare().
sl@0
  1283
sl@0
  1284
@publishedPartner
sl@0
  1285
*/
sl@0
  1286
EXPORT_C void CVideoPlayerUtility::SetAudioEnabledL(TBool aAudioEnabled)
sl@0
  1287
	{
sl@0
  1288
	iBody->SetAudioEnabledL(aAudioEnabled);
sl@0
  1289
	}
sl@0
  1290
sl@0
  1291
/** 
sl@0
  1292
Set video automatic scaling. When automatic scaling is active, the
sl@0
  1293
video picture is scaled automatically to match the video window,
sl@0
  1294
based on the scaling type. This variant of SetAutoScaleL() will
sl@0
  1295
always center the picture in the window.
sl@0
  1296
sl@0
  1297
Calling SetAutoScaleL() will override any scaling factors set with
sl@0
  1298
SetScaleFactorL(). Calling SetScaleFactorL() will disable automatic
sl@0
  1299
scaling.
sl@0
  1300
sl@0
  1301
Not all video controllers support automatic scaling. 
sl@0
  1302
sl@0
  1303
This function quits or exits leaving any of the system wide error codes.
sl@0
  1304
Common error codes are listed below.
sl@0
  1305
sl@0
  1306
@see TAutoScaleType, THorizontalAlign, TVerticalAlign
sl@0
  1307
sl@0
  1308
@param aScaleType Automatic scaling type
sl@0
  1309
sl@0
  1310
@pre The video clip has been opened by the client
sl@0
  1311
sl@0
  1312
@leave KErrNotSupported Automatic scaling is not supported
sl@0
  1313
*/
sl@0
  1314
EXPORT_C void CVideoPlayerUtility::SetAutoScaleL(TAutoScaleType aScaleType)
sl@0
  1315
	{
sl@0
  1316
	iBody->SetAutoScaleL(aScaleType);
sl@0
  1317
	}
sl@0
  1318
sl@0
  1319
/** 
sl@0
  1320
Set video automatic scaling. When automatic scaling is active, the
sl@0
  1321
video picture is scaled automatically to match the video window,
sl@0
  1322
based on the scaling type, and positioned according to the
sl@0
  1323
parameters.
sl@0
  1324
sl@0
  1325
Calling SetAutoScaleL() will override any scaling factors set with
sl@0
  1326
SetScaleFactorL(). Calling SetScaleFactorL() will disable automatic
sl@0
  1327
scaling.
sl@0
  1328
sl@0
  1329
Not all video controller support automatic scaling. 
sl@0
  1330
sl@0
  1331
This function quits or exits leaving any of the system wide error codes.
sl@0
  1332
Common error codes are listed below.
sl@0
  1333
sl@0
  1334
@see TAutoScaleType, THorizontalAlign, TVerticalAlign
sl@0
  1335
sl@0
  1336
@param aScaleType Automatic scaling type
sl@0
  1337
@param aHorizPos Video picture horizontal position, relative to the
sl@0
  1338
                 video window. The value can be either a pixel offset
sl@0
  1339
                 (positive or negative) from the top left corner of the
sl@0
  1340
                 window to the top left corner of the picture, or an
sl@0
  1341
                 alignment constant from enum THorizontalAlign.
sl@0
  1342
@param aVertPos Video picture vertical position, relative to the
sl@0
  1343
                 video window. The value can be either a pixel offset
sl@0
  1344
                 (positive or negative) from the top left corner of the
sl@0
  1345
                 window to the top left corner of the picture, or an
sl@0
  1346
                 alignment constant from enum TVerticalAlign.
sl@0
  1347
sl@0
  1348
@pre The video clip has been opened by the client.
sl@0
  1349
sl@0
  1350
@leave KErrNotSupported Automatic scaling is not supported
sl@0
  1351
*/
sl@0
  1352
EXPORT_C void CVideoPlayerUtility::SetAutoScaleL(TAutoScaleType aScaleType, TInt aHorizPos, TInt aVertPos)
sl@0
  1353
	{
sl@0
  1354
	iBody->SetAutoScaleL(aScaleType, aHorizPos, aVertPos );
sl@0
  1355
	}
sl@0
  1356
sl@0
  1357
/**
sl@0
  1358
When enabled sets automatic switching of surface to/from external display when it is connected/disconnected from the device.
sl@0
  1359
sl@0
  1360
Automatic switching is enabled by default, but only if the client thread that created this utility has an Active Scheduler
sl@0
  1361
installed and the device supports external display switching.
sl@0
  1362
sl@0
  1363
To use this function the client thread must have an Active Scheduler installed otherwise it will leave with KErrNotReady.
sl@0
  1364
sl@0
  1365
@param  aControl
sl@0
  1366
        ETrue to enable. EFalse to disable.
sl@0
  1367
@param  aDisplay
sl@0
  1368
        Display id of display to enable external switching for.
sl@0
  1369
@leave  KErrNotSupported Device does not support external displays
sl@0
  1370
@leave  KErrNotReady CActiveScheduler is not installed
sl@0
  1371
*/
sl@0
  1372
EXPORT_C void CVideoPlayerUtility::SetExternalDisplaySwitchingL(TInt aDisplay, TBool aControl)
sl@0
  1373
    {
sl@0
  1374
    iBody->SetExternalDisplaySwitchingL(aDisplay, aControl);
sl@0
  1375
    }