os/mm/mmlibs/mmfw/inc/VideoPlayer.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
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
#ifndef __VIDEOPLAYER_H__
sl@0
    17
#define __VIDEOPLAYER_H__
sl@0
    18
sl@0
    19
#include <w32std.h>
sl@0
    20
#include <fbs.h>
sl@0
    21
#include <f32file.h>
sl@0
    22
#include <mmf/common/mmfbase.h>
sl@0
    23
#include <mmf/common/mmfcontroller.h>
sl@0
    24
#include <mmf/common/mmfaudio.h>
sl@0
    25
#include <mmf/common/mmfstandardcustomcommands.h>
sl@0
    26
#include <mmf/common/mmfdrmcustomcommands.h>
sl@0
    27
#include <mda/common/base.h>
sl@0
    28
#include <mmf/common/mmfutilities.h>
sl@0
    29
#include <mmf/common/mmfcontrollerframeworkbase.h>
sl@0
    30
#include "mmf/common/mmcaf.h"
sl@0
    31
#include <mmfclntutility.h>
sl@0
    32
sl@0
    33
/**
sl@0
    34
@publishedAll
sl@0
    35
@released
sl@0
    36
sl@0
    37
An interface to a set of video player callback functions.
sl@0
    38
sl@0
    39
The class is a mixin and is intended to be inherited by the client
sl@0
    40
class which is observing the video playing operation. The functions
sl@0
    41
encapsulated by this class are called when specific events occur in
sl@0
    42
the process of initialising and playing an video clip. A reference to
sl@0
    43
this object is passed as a parameter when constructing an audio player
sl@0
    44
utility object.
sl@0
    45
sl@0
    46
@since 7.0s
sl@0
    47
*/
sl@0
    48
class MVideoPlayerUtilityObserver
sl@0
    49
	{
sl@0
    50
public:
sl@0
    51
sl@0
    52
	/**
sl@0
    53
	Notification to the client that the opening of the video clip has completed,
sl@0
    54
	successfully, or otherwise.
sl@0
    55
sl@0
    56
	The status of the video sample after opening is given by aError. The following
sl@0
    57
	values imply same across all the devices.
sl@0
    58
sl@0
    59
	- KErrNone: the sample is ready to play;
sl@0
    60
	- KErrNotSupported: the controller plugin is not recognised or not supported;
sl@0
    61
	- KErrNotFound: the video sample cannot be found;
sl@0
    62
	- KErrNoMemory: there is insufficient memory to play this video sample.
sl@0
    63
sl@0
    64
	Other values are possible indicating a problem opening the video sample. These values
sl@0
    65
	are device dependent.
sl@0
    66
sl@0
    67
	The client must now call Prepare() on the video player utility before the
sl@0
    68
	video clip can be played or any of its properties (e.g. duration) can be
sl@0
    69
	queried.
sl@0
    70
sl@0
    71
	@param  aError
sl@0
    72
	        The status of the video player after initialisation.
sl@0
    73
sl@0
    74
	@since  7.0s
sl@0
    75
	*/
sl@0
    76
	virtual void MvpuoOpenComplete(TInt aError) = 0;
sl@0
    77
sl@0
    78
	/**
sl@0
    79
	Notification to the client that the opening of the video clip has been prepared
sl@0
    80
	successfully, or otherwise.  This callback is called in response to a call to
sl@0
    81
	CVideoPlayerUtility::Prepare().
sl@0
    82
sl@0
    83
	The video clip may now be played, or have any of its properties (e.g. duration) queried.
sl@0
    84
sl@0
    85
	@param  aError
sl@0
    86
	        The status of the video player after initialisation.
sl@0
    87
	        This is either KErrNone if the open has completed successfully,
sl@0
    88
	        or one of the system wide error codes.
sl@0
    89
	
sl@0
    90
	@since  7.0s
sl@0
    91
	*/
sl@0
    92
	virtual void MvpuoPrepareComplete(TInt aError) = 0;
sl@0
    93
sl@0
    94
	/**
sl@0
    95
	Notification that the frame requested by a call to GetFrameL is ready
sl@0
    96
sl@0
    97
	@param  aFrame
sl@0
    98
	        The returned frame. The bitmap will contain
sl@0
    99
	        the requested frame if the the error code is KErrNone (success).
sl@0
   100
	@param  aError
sl@0
   101
	        The status of the frame request.
sl@0
   102
	        This is either KErrNone if the frame request was successful,
sl@0
   103
	        or one of the system wide error codes.
sl@0
   104
sl@0
   105
	@since	7.0s
sl@0
   106
	*/
sl@0
   107
	virtual void MvpuoFrameReady(CFbsBitmap& aFrame,TInt aError) = 0;
sl@0
   108
sl@0
   109
	/**
sl@0
   110
	Notification that video playback has completed. This is not called if
sl@0
   111
	playback is explicitly stopped (such as through the use of the Stop or
sl@0
   112
	Close commands).
sl@0
   113
sl@0
   114
	@param  aError
sl@0
   115
	        The status of playback.
sl@0
   116
	        This is either KErrNone if the playback was completed successfully,
sl@0
   117
	        or one of the system wide error codes.
sl@0
   118
	@since  7.0s
sl@0
   119
	*/
sl@0
   120
	virtual void MvpuoPlayComplete(TInt aError) = 0;
sl@0
   121
	
sl@0
   122
	/**
sl@0
   123
	General event notification from controller. These events are specified by
sl@0
   124
	the supplier of the controller
sl@0
   125
sl@0
   126
	@param  aEvent
sl@0
   127
	        The event sent by the controller.
sl@0
   128
sl@0
   129
	@since  7.0s
sl@0
   130
	*/
sl@0
   131
	virtual void MvpuoEvent(const TMMFEvent& aEvent) = 0;
sl@0
   132
	};
