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