os/mm/mmlibs/mmfw/tsrc/mmvalidationsuite/mmvalidationsuiteagents/inc/videoplayagent.h
Update contrib.
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Part of the MVS Agents for TechView
17 #ifndef MVSVIDEOPLAYAGENT_H
18 #define MVSVIDEOPLAYAGENT_H
24 #include <mmf/common/mmffourcc.h>
25 #include <mmf/common/mmfstandardcustomcommands.h>
26 #include <mmf/common/mmfvideo.h>
27 #include <mmf/server/mmfdes.h>
28 #include <mmf/server/mmffile.h>
29 #include <mmf/common/mmfcontroller.h>
31 #include <videorecorder.h>
32 #include <videoplayer.h>
34 #include <mvs/agentsutility.h>
37 // forward declaration
38 #ifdef SYMBIAN_BUILD_GCE
39 class CVideoPlayerUtility2;
40 class MMMFSurfaceEventHandler;
48 Provides Video playing functionality for the UI
51 class CMVSVideoPlayAgent : public CBase, MVideoPlayerUtilityObserver, MMMFAudioResourceNotificationCallback
54 IMPORT_C static CMVSVideoPlayAgent* NewL(MMVSClientObserver& aObserver);
55 IMPORT_C ~CMVSVideoPlayAgent();
57 //opens an video clip for playback
58 IMPORT_C void OpenFileL(const TDesC& aFileName);
59 IMPORT_C void OpenFileL(const TDesC& aFileName, TUid aControllerUid);
61 //opens DRM protected source
62 IMPORT_C void OpenFileL(TMMSource &aSource);
64 IMPORT_C void OpenDesL(const TDesC8 &aDescriptor); //For future support
66 IMPORT_C void Prepare();
67 IMPORT_C void Close();
69 IMPORT_C void Play(const TTimeIntervalMicroSeconds &aStartPoint, const TTimeIntervalMicroSeconds &aEndPoint);
71 IMPORT_C void PauseL();
74 IMPORT_C void SetDisplayWindowL(RWsSession &aWs, CWsScreenDevice &aScreenDevice, RWindow &aWindow, const TRect &aWindowRect, const TRect &aClipRect);
75 IMPORT_C void SetVideoFrameRateL(TReal32 aFramesPerSecond);
76 IMPORT_C void SetVolumeL(TInt aVolume);
77 IMPORT_C void SetBalanceL(TInt aBalance);
78 IMPORT_C void SetPriorityL(TInt aPriority, TMdaPriorityPreference aPref);
79 IMPORT_C void SetPositionL(const TTimeIntervalMicroSeconds &aPosition);
80 IMPORT_C void SetRotationL(TVideoRotation aRotation);
81 IMPORT_C void SetScaleFactorL(TReal32 aWidthPercentage, TReal32 aHeightPercentage, TBool aAntiAliasFiltering);
82 IMPORT_C void SetCropRegionL(const TRect &aCropRegion);
83 IMPORT_C void SetVideoExtentL(const TRect& aVideoExtent);
84 IMPORT_C void SetWindowClipRectL(const TRect& aWindowClipRect);
86 IMPORT_C void GetFrameL(TDisplayMode aDisplayMode);
87 IMPORT_C void GetFrameL(TDisplayMode aDisplayMode, ContentAccess::TIntent aIntent);
88 IMPORT_C TReal32 VideoFrameRateL();
89 IMPORT_C void VideoFrameSizeL(TSize &aSize) ;
90 IMPORT_C const TDesC8 &VideoFormatMimeType() ;
91 IMPORT_C TInt VideoBitRateL() ; //No way to seek this information in HwDevice.
92 IMPORT_C TInt AudioBitRateL() ; //This is done in devsound using the custom interface.
93 IMPORT_C TFourCC AudioTypeL() ;
94 IMPORT_C TBool AudioEnabledL() ;
95 IMPORT_C TTimeIntervalMicroSeconds PositionL() ;
96 IMPORT_C TTimeIntervalMicroSeconds DurationL() ;
98 IMPORT_C TInt Volume() ;
99 IMPORT_C void PriorityL(TInt &aPriority, TMdaPriorityPreference &aPref) ;
100 IMPORT_C TInt Balance() ;
102 IMPORT_C TVideoRotation RotationL() ;
103 IMPORT_C void GetScaleFactorL(TReal32 &aWidthPercentage, TReal32 &aHeightPercentage, TBool &aAntiAliasFiltering) ;
104 IMPORT_C void GetCropRegionL(TRect &aCropRegion) ;
106 IMPORT_C TInt NumberOfMetaDataEntriesL();
107 IMPORT_C void GetMetaDataArrayL(RPointerArray<CMMFMetaDataEntry>& aMetaData);
108 IMPORT_C const CMMFControllerImplementationInformation &ControllerImplementationInformationL();
110 IMPORT_C TMVSState GetState();
112 IMPORT_C void SetVideoOutputL(RWsSession& aWs,
113 CWsScreenDevice& aScreenDevice,
118 IMPORT_C void AddDisplayWindowL(RWsSession& aWs,
119 CWsScreenDevice& aScreenDevice,
121 const TRect& aScreenRect,
122 const TRect& aClipRect);
124 IMPORT_C void AddDisplayWindowL(RWsSession& aWs,
125 CWsScreenDevice& aScreenDevice,
128 IMPORT_C void AddDisplayL(RWsSession& aWs, TInt aDisplay, MMMFSurfaceEventHandler& aEventHandler);
130 IMPORT_C void RemoveDisplayWindowL(RWindow& aWindow);
131 IMPORT_C void RemoveDisplay(TInt aDisplay);
133 IMPORT_C TInt MaxVolume();
134 IMPORT_C TInt SetScreenNumber(TInt aScreenNumber);
135 IMPORT_C TInt RegisterForNotification();
136 IMPORT_C TInt CancelNotification();
137 IMPORT_C TInt WillResumePlay();
138 IMPORT_C TBool SupportVideoPlayerUtility2() const;
140 IMPORT_C void SetAutoScaleL(RWindow& aWindow, TAutoScaleType aScaleType, TInt aHorizPos, TInt aVertPos);
141 IMPORT_C void SetAutoScaleL(TAutoScaleType aScaleType, TInt aHorizPos, TInt aVertPos);
143 #ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
144 IMPORT_C void DisableSubtitlesL();
145 IMPORT_C void EnableSubtitlesL();
146 IMPORT_C void RenderSubtitle(const TRect& aRect);
147 IMPORT_C TBool SubtitlesAvailable();
148 #endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
151 void MvpuoOpenComplete(TInt aError);
152 void MvpuoPrepareComplete(TInt aError);
153 void MvpuoFrameReady(CFbsBitmap& aFrame,TInt aError);
154 void MvpuoPlayComplete(TInt aError);
155 void MvpuoEvent(const TMMFEvent& aEvent);
157 //From MMMFAudioResourceNotificationCallback
158 void MarncResourceAvailable(TUid aNotificationEventId, const TDesC8& aNotificationData);
161 CMVSVideoPlayAgent(MMVSClientObserver& aObserver);
164 CVideoPlayerUtility* iVideoPlayer;
165 #ifdef SYMBIAN_BUILD_GCE
166 CVideoPlayerUtility2* iVideoPlayer2;
169 MMVSClientObserver& iObserver;
174 CWsScreenDevice* iScreen;
177 RWindowGroup iRootWindow;
178 RFileLogger iFileLogger;
180 TBool iSupportVideoPlayerUtility2;
181 CVideoPlayerUtility* iCurrentVideoPlayer;
184 TBool iRequestNotify;
185 #ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
186 TBool iEnableSubtitlesOnAdd;
187 #endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
193 #endif // MVSVIDEOPLAYAGENT_H