sl@0
   133
	
sl@0
   134
/**
sl@0
   135
@publishedAll
sl@0
   136
@released
sl@0
   137
sl@0
   138
This is a mixin class that allows a client to receive notification of rebuffering
sl@0
   139
operations occurring in the video player
sl@0
   140
sl@0
   141
@since 7.0s
sl@0
   142
*/
sl@0
   143
class MVideoLoadingObserver
sl@0
   144
	{
sl@0
   145
public:
sl@0
   146
sl@0
   147
	/**
sl@0
   148
	Notification that video clip loading/rebuffering has started
sl@0
   149
sl@0
   150
	@since  7.0s
sl@0
   151
	*/
sl@0
   152
	virtual void MvloLoadingStarted() = 0;
sl@0
   153
sl@0
   154
	/**
sl@0
   155
	Notification that video clip loading/rebuffering has completed
sl@0
   156
sl@0
   157
	@since  7.0s
sl@0
   158
	*/
sl@0
   159
	virtual void MvloLoadingComplete() = 0;
sl@0
   160
	};
sl@0
   161
sl@0
   162
class CMMFVideoPlayerCallback;
sl@0
   163
class CVideoPlayerUtility2;
sl@0
   164
class TVideoPlayRateCapabilities;
sl@0
   165
sl@0
   166
/**
sl@0
   167
@publishedAll
sl@0
   168
@released
sl@0
   169
sl@0
   170
Plays sampled video data.
sl@0
   171
sl@0
   172
The class offers a simple interface to open, play and obtain information from sampled video data. 
sl@0
   173
The video data can be provided using files, descriptors or URLs.
sl@0
   174
sl@0
   175
Note: 
sl@0
   176
Some video formats also allow the storing of audio data. To accommodate this, this class contains 
sl@0
   177
audio functions that can manipulate such data.
sl@0
   178
sl@0
   179
While this class is abstract, NewL() constructs, initialises and returns pointers to instances of 
sl@0
   180
concrete classes derived from this abstract class. This concrete class is part of the MMF 
sl@0
   181
implementation and is private.
sl@0
   182
sl@0
   183
@since 7.0s
sl@0
   184
*/
sl@0
   185
class CVideoPlayerUtility : public CBase,
sl@0
   186
							public MMMFClientUtility
