os/mm/mmlibs/mmfw/inc/VideoPlayer.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmlibs/mmfw/inc/VideoPlayer.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,356 @@
     1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef __VIDEOPLAYER_H__
    1.20 +#define __VIDEOPLAYER_H__
    1.21 +
    1.22 +#include <w32std.h>
    1.23 +#include <fbs.h>
    1.24 +#include <f32file.h>
    1.25 +#include <mmf/common/mmfbase.h>
    1.26 +#include <mmf/common/mmfcontroller.h>
    1.27 +#include <mmf/common/mmfaudio.h>
    1.28 +#include <mmf/common/mmfstandardcustomcommands.h>
    1.29 +#include <mmf/common/mmfdrmcustomcommands.h>
    1.30 +#include <mda/common/base.h>
    1.31 +#include <mmf/common/mmfutilities.h>
    1.32 +#include <mmf/common/mmfcontrollerframeworkbase.h>
    1.33 +#include "mmf/common/mmcaf.h"
    1.34 +#include <mmfclntutility.h>
    1.35 +
    1.36 +/**
    1.37 +@publishedAll
    1.38 +@released
    1.39 +
    1.40 +An interface to a set of video player callback functions.
    1.41 +
    1.42 +The class is a mixin and is intended to be inherited by the client
    1.43 +class which is observing the video playing operation. The functions
    1.44 +encapsulated by this class are called when specific events occur in
    1.45 +the process of initialising and playing an video clip. A reference to
    1.46 +this object is passed as a parameter when constructing an audio player
    1.47 +utility object.
    1.48 +
    1.49 +@since 7.0s
    1.50 +*/
    1.51 +class MVideoPlayerUtilityObserver
    1.52 +	{
    1.53 +public:
    1.54 +
    1.55 +	/**
    1.56 +	Notification to the client that the opening of the video clip has completed,
    1.57 +	successfully, or otherwise.
    1.58 +
    1.59 +	The status of the video sample after opening is given by aError. The following
    1.60 +	values imply same across all the devices.
    1.61 +
    1.62 +	- KErrNone: the sample is ready to play;
    1.63 +	- KErrNotSupported: the controller plugin is not recognised or not supported;
    1.64 +	- KErrNotFound: the video sample cannot be found;
    1.65 +	- KErrNoMemory: there is insufficient memory to play this video sample.
    1.66 +
    1.67 +	Other values are possible indicating a problem opening the video sample. These values
    1.68 +	are device dependent.
    1.69 +
    1.70 +	The client must now call Prepare() on the video player utility before the
    1.71 +	video clip can be played or any of its properties (e.g. duration) can be
    1.72 +	queried.
    1.73 +
    1.74 +	@param  aError
    1.75 +	        The status of the video player after initialisation.
    1.76 +
    1.77 +	@since  7.0s
    1.78 +	*/
    1.79 +	virtual void MvpuoOpenComplete(TInt aError) = 0;
    1.80 +
    1.81 +	/**
    1.82 +	Notification to the client that the opening of the video clip has been prepared
    1.83 +	successfully, or otherwise.  This callback is called in response to a call to
    1.84 +	CVideoPlayerUtility::Prepare().
    1.85 +
    1.86 +	The video clip may now be played, or have any of its properties (e.g. duration) queried.
    1.87 +
    1.88 +	@param  aError
    1.89 +	        The status of the video player after initialisation.
    1.90 +	        This is either KErrNone if the open has completed successfully,
    1.91 +	        or one of the system wide error codes.
    1.92 +	
    1.93 +	@since  7.0s
    1.94 +	*/
    1.95 +	virtual void MvpuoPrepareComplete(TInt aError) = 0;
    1.96 +
    1.97 +	/**
    1.98 +	Notification that the frame requested by a call to GetFrameL is ready
    1.99 +
   1.100 +	@param  aFrame
   1.101 +	        The returned frame. The bitmap will contain
   1.102 +	        the requested frame if the the error code is KErrNone (success).
   1.103 +	@param  aError
   1.104 +	        The status of the frame request.
   1.105 +	        This is either KErrNone if the frame request was successful,
   1.106 +	        or one of the system wide error codes.
   1.107 +
   1.108 +	@since	7.0s
   1.109 +	*/
   1.110 +	virtual void MvpuoFrameReady(CFbsBitmap& aFrame,TInt aError) = 0;
   1.111 +
   1.112 +	/**
   1.113 +	Notification that video playback has completed. This is not called if
   1.114 +	playback is explicitly stopped (such as through the use of the Stop or
   1.115 +	Close commands).
   1.116 +
   1.117 +	@param  aError
   1.118 +	        The status of playback.
   1.119 +	        This is either KErrNone if the playback was completed successfully,
   1.120 +	        or one of the system wide error codes.
   1.121 +	@since  7.0s
   1.122 +	*/
   1.123 +	virtual void MvpuoPlayComplete(TInt aError) = 0;
   1.124 +	
   1.125 +	/**
   1.126 +	General event notification from controller. These events are specified by
   1.127 +	the supplier of the controller
   1.128 +
   1.129 +	@param  aEvent
   1.130 +	        The event sent by the controller.
   1.131 +
   1.132 +	@since  7.0s
   1.133 +	*/
   1.134 +	virtual void MvpuoEvent(const TMMFEvent& aEvent) = 0;
   1.135 +	};
   1.136 +	
   1.137 +/**
   1.138 +@publishedAll
   1.139 +@released
   1.140 +
   1.141 +This is a mixin class that allows a client to receive notification of rebuffering
   1.142 +operations occurring in the video player
   1.143 +
   1.144 +@since 7.0s
   1.145 +*/
   1.146 +class MVideoLoadingObserver
   1.147 +	{
   1.148 +public:
   1.149 +
   1.150 +	/**
   1.151 +	Notification that video clip loading/rebuffering has started
   1.152 +
   1.153 +	@since  7.0s
   1.154 +	*/
   1.155 +	virtual void MvloLoadingStarted() = 0;
   1.156 +
   1.157 +	/**
   1.158 +	Notification that video clip loading/rebuffering has completed
   1.159 +
   1.160 +	@since  7.0s
   1.161 +	*/
   1.162 +	virtual void MvloLoadingComplete() = 0;
   1.163 +	};
   1.164 +
   1.165 +class CMMFVideoPlayerCallback;
   1.166 +class CVideoPlayerUtility2;
   1.167 +class TVideoPlayRateCapabilities;
   1.168 +
   1.169 +/**
   1.170 +@publishedAll
   1.171 +@released
   1.172 +
   1.173 +Plays sampled video data.
   1.174 +
   1.175 +The class offers a simple interface to open, play and obtain information from sampled video data. 
   1.176 +The video data can be provided using files, descriptors or URLs.
   1.177 +
   1.178 +Note: 
   1.179 +Some video formats also allow the storing of audio data. To accommodate this, this class contains 
   1.180 +audio functions that can manipulate such data.
   1.181 +
   1.182 +While this class is abstract, NewL() constructs, initialises and returns pointers to instances of 
   1.183 +concrete classes derived from this abstract class. This concrete class is part of the MMF 
   1.184 +implementation and is private.
   1.185 +
   1.186 +@since 7.0s
   1.187 +*/
   1.188 +class CVideoPlayerUtility : public CBase,
   1.189 +							public MMMFClientUtility
   1.190 +	{
   1.191 +public:
   1.192 +
   1.193 +	~CVideoPlayerUtility();
   1.194 +
   1.195 +	IMPORT_C static CVideoPlayerUtility* NewL(MVideoPlayerUtilityObserver& aObserver,
   1.196 +											  TInt aPriority,
   1.197 +											  TInt aPref,
   1.198 +											  RWsSession& aWs,
   1.199 +											  CWsScreenDevice& aScreenDevice,
   1.200 +											  RWindowBase& aWindow,
   1.201 +											  const TRect& aScreenRect,
   1.202 +											  const TRect& aClipRect);
   1.203 +
   1.204 +	IMPORT_C void OpenFileL(const TDesC& aFileName,TUid aControllerUid = KNullUid);
   1.205 +	IMPORT_C void OpenFileL(const RFile& aFileName, TUid aControllerUid = KNullUid);
   1.206 +
   1.207 +	IMPORT_C void OpenFileL(const TMMSource& aSource, TUid aControllerUid = KNullUid);
   1.208 +
   1.209 +	IMPORT_C void OpenDesL(const TDesC8& aDescriptor,TUid aControllerUid = KNullUid);
   1.210 +
   1.211 +	IMPORT_C void OpenUrlL(const TDesC& aUrl, TInt aIapId = KUseDefaultIap, const TDesC8& aMimeType=KNullDesC8, TUid aControllerUid = KNullUid);
   1.212 +
   1.213 +	IMPORT_C void Prepare();
   1.214 +
   1.215 +	IMPORT_C void Close();
   1.216 +
   1.217 +	IMPORT_C void Play();
   1.218 +
   1.219 +	IMPORT_C void Play(const TTimeIntervalMicroSeconds& aStartPoint, const TTimeIntervalMicroSeconds& aEndPoint);
   1.220 +
   1.221 +	IMPORT_C TInt Stop();
   1.222 +
   1.223 +	IMPORT_C void PauseL();
   1.224 +
   1.225 +	IMPORT_C void SetPriorityL(TInt aPriority, TInt aPref);
   1.226 +
   1.227 +	IMPORT_C void PriorityL(TInt& aPriority, TMdaPriorityPreference& aPref) const;
   1.228 +
   1.229 +	IMPORT_C void SetDisplayWindowL(RWsSession& aWs,CWsScreenDevice& aScreenDevice,RWindowBase& aWindow,const TRect& aWindowRect,const TRect& aClipRect);
   1.230 +
   1.231 +	IMPORT_C void RegisterForVideoLoadingNotification(MVideoLoadingObserver& aCallback);
   1.232 +
   1.233 +	IMPORT_C void GetVideoLoadingProgressL(TInt& aPercentageComplete);
   1.234 +
   1.235 +	IMPORT_C void GetFrameL(TDisplayMode aDisplayMode);
   1.236 +
   1.237 +	IMPORT_C void GetFrameL(TDisplayMode aDisplayMode, ContentAccess::TIntent aIntent);
   1.238 +
   1.239 +	IMPORT_C void RefreshFrameL();
   1.240 +
   1.241 +	IMPORT_C TReal32 VideoFrameRateL() const;
   1.242 +
   1.243 +	IMPORT_C void SetVideoFrameRateL(TReal32 aFramesPerSecond);
   1.244 +
   1.245 +	IMPORT_C void VideoFrameSizeL(TSize& aSize) const;
   1.246 +
   1.247 +	IMPORT_C const TDesC8& VideoFormatMimeType() const;
   1.248 +
   1.249 +	IMPORT_C TInt VideoBitRateL() const;
   1.250 +
   1.251 +	IMPORT_C TInt AudioBitRateL() const;
   1.252 +
   1.253 +	IMPORT_C TFourCC AudioTypeL() const;
   1.254 +
   1.255 +	IMPORT_C TBool AudioEnabledL() const;
   1.256 +
   1.257 +	IMPORT_C void SetPositionL(const TTimeIntervalMicroSeconds& aPosition);
   1.258 +
   1.259 +	IMPORT_C TTimeIntervalMicroSeconds PositionL() const;
   1.260 +
   1.261 +	IMPORT_C TTimeIntervalMicroSeconds DurationL() const;
   1.262 +
   1.263 +	IMPORT_C void SetVolumeL(TInt aVolume);
   1.264 +
   1.265 +	IMPORT_C TInt Volume() const;
   1.266 +
   1.267 +	IMPORT_C TInt MaxVolume() const;
   1.268 +
   1.269 +	IMPORT_C void SetBalanceL(TInt aBalance);
   1.270 +
   1.271 +	IMPORT_C TInt Balance()const;
   1.272 +
   1.273 +	IMPORT_C void SetRotationL(TVideoRotation aRotation);
   1.274 +
   1.275 +	IMPORT_C TVideoRotation RotationL() const;
   1.276 +
   1.277 +	IMPORT_C void SetScaleFactorL(TReal32 aWidthPercentage, TReal32 aHeightPercentage, TBool aAntiAliasFiltering);
   1.278 +
   1.279 +	IMPORT_C void GetScaleFactorL(TReal32& aWidthPercentage, TReal32& aHeightPercentage, TBool& aAntiAliasFiltering) const;
   1.280 +
   1.281 +	IMPORT_C void SetCropRegionL(const TRect& aCropRegion);
   1.282 +
   1.283 +	IMPORT_C void GetCropRegionL(TRect& aCropRegion) const;
   1.284 +
   1.285 +	IMPORT_C TInt NumberOfMetaDataEntriesL() const;
   1.286 +
   1.287 +	IMPORT_C CMMFMetaDataEntry* MetaDataEntryL(TInt aIndex) const;
   1.288 +
   1.289 +	IMPORT_C const CMMFControllerImplementationInformation& ControllerImplementationInformationL();
   1.290 +
   1.291 +	IMPORT_C TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom);
   1.292 +
   1.293 +	IMPORT_C TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2);
   1.294 +
   1.295 +	IMPORT_C void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus);
   1.296 +
   1.297 +	IMPORT_C void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus);
   1.298 +
   1.299 +	IMPORT_C MMMFDRMCustomCommand* GetDRMCustomCommand();
   1.300 +
   1.301 +	IMPORT_C void StopDirectScreenAccessL();
   1.302 +	
   1.303 +	IMPORT_C void StartDirectScreenAccessL();
   1.304 +
   1.305 +	IMPORT_C TInt RegisterAudioResourceNotification(MMMFAudioResourceNotificationCallback& aCallback, TUid aNotificationEventUid, const TDesC8& aNotificationRegistrationData = KNullDesC8);
   1.306 +
   1.307 +	IMPORT_C TInt CancelRegisterAudioResourceNotification(TUid aNotificationEventId);
   1.308 +    
   1.309 +	IMPORT_C TInt WillResumePlay();
   1.310 +	
   1.311 +	IMPORT_C TInt SetInitScreenNumber(TInt aScreenNumber);
   1.312 +
   1.313 +	IMPORT_C void SetPlayVelocityL(TInt aVelocity);
   1.314 +
   1.315 +	IMPORT_C TInt PlayVelocityL() const;
   1.316 +
   1.317 +	IMPORT_C void StepFrameL(TInt aStep);
   1.318 +	
   1.319 +	IMPORT_C void GetPlayRateCapabilitiesL(TVideoPlayRateCapabilities& aCapabilities) const;
   1.320 +	
   1.321 +	IMPORT_C void SetVideoEnabledL(TBool aVideoEnabled);
   1.322 +
   1.323 +	IMPORT_C TBool VideoEnabledL() const;
   1.324 +
   1.325 +	IMPORT_C void SetAudioEnabledL(TBool aAudioEnabled);
   1.326 +
   1.327 +	IMPORT_C void SetAutoScaleL(TAutoScaleType aScaleType);
   1.328 +
   1.329 +	IMPORT_C void SetAutoScaleL(TAutoScaleType aScaleType, TInt aHorizPos, TInt aVertPos);
   1.330 +	
   1.331 +	IMPORT_C void SetExternalDisplaySwitchingL(TInt aDisplay, TBool aControl);
   1.332 +	
   1.333 +private:
   1.334 +	class CBody;
   1.335 +	
   1.336 +	CBody* iBody;
   1.337 +	
   1.338 +	friend class CBody;
   1.339 +	friend class CVideoPlayerUtility2;	
   1.340 +private:
   1.341 +	enum TMMFVideoPlayerState
   1.342 +		{
   1.343 +		EStopped,
   1.344 +		EOpening,
   1.345 +		EPaused,
   1.346 +		EPlaying		
   1.347 +		};
   1.348 +private:	
   1.349 +	friend class CTestStepUnitMMFVidClient;
   1.350 +#ifdef SYMBIAN_BUILD_GCE
   1.351 +	friend class CMediaClientVideoDisplayBody;
   1.352 +#endif // SYMBIAN_BUILD_GCE
   1.353 +public:
   1.354 +	class CTestView;
   1.355 +	friend class CTestView;
   1.356 +	};
   1.357 +
   1.358 +
   1.359 +#endif