sl@0: // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include "mmfvideocallback.h" sl@0: #include "VideoPlayerBody.h" sl@0: #include "mmfvideopaniccodes.h" sl@0: #include "mmfclientvideocommon.h" sl@0: sl@0: sl@0: void Panic(TInt aPanicCode) sl@0: { sl@0: _LIT(KMMFMediaClientVideoPanicCategory, "MMFVideoClient"); sl@0: User::Panic(KMMFMediaClientVideoPanicCategory, aPanicCode); sl@0: } sl@0: sl@0: /** sl@0: Constructs and initialises a new instance of the video player utility. sl@0: sl@0: This function leaves if the video player utility object cannot be created. sl@0: sl@0: @param aObserver sl@0: A client class to receive notifications from the video player. sl@0: @param aPriority sl@0: The Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and sl@0: EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request. sl@0: @param aPref sl@0: The Priority Preference - an additional audio policy parameter. The suggested default is sl@0: EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional sl@0: values may be supported by given phones and/or platforms, but should not be depended upon by sl@0: portable code. sl@0: @param aWs sl@0: The window server session id. sl@0: @param aScreenDevice sl@0: The software device screen. sl@0: @param aWindow sl@0: The display window. sl@0: @param aScreenRect sl@0: The dimensions of the display window. sl@0: @param aClipRect sl@0: The area of the video clip to display in the window. sl@0: sl@0: @return A pointer to the new video player utility object. sl@0: sl@0: @since 7.0s sl@0: sl@0: Note: The Priority Value and Priority Preference are used primarily when deciding what to do when sl@0: several audio clients attempt to play or record simultaneously. In addition to the Priority Value and Preference, sl@0: the adaptation may consider other parameters such as the SecureId and Capabilities of the client process. sl@0: Whatever, the decision as to what to do in such situations is up to the audio adaptation, and may sl@0: vary between different phones. Portable applications are advised not to assume any specific behaviour. sl@0: */ sl@0: EXPORT_C CVideoPlayerUtility* CVideoPlayerUtility::NewL(MVideoPlayerUtilityObserver& aObserver, sl@0: TInt aPriority, sl@0: TInt aPref, sl@0: RWsSession& aWs, sl@0: CWsScreenDevice& aScreenDevice, sl@0: RWindowBase& aWindow, sl@0: const TRect& aScreenRect, sl@0: const TRect& aClipRect) sl@0: { sl@0: CVideoPlayerUtility* s = new(ELeave) CVideoPlayerUtility(); sl@0: CleanupStack::PushL(s); sl@0: s->iBody = CBody::NewL(s, aObserver, aPriority, aPref, aWs, aScreenDevice, sl@0: aWindow, aScreenRect, aClipRect); sl@0: CleanupStack::Pop(); sl@0: return s; sl@0: } sl@0: sl@0: /** sl@0: Destructor. Closes any open video clips and frees any resources held by the Video Player. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: CVideoPlayerUtility::~CVideoPlayerUtility() sl@0: { sl@0: delete iBody; sl@0: } sl@0: sl@0: /** sl@0: Opens a video clip from a file. sl@0: sl@0: This function opens a video clip from a file using an optionally specified plugin. If no controller sl@0: plugin is specified, this function searches through a list of all available plugins and attempts to sl@0: use each one until successful or the end of the list is reached. sl@0: sl@0: Once the opening of the video clip is complete, successfully or otherwise, the callback function sl@0: MVideoPlayerUtilityObserver::MvpuoOpenComplete() is called. sl@0: sl@0: This function leaves if errors are encountered opening the specified video clip file, or in initialising a sl@0: specified/unspecified controller plugin. sl@0: sl@0: This function can leave with one of the specified error codes. Most open failures sl@0: will however be reported through the MVideoPlayerUtilityObserver interface. sl@0: sl@0: From Symbian release v9.5 onwards, this function will enable graphics surface use if the controller supports it. sl@0: If this function is called through an instance of the derived class CVideoPlayerUtility2 and the controller doesn't support graphics surfaces, sl@0: it fails with KErrNotSupported. sl@0: sl@0: @param aFileName sl@0: The full path name of the file containing the video data. sl@0: @param aControllerUid sl@0: If specified, it will force the video player to use the sl@0: controller with the given UID. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::OpenFileL(const TDesC& aFileName, TUid aControllerUid) sl@0: { sl@0: iBody->OpenFileL(aFileName, aControllerUid); sl@0: } sl@0: sl@0: /** sl@0: Opens a video clip from a file. sl@0: sl@0: This function opens a video clip from a file using an optionally specified plugin. If no controller sl@0: plugin is specified, this function searches through a list of all available plugins and attempts to sl@0: use each one until successful or the end of the list is reached. sl@0: sl@0: Once the opening of the video clip is complete, successfully or otherwise, the callback function sl@0: MVideoPlayerUtilityObserver::MvpuoOpenComplete() is called. sl@0: sl@0: This function leaves if errors are encountered opening the specified video clip file, or in initialising a sl@0: specified/unspecified controller plugin. sl@0: sl@0: This function can leave with one of the specified error codes. Most open failures sl@0: will however be reported through the MVideoPlayerUtilityObserver interface. sl@0: sl@0: From Symbian release v9.5 onwards, this function will enable graphics surface use if the controller supports it. sl@0: If this function is called through an instance of the derived class CVideoPlayerUtility2 and the controller doesn't support graphics surfaces, sl@0: it fails with KErrNotSupported. sl@0: sl@0: @param aFile sl@0: An open handle to a file containing the video clip sl@0: @param aControllerUid sl@0: If specified, it will force the video player to use the sl@0: controller with the given UID. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::OpenFileL(const RFile& aFile, TUid aControllerUid) sl@0: { sl@0: iBody->OpenFileL(aFile, aControllerUid); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Opens a video clip from a file. sl@0: sl@0: This function opens a video clip from a file using an optionally specified plugin. If no controller sl@0: plugin is specified, this function searches through a list of all available plugins and attempts to sl@0: use each one until successful or the end of the list is reached. sl@0: sl@0: Once the opening of the video clip is complete, successfully or otherwise, the callback function sl@0: MVideoPlayerUtilityObserver::MvpuoOpenComplete() is called. sl@0: sl@0: This function leaves if errors are encountered opening the specified video clip file, or in initialising a sl@0: specified/unspecified controller plugin. sl@0: sl@0: This function can leave with one of the specified error codes. Most open failures sl@0: will however be reported through the MVideoPlayerUtilityObserver interface. sl@0: sl@0: From Symbian release v9.5 onwards, this function will enable graphics surface use if the controller supports it. sl@0: If this function is called through an instance of the derived class CVideoPlayerUtility2 and the controller doesn't support graphics surfaces, sl@0: it fails with KErrNotSupported. sl@0: sl@0: @param aSource sl@0: A filename or an open handle to a file containing the video clip sl@0: @param aControllerUid sl@0: If specified, it will force the video player to use the sl@0: controller with the given UID. sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::OpenFileL(const TMMSource& aSource, TUid aControllerUid) sl@0: { sl@0: iBody->OpenFileL(aSource, aControllerUid); sl@0: } sl@0: sl@0: /** sl@0: Opens a video clip contained in a descriptor. sl@0: sl@0: This function opens a video clip contained as binary data in a descriptor using an optionally specified sl@0: plugin. If no controller plugin is specified, this function searches through a list of all available sl@0: plugins and attempts to use each one until successful or the end of the list is reached. sl@0: sl@0: Once the opening of the video clip is complete, successfully or otherwise, the callback function sl@0: MVideoPlayerUtilityObserver::MvpuoOpenComplete() is called. sl@0: sl@0: This function can leave with one of the specified error codes. Most open failures will however be sl@0: reported through the interface. sl@0: sl@0: From Symbian release v9.5 onwards, this function will enable graphics surface use if the controller supports it. sl@0: If this function is called through an instance of the derived class CVideoPlayerUtility2 and the controller doesn't support graphics surfaces, sl@0: it fails with KErrNotSupported. sl@0: sl@0: @param aDescriptor sl@0: The descriptor containing the video clip sl@0: @param aControllerUid sl@0: If specified, it will force the video player to use the sl@0: controller with the given UID. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::OpenDesL(const TDesC8& aDescriptor, TUid aControllerUid) sl@0: { sl@0: iBody->OpenDesL(aDescriptor, aControllerUid); sl@0: } sl@0: sl@0: /** sl@0: Opens a video clip from a URL. sl@0: sl@0: This function opens a video clip stored at a specified URL and identified by a MIME type. In addition sl@0: a plugin can be specified if necessary. If no controller plugin is specified, this function searches sl@0: through a list of all available plugins and attempts to use each one until successful or the end sl@0: of the list is reached. sl@0: sl@0: Once the opening of the video clip is complete, successfully or otherwise, the callback function sl@0: MVideoPlayerUtilityObserver::MvpuoOpenComplete() is called. sl@0: sl@0: This function can leave with one of the specified error codes. Most open failures sl@0: will however be reported through the MVideoPlayerUtilityObserver interface. sl@0: sl@0: From Symbian release v9.5 onwards, this function will enable graphics surface use if the controller supports it. sl@0: If this function is called through an instance of the derived class CVideoPlayerUtility2 and the controller doesn't support graphics surfaces, sl@0: it fails with KErrNotSupported. sl@0: sl@0: @param aUrl sl@0: The URL of the video clip to open. sl@0: @param aIapId sl@0: The Id of the internet access point to use sl@0: @param aMimeType sl@0: The MIME type associated with this video clip. This is sl@0: used to determine the format of the video clip. sl@0: @param aControllerUid sl@0: If specified, it will force the video player to use the controller with the given Uid. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::OpenUrlL(const TDesC& aUrl, TInt aIapId, const TDesC8& aMimeType, TUid aControllerUid) sl@0: { sl@0: iBody->OpenUrlL(aUrl, aIapId, aMimeType, aControllerUid); sl@0: } sl@0: sl@0: /** sl@0: Closes the video clip. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::Close() sl@0: { sl@0: iBody->Close(); sl@0: } sl@0: sl@0: /** sl@0: Begins playback of the initialised video sample at the current volume and priority levels. sl@0: sl@0: When playing of the video sample is complete, successfully or otherwise, the callback function sl@0: MVideoPlayerUtilityObserver::MvpuoPlayComplete() is called. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::Play() sl@0: { sl@0: iBody->Play(); sl@0: } sl@0: sl@0: /** sl@0: Begins playback of the initialised video sample at the specified start and end points. sl@0: sl@0: When playing of the video sample is complete, successfully or otherwise, the callback function sl@0: MVideoPlayerUtilityObserver::MvpuoPlayComplete() is called. sl@0: sl@0: @param aStartTime sl@0: The point at which to start playback. sl@0: @param aEndTime sl@0: The point at which to terminate playback. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::Play(const TTimeIntervalMicroSeconds& aStartTime, const TTimeIntervalMicroSeconds& aEndTime) sl@0: { sl@0: iBody->Play(aStartTime, aEndTime); sl@0: } sl@0: sl@0: /** sl@0: Stops playback of the video sample as soon as is possible. sl@0: sl@0: If the video sample is playing, playback is stopped as soon as possible. sl@0: sl@0: If playback is already complete, this function has no effect. sl@0: sl@0: The position is reset to the beginning of the file. sl@0: sl@0: @return An error code indicating if the function call was successful. KErrNone on success, otherwise sl@0: another of the system-wide error codes. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C TInt CVideoPlayerUtility::Stop() sl@0: { sl@0: return iBody->Stop(); sl@0: } sl@0: sl@0: /** sl@0: Video playback is paused. The current position is maintained and playback can be sl@0: resumed by calling Play. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::PauseL() sl@0: { sl@0: iBody->PauseL(); sl@0: } sl@0: sl@0: /** sl@0: Sets the playback volume for the audio track of the video clip. sl@0: sl@0: The volume can be changed before or during playback and is effective immediately. The volume can sl@0: be set to any value between zero (mute) and the maximum permissible volume sl@0: (determined using MaxVolume()). sl@0: sl@0: To determine if the current video clip contains an audio track, use AudioEnabledL(). sl@0: sl@0: sl@0: @param aVolume sl@0: The volume, between 0 and MaxVolume(). sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::SetVolumeL(TInt aVolume) sl@0: { sl@0: iBody->SetVolumeL(aVolume); sl@0: } sl@0: sl@0: sl@0: // sl@0: // Sends custom command to the plugin controller. sl@0: // Passes handle and size of the drawable window. sl@0: // sl@0: /** sl@0: Sets the display window. This is used to provide the video controller with an area of sl@0: the display to render the current video frame. sl@0: sl@0: From Symbian release 9.5 onwards this method is not supported when called on an instance of CVideoPlayerUtility2, and will always sl@0: leave with KErrNotSupported. sl@0: sl@0: sl@0: @param aWs sl@0: The window server session ID. sl@0: @param aScreenDevice sl@0: The software device screen. sl@0: @param aWindow sl@0: The window to display. sl@0: @param aScreenRect sl@0: The dimensions of the display window. sl@0: @param aClipRect sl@0: The area of the video clip to display in the window. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::SetDisplayWindowL(RWsSession& aWs, CWsScreenDevice& aScreenDevice, sl@0: RWindowBase& aWindow, const TRect& aScreenRect, sl@0: const TRect& aClipRect) sl@0: { sl@0: iBody->SetDisplayWindowL(aWs, aScreenDevice, aWindow, aScreenRect, aClipRect); sl@0: } sl@0: sl@0: /** sl@0: Returns the video frame rate in frames/second. sl@0: sl@0: @return The video frame rate (frames/second). sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C TReal32 CVideoPlayerUtility::VideoFrameRateL() const sl@0: { sl@0: return iBody->VideoFrameRateL(); sl@0: } sl@0: sl@0: /** sl@0: Gets the video frame size. sl@0: sl@0: @param aSize sl@0: The video frame size sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::VideoFrameSizeL(TSize& aSize) const sl@0: { sl@0: iBody->VideoFrameSizeL(aSize); sl@0: } sl@0: sl@0: /** sl@0: Returns the current playback volume for the audio track of the video clip. sl@0: sl@0: @return A value between 0 (mute) and the maximum volume returned by MaxVolume(). sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C TInt CVideoPlayerUtility::Volume() const sl@0: { sl@0: return iBody->Volume(); sl@0: } sl@0: sl@0: /** sl@0: Sets the current playback balance for the audio track of the video clip. sl@0: sl@0: The balance can be any value between KMMFBalanceMaxLeft and KMMFBalanceMaxRight, sl@0: the default value being KMMFBalanceCenter. sl@0: sl@0: @param aBalance sl@0: The balance value to set. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::SetBalanceL(TInt aBalance) sl@0: { sl@0: iBody->SetBalanceL(aBalance); sl@0: } sl@0: sl@0: /** sl@0: Returns the current balance setting for the audio track of the video clip. sl@0: sl@0: @return A balance value between KMMFBalanceMaxLeft and KMMFBalanceMaxRight. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C TInt CVideoPlayerUtility::Balance() const sl@0: { sl@0: return iBody->Balance(); sl@0: } sl@0: sl@0: /** sl@0: Returns the video format's MIME type. sl@0: sl@0: @return The video clip's MIME type. sl@0: sl@0: @since 7.0s sl@0: @see NumberOfMetaDataEntriesL sl@0: */ sl@0: EXPORT_C const TDesC8& CVideoPlayerUtility::VideoFormatMimeType() const sl@0: { sl@0: return iBody->VideoFormatMimeType(); sl@0: } sl@0: sl@0: /** sl@0: Returns the number of meta data entries associated with this clip. sl@0: sl@0: @return The number of meta data entries. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C TInt CVideoPlayerUtility::NumberOfMetaDataEntriesL() const sl@0: { sl@0: return iBody->NumberOfMetaDataEntriesL(); sl@0: } sl@0: sl@0: /** sl@0: Returns a meta data entry from the clip. sl@0: sl@0: @param aMetaDataIndex sl@0: The index of the meta data entry to retrieve. sl@0: sl@0: @return The metadata entry requested. sl@0: sl@0: @since 7.0s sl@0: @see NumberOfMetaDataEntriesL sl@0: */ sl@0: EXPORT_C CMMFMetaDataEntry* CVideoPlayerUtility::MetaDataEntryL(TInt aMetaDataIndex) const sl@0: { sl@0: return iBody->MetaDataEntryL(aMetaDataIndex); sl@0: } sl@0: sl@0: /** sl@0: Sets the playback priority. sl@0: sl@0: This is used to arbitrate between multiple objects simultaneously trying to accesses sl@0: the sound hardware. sl@0: sl@0: @param aPriority sl@0: The Priority Value. sl@0: @param aPref sl@0: The Priority Preference. sl@0: sl@0: @see CVideoPlayerUtility::NewL() sl@0: sl@0: @since 7.0s sl@0: sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::SetPriorityL(TInt aPriority, TInt aPref) sl@0: { sl@0: iBody->SetPriorityL(aPriority, aPref); sl@0: } sl@0: sl@0: /** sl@0: Get the current playback priority. This is used to arbitrate between simultaneous accesses of sl@0: the sound hardware. sl@0: sl@0: @param aPriority sl@0: On return, contains the priority level, EMdaPriorityMin client can be interrupted by any sl@0: other client, EMdaPriorityNormal client can only be interrupted by a client with a higher sl@0: priority or EMdaPriorityMax client cannot be interrupted by other clients. sl@0: @param aPref sl@0: On return, contains the time and quality preferences, enumerated in TMdaPriorityPreference. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::PriorityL(TInt& aPriority, TMdaPriorityPreference& aPref) const sl@0: { sl@0: iBody->PriorityL(aPriority, aPref); sl@0: } sl@0: sl@0: /** sl@0: Sets the position within the video clip from where to start playback. sl@0: sl@0: @param aPosition sl@0: Position from start of clip in microseconds. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::SetPositionL(const TTimeIntervalMicroSeconds& aPosition) sl@0: { sl@0: iBody->SetPositionL(aPosition); sl@0: } sl@0: sl@0: /** sl@0: Returns the duration of video clip in mircoseconds. sl@0: sl@0: @return The duration of clip in microseconds. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C TTimeIntervalMicroSeconds CVideoPlayerUtility::DurationL() const sl@0: { sl@0: return iBody->DurationL(); sl@0: } sl@0: sl@0: /** sl@0: Returns the current playback position. sl@0: sl@0: @return The current position from the start of the clip in microseconds. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C TTimeIntervalMicroSeconds CVideoPlayerUtility::PositionL() const sl@0: { sl@0: return iBody->PositionL(); sl@0: } sl@0: sl@0: /** sl@0: Returns an integer representing the maximum volume that the audio track can support. sl@0: sl@0: This is the maximum value that can be passed to SetVolumeL(). This value is platform sl@0: independent, but is always greater than or equal to one. sl@0: sl@0: @return The naximum playback volume. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C TInt CVideoPlayerUtility::MaxVolume() const sl@0: { sl@0: return iBody->MaxVolume(); sl@0: } sl@0: sl@0: /** sl@0: Gets the current frame. The current frame is requested, and will be sent to sl@0: the client asynchrynously via the MvpuoFrameReady callback. sl@0: sl@0: @param aDisplayMode sl@0: The display mode for the retrieved frame. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::GetFrameL(TDisplayMode aDisplayMode) sl@0: { sl@0: iBody->GetFrameL(aDisplayMode); sl@0: } sl@0: sl@0: /** sl@0: Gets the current frame. The current frame is requested, and will be sent to sl@0: the client asynchrynously via the MvpuoFrameReady callback. sl@0: sl@0: @param aDisplayMode sl@0: The display mode for the retrieved frame. sl@0: @param aIntent sl@0: The DRM Intent to pass to the controller. sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::GetFrameL(TDisplayMode aDisplayMode, ContentAccess::TIntent aIntent) sl@0: { sl@0: iBody->GetFrameL(aDisplayMode, ETrue, aIntent); sl@0: } sl@0: sl@0: /** sl@0: Returns the video bit rate. sl@0: sl@0: @return The video bit rate in bits/second. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C TInt CVideoPlayerUtility::VideoBitRateL() const sl@0: { sl@0: return iBody->VideoBitRateL(); sl@0: } sl@0: sl@0: /** sl@0: Returns the audio bit rate in bits/second. sl@0: sl@0: @return The audio bit rate (bits/second). sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C TInt CVideoPlayerUtility::AudioBitRateL() const sl@0: { sl@0: return iBody->AudioBitRateL(); sl@0: } sl@0: sl@0: /** sl@0: Returns whether the current clip has an audio stream and audio playback sl@0: is enabled. This method will return EFalse if the clip does no have an sl@0: audio track or if audio playback has been disabled with sl@0: SetAudioEnabledL(). sl@0: sl@0: @return ETrue if an audio track is present and audio playback is sl@0: enabled, otherwise EFalse. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C TBool CVideoPlayerUtility::AudioEnabledL() const sl@0: { sl@0: return iBody->AudioEnabledL(); sl@0: } sl@0: sl@0: EXPORT_C void Reserved2() sl@0: { sl@0: // reserved function replacing removed VideoTypeL() method sl@0: // this function should never be called hence generate a sl@0: // panic with code ENoVideoTypeL sl@0: Panic( ENoVideoTypeL ); sl@0: } sl@0: sl@0: /** sl@0: Returns the codec used for the audio component of the video clip. sl@0: sl@0: @return The four character code representing the audio codec. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C TFourCC CVideoPlayerUtility::AudioTypeL() const sl@0: { sl@0: return iBody->AudioTypeL(); sl@0: } sl@0: sl@0: /** sl@0: Gets the progress of video clip loading/rebuffering. sl@0: sl@0: @param aPercentageProgress sl@0: The percentage of loading/rebuffering complete. The parameter sl@0: is zero if loading has not begun and 100 if loading has already completed. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::GetVideoLoadingProgressL(TInt& aPercentageProgress) sl@0: { sl@0: iBody->GetVideoLoadingProgressL(aPercentageProgress); sl@0: } sl@0: sl@0: /** sl@0: Sends a synchronous custom command to the controller. sl@0: sl@0: @param aDestination sl@0: The destination of the message, consisting of the UID of sl@0: the interface of this message. sl@0: @param aFunction sl@0: The function number to indicate which function is to be called sl@0: on the interface defined in the aDestination parameter. sl@0: @param aDataTo1 sl@0: A reference to the first chunk of data to be copied to the controller sl@0: framework. The exact contents of the data are dependent on the sl@0: interface being called. Can be KNullDesC8. sl@0: @param aDataTo2 sl@0: A reference to the second chunk of data to be copied to the controller sl@0: framework. The exact contents of the data are dependent on the sl@0: interface being called. Can be KNullDesC8. sl@0: @param aDataFrom sl@0: A reference to an area of memory to which the controller framework will sl@0: write any data to be passed back to the client. Can't be KNullDesC8. sl@0: sl@0: @return The result of the request. The exact range of values is dependent on the interface. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C TInt CVideoPlayerUtility::CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom) sl@0: { sl@0: return iBody->CustomCommandSync(aDestination, aFunction, aDataTo1, aDataTo2, aDataFrom); sl@0: } sl@0: sl@0: /** sl@0: Sends a synchronous custom command to the controller. sl@0: sl@0: @param aDestination sl@0: The destination of the message, consisting of the uid of sl@0: the interface of this message. sl@0: @param aFunction sl@0: The function number to indicate which function is to be called sl@0: on the interface defined in the aDestination parameter. sl@0: @param aDataTo1 sl@0: A reference to the first chunk of data to be copied to the controller sl@0: framework. The exact contents of the data are dependent on the sl@0: interface being called. Can be KNullDesC8. sl@0: @param aDataTo2 sl@0: A reference to the second chunk of data to be copied to the controller sl@0: framework. The exact contents of the data are dependent on the sl@0: interface being called. Can be KNullDesC8. sl@0: sl@0: @return The result of the request. The exact range of values is dependent on the interface. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C TInt CVideoPlayerUtility::CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2) sl@0: { sl@0: return iBody->CustomCommandSync(aDestination, aFunction, aDataTo1, aDataTo2); sl@0: } sl@0: sl@0: /** sl@0: Sends an asynchronous custom command to the controller. sl@0: sl@0: Note: sl@0: This method will return immediately. The RunL of the active object owning the sl@0: aStatus parameter will be called when the command is completed by the sl@0: controller framework. sl@0: sl@0: @param aDestination sl@0: The destination of the message, consisting of the uid of sl@0: the interface of this message. sl@0: @param aFunction sl@0: The function number to indicate which function is to be called sl@0: on the interface defined in the aDestination parameter. sl@0: @param aDataTo1 sl@0: A reference to the first chunk of data to be copied to the controller sl@0: framework. The exact contents of the data are dependent on the sl@0: interface being called. Can be KNullDesC8. sl@0: @param aDataTo2 sl@0: A reference to the second chunk of data to be copied to the controller sl@0: framework. The exact contents of the data are dependent on the sl@0: interface being called. Can be KNullDesC8. sl@0: @param aDataFrom sl@0: A reference to an area of memory to which the controller framework will sl@0: write any data to be passed back to the client. Can't be KNullDesC8. sl@0: @param aStatus sl@0: The TRequestStatus of an active object. This will contain the sl@0: result of the request on completion. The exact range of sl@0: result values is dependent on the interface. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus) sl@0: { sl@0: iBody->CustomCommandAsync(aDestination, aFunction, aDataTo1, aDataTo2, aDataFrom, aStatus); sl@0: } sl@0: sl@0: /** sl@0: Send a asynchronous custom command to the controller. sl@0: sl@0: Note: sl@0: This method will return immediately. The RunL of the active object owning the sl@0: aStatus parameter will be called when the command is completed by the sl@0: controller framework. sl@0: sl@0: @param aDestination sl@0: The destination of the message, consisting of the uid of sl@0: the interface of this message. sl@0: @param aFunction sl@0: The function number to indicate which function is to be called sl@0: on the interface defined in the aDestination parameter. sl@0: @param aDataTo1 sl@0: A reference to the first chunk of data to be copied to the controller sl@0: framework. The exact contents of the data are dependent on the sl@0: interface being called. Can be KNullDesC8. sl@0: @param aDataTo2 sl@0: A reference to the second chunk of data to be copied to the controller sl@0: framework. The exact contents of the data are dependent on the sl@0: interface being called. Can be KNullDesC8. sl@0: @param aStatus sl@0: The TRequestStatus of an active object. This will contain the sl@0: result of the request on completion. The exact range of sl@0: result values is dependent on the interface. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus) sl@0: { sl@0: iBody->CustomCommandAsync(aDestination, aFunction, aDataTo1, aDataTo2, aStatus); sl@0: } sl@0: sl@0: /** sl@0: Register to receive notifications of video clip loading/rebuffering. sl@0: sl@0: When a video clip is being streamed in, it may require rebuffering from time to time. This function sl@0: "switches on" callbacks that report the status of the rebuffering. sl@0: sl@0: The two callbacks that can be sent are MVideoLoadingObserver::MvloLoadingStarted() and sl@0: MVideoLoadingObserver::MvloLoadingComplete(). sl@0: sl@0: @param aCallback sl@0: The object to receive video loading notifications. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::RegisterForVideoLoadingNotification(MVideoLoadingObserver& aCallback) sl@0: { sl@0: iBody->RegisterForVideoLoadingNotification(aCallback); sl@0: } sl@0: sl@0: /** sl@0: Sets the video frame rate. sl@0: sl@0: @param aFramesPerSecond sl@0: The number of frames per second to request. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::SetVideoFrameRateL(TReal32 aFramesPerSecond) sl@0: { sl@0: iBody->SetVideoFrameRateL(aFramesPerSecond); sl@0: } sl@0: sl@0: /** sl@0: Requests the video controller to redraw the current frame. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::RefreshFrameL() sl@0: { sl@0: iBody->RefreshFrameL(); sl@0: } sl@0: sl@0: /** sl@0: Rotates the video image on the screen. sl@0: sl@0: @param aRotation sl@0: The desired rotation to apply in 90 degree increments. sl@0: sl@0: @see RotationL sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::SetRotationL(TVideoRotation aRotation) sl@0: { sl@0: iBody->SetRotationL(aRotation); sl@0: } sl@0: sl@0: /** sl@0: Query the rotation that is currently applied to the video image. sl@0: sl@0: @return The applied rotation sl@0: sl@0: @since 7.0s sl@0: @see SetRotationL sl@0: */ sl@0: EXPORT_C TVideoRotation CVideoPlayerUtility::RotationL() const sl@0: { sl@0: return iBody->RotationL(); sl@0: } sl@0: sl@0: /** sl@0: Scales the video image to a specified percentage of its original size. sl@0: sl@0: @param aWidthPercentage sl@0: The percentage (100 = original size) to be used to scale the width of the video image sl@0: @param aHeightPercentage sl@0: The percentage (100 = original size) to be used to scale the height of the video image. sl@0: If this is not equal to aWidthPercentage then the image may be distorted. sl@0: @param aAntiAliasFiltering sl@0: A boolean specifying if anti-aliasing should be used. True if anti-aliasing filtering sl@0: should be used. If the plugin does not support this kind of processing, sl@0: this value will be ignored. sl@0: sl@0: @since 7.0s sl@0: @see GetScaleFactorL sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::SetScaleFactorL(TReal32 aWidthPercentage, TReal32 aHeightPercentage, TBool aAntiAliasFiltering) sl@0: { sl@0: iBody->SetScaleFactorL(aWidthPercentage, aHeightPercentage, aAntiAliasFiltering); sl@0: } sl@0: sl@0: /** sl@0: Gets the scale factor currently applied to the video image. sl@0: sl@0: @param aWidthPercentage sl@0: On function return, contains the current scaling percentage applied to the width of the sl@0: video image (100 = original size). sl@0: @param aHeightPercentage sl@0: On function return, contains the current scaling percentage applied to the height of the sl@0: of the video image (100 = original size). sl@0: @param aAntiAliasFiltering sl@0: The boolean specifying if anit-aliasing is being used. sl@0: sl@0: @since 7.0s sl@0: @see SetScaleFactorL sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::GetScaleFactorL(TReal32& aWidthPercentage, TReal32& aHeightPercentage, TBool& aAntiAliasFiltering) const sl@0: { sl@0: iBody->GetScaleFactorL(aWidthPercentage, aHeightPercentage, aAntiAliasFiltering); sl@0: } sl@0: sl@0: /** sl@0: Selects a region of the video image to be displayed. sl@0: sl@0: @param aCropRegion sl@0: The dimensions of the crop region, relative to the video image. sl@0: sl@0: @since 7.0s sl@0: @see GetCropRegionL sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::SetCropRegionL(const TRect& aCropRegion) sl@0: { sl@0: iBody->SetCropRegionL(aCropRegion); sl@0: } sl@0: sl@0: /** sl@0: Gets the crop region currently applied to the image. sl@0: sl@0: @param aCropRegion sl@0: The dimensions of the crop region, relative to the video image. If no sl@0: crop region has been applied, the full dimensions of the video image will sl@0: be returned. sl@0: sl@0: @since 7.0s sl@0: @see SetCropRegionL sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::GetCropRegionL(TRect& aCropRegion) const sl@0: { sl@0: iBody->GetCropRegionL(aCropRegion); sl@0: } sl@0: sl@0: /** sl@0: Prepares the video clip to be accessed. sl@0: sl@0: A call to this method tells the loaded controller plugin to finalise its configuration sl@0: and to prepare to start reading the video clip. It is not possible to play the video clip sl@0: or query any of its properties (e.g. duration, meta data etc.) until this method has signalled sl@0: its completion (successful or otherwise) via the callback MvpuoPrepareComplete. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::Prepare() sl@0: { sl@0: iBody->Prepare(); sl@0: } sl@0: sl@0: /** sl@0: Returns the controller implementation information associated with the current controller. sl@0: sl@0: @return The controller implementation structure associated with the controller. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: EXPORT_C const CMMFControllerImplementationInformation& CVideoPlayerUtility::ControllerImplementationInformationL() sl@0: { sl@0: return iBody->ControllerImplementationInformationL(); sl@0: } sl@0: sl@0: /** sl@0: Gets a controller's DRM custom command implementation. sl@0: sl@0: @return A pointer to a controller's DRM custom command implementation, or NULL sl@0: if the controller does not support it. sl@0: */ sl@0: EXPORT_C MMMFDRMCustomCommand* CVideoPlayerUtility::GetDRMCustomCommand() sl@0: { sl@0: return iBody->GetDRMCustomCommand(); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Enables a client application to stop the video player from using direct screen access (DSA). sl@0: sl@0: From Symbian release 9.5 onwards this method is not supported when called on an instance of CVideoPlayerUtility2, and will always sl@0: leave with KErrNotSupported. sl@0: sl@0: This function leaves if errors are encountered when trying to stop DSA. sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::StopDirectScreenAccessL() sl@0: { sl@0: iBody->StopDirectScreenAccessL(); sl@0: } sl@0: sl@0: /** sl@0: Enables a client application to start the video player using direct screen access (DSA). sl@0: sl@0: From Symbian release 9.5 onwards this method is not supported when called on an instance of CVideoPlayerUtility2, and will always sl@0: leave with KErrNotSupported. sl@0: sl@0: This function leaves if errors are encountered when trying to start DSA. sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::StartDirectScreenAccessL() sl@0: { sl@0: iBody->StartDirectScreenAccessL(); sl@0: } sl@0: sl@0: /** sl@0: Registers for notification, when audio resource is available. sl@0: sl@0: @param aCallback sl@0: Observer interface for audio resource notification event sl@0: sl@0: @param aNotificationEventId sl@0: The Event for which the client registers. sl@0: sl@0: @param aNotificationRegistrationData sl@0: Data specific to notification registration.This has been reserved for future use and its value should be NULL. sl@0: sl@0: @return An error code indicating if the registration is successful. KErrNone on success, sl@0: otherwise another of the system-wide error codes. sl@0: */ sl@0: EXPORT_C TInt CVideoPlayerUtility::RegisterAudioResourceNotification(MMMFAudioResourceNotificationCallback& aCallback, TUid aNotificationEventId, const TDesC8& aNotificationRegistrationData) sl@0: { sl@0: return iBody->RegisterAudioResourceNotification(aCallback, aNotificationEventId, aNotificationRegistrationData); sl@0: } sl@0: sl@0: /** sl@0: Cancels the registration for audio resource notification. sl@0: sl@0: @param aNotificationEventId sl@0: The Event to be cancellled. sl@0: sl@0: @return An error code indicating if the cancellation is successful. KErrNone on success, sl@0: otherwise another of the system-wide error codes. sl@0: */ sl@0: EXPORT_C TInt CVideoPlayerUtility::CancelRegisterAudioResourceNotification(TUid aNotificationEventId) sl@0: { sl@0: return iBody->CancelRegisterAudioResourceNotification(aNotificationEventId); sl@0: } sl@0: sl@0: /** sl@0: Waits for the client to resume the play even after the default timer expires. sl@0: Unless the client completes the play no other client gets notification. sl@0: sl@0: @return An error code indicating if the function call is successful. KErrNone on success, sl@0: otherwise another of the system-wide error codes. sl@0: */ sl@0: EXPORT_C TInt CVideoPlayerUtility::WillResumePlay() sl@0: { sl@0: return iBody->WillResumePlay(); sl@0: } sl@0: sl@0: /** sl@0: Sets the initial screen to be used for the video display. sl@0: sl@0: From Symbian release 9.5 onwards this method is not supported when called on an instance of CVideoPlayerUtility2, and will always sl@0: leave with KErrNotSupported. sl@0: sl@0: @param aScreenNumber sl@0: The screen number of the device. sl@0: sl@0: @return KErrNotSupported if the secondary screen display is not supported in Multimedia Framework or sl@0: from Symbian release 9.5 onwards when called on an instance of CVideoPlayerUtility2. KErrNone on success. sl@0: */ sl@0: EXPORT_C TInt CVideoPlayerUtility::SetInitScreenNumber(TInt aScreenNumber) sl@0: { sl@0: return iBody->SetInitScreenNumber(aScreenNumber); sl@0: } sl@0: sl@0: _LIT(KMMFMediaClientVideoPanicCategory, "MediaClientVideo"); sl@0: GLDEF_C void Panic(TMmfVideoPanic aError) sl@0: { sl@0: User::Panic(KMMFMediaClientVideoPanicCategory, aError); sl@0: } sl@0: sl@0: /** sl@0: Set video playback velocity relative to the normal video clip speed. sl@0: This method can be used for fast forward, rewind, and slow-motion sl@0: playback, depending on the capabilities of the underlying play-controller sl@0: implementation and the characteristics of the video clip. Velocity set sl@0: in this call will take effect immediately. Additionally, sl@0: playback velocity cannot be changed for streamed video. Use sl@0: GetPlayRateCapabilitiesL() to determine what playback modes are sl@0: available. sl@0: sl@0: Note that due to performance reasons, it may not be possible to perform sl@0: fast forward or rewind at the requested speed. If that happens, the sl@0: play-controller will use the nearest available velocity. This is not sl@0: considered an error and the method will not leave. User can query sl@0: velocity in effect by calling PlayVelocityL(). sl@0: sl@0: The default playback velocity is 100. sl@0: Play velocity is persistent across stop play calls on utility. sl@0: That is SetPlayVelocityL(),call StopL(),then PlayL() will play with sl@0: the velocity set in most recent call. On opening different sl@0: file the velocity will default to 100. sl@0: sl@0: This function quits or exits leaving any of the system wide error codes. sl@0: Common error codes are listed below. sl@0: sl@0: @param aVelocity Playback velocity as a percentage relative to the sl@0: normal video clip speed. Use 100 for normal-speed sl@0: forward playback and negative value for reverse. Values above sl@0: 100 and below 0 correspond to fast forward and sl@0: rewind respectively, while values 1 to 100 represent sl@0: slow-motioned playback. sl@0: sl@0: @pre Playback has been started, but may be paused. sl@0: sl@0: @see CVideoPlayerUtility::GetPlayRateCapabilitiesL() sl@0: sl@0: @leave KErrNotSupported The requested playback velocity is not sl@0: supported. sl@0: @leave KErrNotReady Playback has not yet been started sl@0: sl@0: @publishedPartner sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::SetPlayVelocityL(TInt aVelocity) sl@0: { sl@0: iBody->SetPlayVelocityL(aVelocity); sl@0: } sl@0: sl@0: /** sl@0: Returns the current playback velocity. If setting play velocity is sl@0: not supported or velocity is not set this will return default play velocity sl@0: 100 corresponding to normal playback. sl@0: sl@0: If implementation is not supporting the velocity set with SetPlayVelocityL sl@0: it will default to the nearest velocity. In this case this API will return sl@0: the value it has defaulted to. sl@0: sl@0: If an error occurs, this function leaves with any of the system sl@0: wide error codes. Common error codes are listed below. sl@0: sl@0: @return The current playback velocity as a percentage relative to the sl@0: normal video clip speed. sl@0: sl@0: @pre Playback has been started, but may be paused. sl@0: sl@0: @see CVideoPlayerUtility::SetPlayVelocityL() sl@0: sl@0: @leave KErrNotReady Playback has not yet been started sl@0: sl@0: @publishedPartner sl@0: */ sl@0: EXPORT_C TInt CVideoPlayerUtility::PlayVelocityL() const sl@0: { sl@0: return iBody->PlayVelocityL(); sl@0: } sl@0: sl@0: /** sl@0: Steps the current video playback position forward or backward by a sl@0: number of frames. Frame step is only available when playback is paused. sl@0: sl@0: Support for frame stepping may depend on the underlying play-controller sl@0: implementation and the video clip open. Additionally, frame step is sl@0: typically not available in streamed playback. Use GetPlayRateCapabilitiesL() sl@0: to query if frame step is currently possible. Application may check the sl@0: value of the current positon after stepping through several frames by calling sl@0: PositionL() API. sl@0: sl@0: Implementations may not be able to step exactly the number of frames sl@0: requested, especially when stepping backwards. If this happens, the sl@0: play-controller will step to a frame close to the one requested. This is sl@0: not considered an error. sl@0: sl@0: This function quits or exits leaving any of the system wide error codes. sl@0: Common error codes are listed below. sl@0: sl@0: @param aStep The number of frames to step. Use positive values for sl@0: stepping forward and negative values for stepping sl@0: back. sl@0: sl@0: @pre Playback has been started and is currently paused. sl@0: That means this API can be called only in paused state. sl@0: sl@0: @see CVideoPlayerUtility::GetPlayRateCapabilitiesL() sl@0: sl@0: @leave KErrNotSupported Frame step is not supported. Note that some sl@0: implementations may support step forward but not step backward. sl@0: @leave KErrNotReady Playback has not yet been started or is not in paused state. sl@0: sl@0: @publishedPartner sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::StepFrameL(TInt aStep) sl@0: { sl@0: iBody->StepFrameL(aStep); sl@0: } sl@0: sl@0: /** sl@0: Queries the current playback rate capabilities. The capabilities sl@0: describe whether fast forward, reverse playback, slow motion, or sl@0: step backward or forward is possible. The capabilities may depend on sl@0: the controller implementation and the video clip. Additionally, sl@0: only normal-speed forward playback is typically possible in streamed playback. sl@0: sl@0: This function quits or exits leaving any of the system wide error codes. sl@0: Common error codes are listed below. sl@0: sl@0: @param aCapabilities Playback rate capabilities sl@0: sl@0: @pre The video clip has been opened sl@0: sl@0: @leave KErrNotReady The video clip has not yet been opened sl@0: sl@0: @publishedPartner sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::GetPlayRateCapabilitiesL(TVideoPlayRateCapabilities& aCapabilities)const sl@0: { sl@0: iBody->GetPlayRateCapabilitiesL(aCapabilities); sl@0: } sl@0: sl@0: /** sl@0: Enables or disables video playback. This function is used to disable sl@0: video playback in a video clip to play only the audio track. By default sl@0: video playback is always enabled if the clip has a video track. sl@0: sl@0: This method can be called after the video clip has been opened, but sl@0: only before calling Prepare(). sl@0: sl@0: This function quits or exits leaving any of the system wide error codes. sl@0: Common error codes are listed below. sl@0: sl@0: @param aVideoEnabled ETrue to enable video playback, EFalse to disable sl@0: sl@0: @pre The video clip has been opened by the client and Prepare() has not been called. sl@0: sl@0: @leave KErrNotSupported This method is not supported -- video playback sl@0: is always enabled. sl@0: @leave KErrNotReady The clip has not been opened or the client has sl@0: already called Prepare(). sl@0: sl@0: @publishedPartner sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::SetVideoEnabledL(TBool aVideoEnabled) sl@0: { sl@0: iBody->SetVideoEnabledL(aVideoEnabled); sl@0: } sl@0: sl@0: /** sl@0: Queries whether video playback is currently enabled or not. sl@0: If an error occurs, this function leaves with any of the system sl@0: wide error codes. Common error codes are listed below. sl@0: sl@0: @return ETrue if video playback is enabled, EFalse if not. sl@0: sl@0: @publishedPartner sl@0: */ sl@0: EXPORT_C TBool CVideoPlayerUtility::VideoEnabledL() const sl@0: { sl@0: return iBody->VideoEnabledL(); sl@0: } sl@0: sl@0: /** sl@0: Enables or disables audio playback. This function is used to disable sl@0: audio playback in a video clip to play only the video track. By default sl@0: audio playback is always enabled if the clip has an audio track. sl@0: sl@0: This method can be called after the video clip has been opened, but sl@0: only before calling Prepare(). sl@0: sl@0: This function quits or exits leaving any of the system wide error codes. sl@0: Common error codes are listed below. sl@0: sl@0: @param aAudioEnabled ETrue to enable audio playback, EFalse to disable sl@0: sl@0: @pre The video clip has been opened by the client and Prepare() has not been called. sl@0: sl@0: @leave KErrNotSupported This method is not supported -- audio playback sl@0: is always enabled sl@0: @leave KErrNotReady The clip has not been opened or the client has sl@0: already called Prepare(). sl@0: sl@0: @publishedPartner sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::SetAudioEnabledL(TBool aAudioEnabled) sl@0: { sl@0: iBody->SetAudioEnabledL(aAudioEnabled); sl@0: } sl@0: sl@0: /** sl@0: Set video automatic scaling. When automatic scaling is active, the sl@0: video picture is scaled automatically to match the video window, sl@0: based on the scaling type. This variant of SetAutoScaleL() will sl@0: always center the picture in the window. sl@0: sl@0: Calling SetAutoScaleL() will override any scaling factors set with sl@0: SetScaleFactorL(). Calling SetScaleFactorL() will disable automatic sl@0: scaling. sl@0: sl@0: Not all video controllers support automatic scaling. sl@0: sl@0: This function quits or exits leaving any of the system wide error codes. sl@0: Common error codes are listed below. sl@0: sl@0: @see TAutoScaleType, THorizontalAlign, TVerticalAlign sl@0: sl@0: @param aScaleType Automatic scaling type sl@0: sl@0: @pre The video clip has been opened by the client sl@0: sl@0: @leave KErrNotSupported Automatic scaling is not supported sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::SetAutoScaleL(TAutoScaleType aScaleType) sl@0: { sl@0: iBody->SetAutoScaleL(aScaleType); sl@0: } sl@0: sl@0: /** sl@0: Set video automatic scaling. When automatic scaling is active, the sl@0: video picture is scaled automatically to match the video window, sl@0: based on the scaling type, and positioned according to the sl@0: parameters. sl@0: sl@0: Calling SetAutoScaleL() will override any scaling factors set with sl@0: SetScaleFactorL(). Calling SetScaleFactorL() will disable automatic sl@0: scaling. sl@0: sl@0: Not all video controller support automatic scaling. sl@0: sl@0: This function quits or exits leaving any of the system wide error codes. sl@0: Common error codes are listed below. sl@0: sl@0: @see TAutoScaleType, THorizontalAlign, TVerticalAlign sl@0: sl@0: @param aScaleType Automatic scaling type sl@0: @param aHorizPos Video picture horizontal position, relative to the sl@0: video window. The value can be either a pixel offset sl@0: (positive or negative) from the top left corner of the sl@0: window to the top left corner of the picture, or an sl@0: alignment constant from enum THorizontalAlign. sl@0: @param aVertPos Video picture vertical position, relative to the sl@0: video window. The value can be either a pixel offset sl@0: (positive or negative) from the top left corner of the sl@0: window to the top left corner of the picture, or an sl@0: alignment constant from enum TVerticalAlign. sl@0: sl@0: @pre The video clip has been opened by the client. sl@0: sl@0: @leave KErrNotSupported Automatic scaling is not supported sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::SetAutoScaleL(TAutoScaleType aScaleType, TInt aHorizPos, TInt aVertPos) sl@0: { sl@0: iBody->SetAutoScaleL(aScaleType, aHorizPos, aVertPos ); sl@0: } sl@0: sl@0: /** sl@0: When enabled sets automatic switching of surface to/from external display when it is connected/disconnected from the device. sl@0: sl@0: Automatic switching is enabled by default, but only if the client thread that created this utility has an Active Scheduler sl@0: installed and the device supports external display switching. sl@0: sl@0: To use this function the client thread must have an Active Scheduler installed otherwise it will leave with KErrNotReady. sl@0: sl@0: @param aControl sl@0: ETrue to enable. EFalse to disable. sl@0: @param aDisplay sl@0: Display id of display to enable external switching for. sl@0: @leave KErrNotSupported Device does not support external displays sl@0: @leave KErrNotReady CActiveScheduler is not installed sl@0: */ sl@0: EXPORT_C void CVideoPlayerUtility::SetExternalDisplaySwitchingL(TInt aDisplay, TBool aControl) sl@0: { sl@0: iBody->SetExternalDisplaySwitchingL(aDisplay, aControl); sl@0: }