sl@0
   187
	{
sl@0
   188
public:
sl@0
   189
sl@0
   190
	~CVideoPlayerUtility();
sl@0
   191
sl@0
   192
	IMPORT_C static CVideoPlayerUtility* NewL(MVideoPlayerUtilityObserver& aObserver,
sl@0
   193
											  TInt aPriority,
sl@0
   194
											  TInt aPref,
sl@0
   195
											  RWsSession& aWs,
sl@0
   196
											  CWsScreenDevice& aScreenDevice,
sl@0
   197
											  RWindowBase& aWindow,
sl@0
   198
											  const TRect& aScreenRect,
sl@0
   199
											  const TRect& aClipRect);
sl@0
   200
sl@0
   201
	IMPORT_C void OpenFileL(const TDesC& aFileName,TUid aControllerUid = KNullUid);
sl@0
   202
	IMPORT_C void OpenFileL(const RFile& aFileName, TUid aControllerUid = KNullUid);
sl@0
   203
sl@0
   204
	IMPORT_C void OpenFileL(const TMMSource& aSource, TUid aControllerUid = KNullUid);
sl@0
   205
sl@0
   206
	IMPORT_C void OpenDesL(const TDesC8& aDescriptor,TUid aControllerUid = KNullUid);
sl@0
   207
sl@0
   208
	IMPORT_C void OpenUrlL(const TDesC& aUrl, TInt aIapId = KUseDefaultIap, const TDesC8& aMimeType=KNullDesC8, TUid aControllerUid = KNullUid);
sl@0
   209
sl@0
   210
	IMPORT_C void Prepare();
sl@0
   211
sl@0
   212
	IMPORT_C void Close();
sl@0
   213
sl@0
   214
	IMPORT_C void Play();
sl@0
   215
sl@0
   216
	IMPORT_C void Play(const TTimeIntervalMicroSeconds& aStartPoint, const TTimeIntervalMicroSeconds& aEndPoint);
sl@0
   217
sl@0
   218
	IMPORT_C TInt Stop();
sl@0
   219
sl@0
   220
	IMPORT_C void PauseL();
sl@0
   221
sl@0
   222
	IMPORT_C void SetPriorityL(TInt aPriority, TInt aPref);
sl@0
   223
sl@0
   224
	IMPORT_C void PriorityL(TInt& aPriority, TMdaPriorityPreference& aPref) const;
sl@0
   225
sl@0
   226
	IMPORT_C void SetDisplayWindowL(RWsSession& aWs,CWsScreenDevice& aScreenDevice,RWindowBase& aWindow,const TRect& aWindowRect,const TRect& aClipRect);
sl@0
   227
sl@0
   228
	IMPORT_C void RegisterForVideoLoadingNotification(MVideoLoadingObserver& aCallback);
sl@0
   229
sl@0
   230
	IMPORT_C void GetVideoLoadingProgressL(TInt& aPercentageComplete);
sl@0
   231
sl@0
   232
	IMPORT_C void GetFrameL(TDisplayMode aDisplayMode);
sl@0
   233
sl@0
   234
	IMPORT_C void GetFrameL(TDisplayMode aDisplayMode, ContentAccess::TIntent aIntent);
sl@0
   235
sl@0
   236
	IMPORT_C void RefreshFrameL();
sl@0
   237
sl@0
   238
	IMPORT_C TReal32 VideoFrameRateL() const;
sl@0
   239
sl@0
   240
	IMPORT_C void SetVideoFrameRateL(TReal32 aFramesPerSecond);
sl@0
   241
sl@0
   242
	IMPORT_C void VideoFrameSizeL(TSize& aSize) const;
sl@0
   243
sl@0
   244
	IMPORT_C const TDesC8& VideoFormatMimeType() const;
sl@0
   245
sl@0
   246
	IMPORT_C TInt VideoBitRateL() const;
sl@0
   247
sl@0
   248
	IMPORT_C TInt AudioBitRateL() const;
sl@0
   249
sl@0
   250
	IMPORT_C TFourCC AudioTypeL() const;
sl@0
   251
sl@0
   252
	IMPORT_C TBool AudioEnabledL() const;
sl@0
   253
sl@0
   254
	IMPORT_C void SetPositionL(const TTimeIntervalMicroSeconds& aPosition);
sl@0
   255
sl@0
   256
	IMPORT_C TTimeIntervalMicroSeconds PositionL() const;
sl@0
   257
sl@0
   258
	IMPORT_C TTimeIntervalMicroSeconds DurationL() const;
sl@0
   259
sl@0
   260
	IMPORT_C void SetVolumeL(TInt aVolume);
sl@0
   261
sl@0
   262
	IMPORT_C TInt Volume() const;
sl@0
   263
sl@0
   264
	IMPORT_C TInt MaxVolume() const;
sl@0
   265
sl@0
   266
	IMPORT_C void SetBalanceL(TInt aBalance);
sl@0
   267
sl@0
   268
	IMPORT_C TInt Balance()const;
sl@0
   269
sl@0
   270
	IMPORT_C void SetRotationL(TVideoRotation aRotation);
sl@0
   271
sl@0
   272
	IMPORT_C TVideoRotation RotationL() const;
sl@0
   273
sl@0
   274
	IMPORT_C void SetScaleFactorL(TReal32 aWidthPercentage, TReal32 aHeightPercentage, TBool aAntiAliasFiltering);
sl@0
   275
sl@0
   276
	IMPORT_C void GetScaleFactorL(TReal32& aWidthPercentage, TReal32& aHeightPercentage, TBool& aAntiAliasFiltering) const;
sl@0
   277
sl@0
   278
	IMPORT_C void SetCropRegionL(const TRect& aCropRegion);
sl@0
   279
sl@0
   280
	IMPORT_C void GetCropRegionL(TRect& aCropRegion) const;
sl@0
   281
sl@0
   282
	IMPORT_C TInt NumberOfMetaDataEntriesL() const;
sl@0
   283
sl@0
   284
	IMPORT_C CMMFMetaDataEntry* MetaDataEntryL(TInt aIndex) const;
sl@0
   285
sl@0
   286
	IMPORT_C const CMMFControllerImplementationInformation& ControllerImplementationInformationL();
sl@0
   287
sl@0
   288
	IMPORT_C TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom);
