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