sl@0: // Copyright (c) 2005-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: // Part of the MVS Agents for TechView sl@0: // sl@0: sl@0: #ifndef MVSVIDEOPLAYAGENT_H sl@0: #define MVSVIDEOPLAYAGENT_H sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #include sl@0: #include sl@0: sl@0: #include sl@0: sl@0: sl@0: // forward declaration sl@0: #ifdef SYMBIAN_BUILD_GCE sl@0: class CVideoPlayerUtility2; sl@0: class MMMFSurfaceEventHandler; sl@0: #endif sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @prototype sl@0: @test sl@0: sl@0: Provides Video playing functionality for the UI sl@0: sl@0: */ sl@0: class CMVSVideoPlayAgent : public CBase, MVideoPlayerUtilityObserver, MMMFAudioResourceNotificationCallback sl@0: { sl@0: public: sl@0: IMPORT_C static CMVSVideoPlayAgent* NewL(MMVSClientObserver& aObserver); sl@0: IMPORT_C ~CMVSVideoPlayAgent(); sl@0: sl@0: //opens an video clip for playback sl@0: IMPORT_C void OpenFileL(const TDesC& aFileName); sl@0: IMPORT_C void OpenFileL(const TDesC& aFileName, TUid aControllerUid); sl@0: sl@0: //opens DRM protected source sl@0: IMPORT_C void OpenFileL(TMMSource &aSource); sl@0: sl@0: IMPORT_C void OpenDesL(const TDesC8 &aDescriptor); //For future support sl@0: sl@0: IMPORT_C void Prepare(); sl@0: IMPORT_C void Close(); sl@0: IMPORT_C void Play(); sl@0: IMPORT_C void Play(const TTimeIntervalMicroSeconds &aStartPoint, const TTimeIntervalMicroSeconds &aEndPoint); sl@0: IMPORT_C TInt Stop(); sl@0: IMPORT_C void PauseL(); sl@0: sl@0: //Setter Functions sl@0: IMPORT_C void SetDisplayWindowL(RWsSession &aWs, CWsScreenDevice &aScreenDevice, RWindow &aWindow, const TRect &aWindowRect, const TRect &aClipRect); sl@0: IMPORT_C void SetVideoFrameRateL(TReal32 aFramesPerSecond); sl@0: IMPORT_C void SetVolumeL(TInt aVolume); sl@0: IMPORT_C void SetBalanceL(TInt aBalance); sl@0: IMPORT_C void SetPriorityL(TInt aPriority, TMdaPriorityPreference aPref); sl@0: IMPORT_C void SetPositionL(const TTimeIntervalMicroSeconds &aPosition); sl@0: IMPORT_C void SetRotationL(TVideoRotation aRotation); sl@0: IMPORT_C void SetScaleFactorL(TReal32 aWidthPercentage, TReal32 aHeightPercentage, TBool aAntiAliasFiltering); sl@0: IMPORT_C void SetCropRegionL(const TRect &aCropRegion); sl@0: IMPORT_C void SetVideoExtentL(const TRect& aVideoExtent); sl@0: IMPORT_C void SetWindowClipRectL(const TRect& aWindowClipRect); sl@0: sl@0: IMPORT_C void GetFrameL(TDisplayMode aDisplayMode); sl@0: IMPORT_C void GetFrameL(TDisplayMode aDisplayMode, ContentAccess::TIntent aIntent); sl@0: IMPORT_C TReal32 VideoFrameRateL(); sl@0: IMPORT_C void VideoFrameSizeL(TSize &aSize) ; sl@0: IMPORT_C const TDesC8 &VideoFormatMimeType() ; sl@0: IMPORT_C TInt VideoBitRateL() ; //No way to seek this information in HwDevice. sl@0: IMPORT_C TInt AudioBitRateL() ; //This is done in devsound using the custom interface. sl@0: IMPORT_C TFourCC AudioTypeL() ; sl@0: IMPORT_C TBool AudioEnabledL() ; sl@0: IMPORT_C TTimeIntervalMicroSeconds PositionL() ; sl@0: IMPORT_C TTimeIntervalMicroSeconds DurationL() ; sl@0: sl@0: IMPORT_C TInt Volume() ; sl@0: IMPORT_C void PriorityL(TInt &aPriority, TMdaPriorityPreference &aPref) ; sl@0: IMPORT_C TInt Balance() ; sl@0: sl@0: IMPORT_C TVideoRotation RotationL() ; sl@0: IMPORT_C void GetScaleFactorL(TReal32 &aWidthPercentage, TReal32 &aHeightPercentage, TBool &aAntiAliasFiltering) ; sl@0: IMPORT_C void GetCropRegionL(TRect &aCropRegion) ; sl@0: sl@0: IMPORT_C TInt NumberOfMetaDataEntriesL(); sl@0: IMPORT_C void GetMetaDataArrayL(RPointerArray& aMetaData); sl@0: IMPORT_C const CMMFControllerImplementationInformation &ControllerImplementationInformationL(); sl@0: sl@0: IMPORT_C TMVSState GetState(); sl@0: sl@0: IMPORT_C void SetVideoOutputL(RWsSession& aWs, sl@0: CWsScreenDevice& aScreenDevice, sl@0: RWindow& aWindow, sl@0: TRect& aScreenRect, sl@0: TRect& aClipRect); sl@0: sl@0: IMPORT_C void AddDisplayWindowL(RWsSession& aWs, sl@0: CWsScreenDevice& aScreenDevice, sl@0: RWindow& aWindow, sl@0: const TRect& aScreenRect, sl@0: const TRect& aClipRect); sl@0: sl@0: IMPORT_C void AddDisplayWindowL(RWsSession& aWs, sl@0: CWsScreenDevice& aScreenDevice, sl@0: RWindow& aWindow); sl@0: sl@0: IMPORT_C void AddDisplayL(RWsSession& aWs, TInt aDisplay, MMMFSurfaceEventHandler& aEventHandler); sl@0: sl@0: IMPORT_C void RemoveDisplayWindowL(RWindow& aWindow); sl@0: IMPORT_C void RemoveDisplay(TInt aDisplay); sl@0: sl@0: IMPORT_C TInt MaxVolume(); sl@0: IMPORT_C TInt SetScreenNumber(TInt aScreenNumber); sl@0: IMPORT_C TInt RegisterForNotification(); sl@0: IMPORT_C TInt CancelNotification(); sl@0: IMPORT_C TInt WillResumePlay(); sl@0: IMPORT_C TBool SupportVideoPlayerUtility2() const; sl@0: sl@0: IMPORT_C void SetAutoScaleL(RWindow& aWindow, TAutoScaleType aScaleType, TInt aHorizPos, TInt aVertPos); sl@0: IMPORT_C void SetAutoScaleL(TAutoScaleType aScaleType, TInt aHorizPos, TInt aVertPos); sl@0: sl@0: #ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT sl@0: IMPORT_C void DisableSubtitlesL(); sl@0: IMPORT_C void EnableSubtitlesL(); sl@0: IMPORT_C void RenderSubtitle(const TRect& aRect); sl@0: IMPORT_C TBool SubtitlesAvailable(); sl@0: #endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT sl@0: sl@0: public: sl@0: void MvpuoOpenComplete(TInt aError); sl@0: void MvpuoPrepareComplete(TInt aError); sl@0: void MvpuoFrameReady(CFbsBitmap& aFrame,TInt aError); sl@0: void MvpuoPlayComplete(TInt aError); sl@0: void MvpuoEvent(const TMMFEvent& aEvent); sl@0: sl@0: //From MMMFAudioResourceNotificationCallback sl@0: void MarncResourceAvailable(TUid aNotificationEventId, const TDesC8& aNotificationData); sl@0: private: sl@0: void ConstructL(); sl@0: CMVSVideoPlayAgent(MMVSClientObserver& aObserver); sl@0: sl@0: private: sl@0: CVideoPlayerUtility* iVideoPlayer; sl@0: #ifdef SYMBIAN_BUILD_GCE sl@0: CVideoPlayerUtility2* iVideoPlayer2; sl@0: #endif sl@0: sl@0: MMVSClientObserver& iObserver; sl@0: TMVSState iState; sl@0: TMMFEvent iEvent; sl@0: RFs iFs; sl@0: RFile iFile; sl@0: CWsScreenDevice* iScreen; sl@0: RWindow* iWindow; sl@0: RWsSession iWs; sl@0: RWindowGroup iRootWindow; sl@0: RFileLogger iFileLogger; sl@0: TInt iScreenNumber; sl@0: TBool iSupportVideoPlayerUtility2; sl@0: CVideoPlayerUtility* iCurrentVideoPlayer; sl@0: RBuf iFileName; sl@0: TUid iControllerUid; sl@0: TBool iRequestNotify; sl@0: #ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT sl@0: TBool iEnableSubtitlesOnAdd; sl@0: #endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT sl@0: }; sl@0: sl@0: sl@0: sl@0: sl@0: #endif // MVSVIDEOPLAYAGENT_H