sl@0
   289
sl@0
   290
	IMPORT_C TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2);
sl@0
   291
sl@0
   292
	IMPORT_C void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus);
sl@0
   293
sl@0
   294
	IMPORT_C void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus);
sl@0
   295
sl@0
   296
	IMPORT_C MMMFDRMCustomCommand* GetDRMCustomCommand();
sl@0
   297
sl@0
   298
	IMPORT_C void StopDirectScreenAccessL();
sl@0
   299
	
sl@0
   300
	IMPORT_C void StartDirectScreenAccessL();
sl@0
   301
sl@0
   302
	IMPORT_C TInt RegisterAudioResourceNotification(MMMFAudioResourceNotificationCallback& aCallback, TUid aNotificationEventUid, const TDesC8& aNotificationRegistrationData = KNullDesC8);
sl@0
   303
sl@0
   304
	IMPORT_C TInt CancelRegisterAudioResourceNotification(TUid aNotificationEventId);
sl@0
   305
    
sl@0
   306
	IMPORT_C TInt WillResumePlay();
sl@0
   307
	
sl@0
   308
	IMPORT_C TInt SetInitScreenNumber(TInt aScreenNumber);
sl@0
   309
sl@0
   310
	IMPORT_C void SetPlayVelocityL(TInt aVelocity);
sl@0
   311
sl@0
   312
	IMPORT_C TInt PlayVelocityL() const;
sl@0
   313
sl@0
   314
	IMPORT_C void StepFrameL(TInt aStep);
sl@0
   315
	
sl@0
   316
	IMPORT_C void GetPlayRateCapabilitiesL(TVideoPlayRateCapabilities& aCapabilities) const;
sl@0
   317
	
sl@0
   318
	IMPORT_C void SetVideoEnabledL(TBool aVideoEnabled);
sl@0
   319
sl@0
   320
	IMPORT_C TBool VideoEnabledL() const;
sl@0
   321
sl@0
   322
	IMPORT_C void SetAudioEnabledL(TBool aAudioEnabled);
sl@0
   323
sl@0
   324
	IMPORT_C void SetAutoScaleL(TAutoScaleType aScaleType);
sl@0
   325
sl@0
   326
	IMPORT_C void SetAutoScaleL(TAutoScaleType aScaleType, TInt aHorizPos, TInt aVertPos);
sl@0
   327
	
sl@0
   328
	IMPORT_C void SetExternalDisplaySwitchingL(TInt aDisplay, TBool aControl);
sl@0
   329
	
sl@0
   330
private:
sl@0
   331
	class CBody;
sl@0
   332
	
sl@0
   333
	CBody* iBody;
sl@0
   334
	
sl@0
   335
	friend class CBody;
sl@0
   336
	friend class CVideoPlayerUtility2;	
sl@0
   337
private:
sl@0
   338
	enum TMMFVideoPlayerState
sl@0
   339
		{
sl@0
   340
		EStopped,
sl@0
   341
		EOpening,
sl@0
   342
		EPaused,
sl@0
   343
		EPlaying		
sl@0
   344
		};
sl@0
   345
private:	
sl@0
   346
	friend class CTestStepUnitMMFVidClient;
sl@0
   347
#ifdef SYMBIAN_BUILD_GCE
sl@0
   348
	friend class CMediaClientVideoDisplayBody;
sl@0
   349
#endif // SYMBIAN_BUILD_GCE
sl@0
   350
public:
sl@0
   351
	class CTestView;
sl@0
   352
	friend class CTestView;
sl@0
   353
	};
sl@0
   354
sl@0
   355
sl@0
   356
#endif