|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: This class is the interface between the playback plugin and RMMFController |
|
15 * |
|
16 */ |
|
17 |
|
18 // Version : %version: 8 % |
|
19 |
|
20 |
|
21 #ifndef __MPXVIDEOPLAYERUTILITY__ |
|
22 #define __MPXVIDEOPLAYERUTILITY__ |
|
23 |
|
24 // |
|
25 // INCLUDES |
|
26 // |
|
27 #include <mmf/common/mmfcontroller.h> |
|
28 |
|
29 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
30 #include <mmf/common/mmfstandardcustomcommandsimpl.h> |
|
31 #else |
|
32 #include <mmf/common/mmfstandardcustomcommands.h> |
|
33 #endif |
|
34 |
|
35 #include <mmf/common/mmfdrmcustomcommands.h> |
|
36 |
|
37 #include "videohelixtest.h" |
|
38 |
|
39 typedef CArrayPtrFlat<TMMFEvent> CMmfCallbackArray; |
|
40 |
|
41 // |
|
42 // FORWARD DECLARATIONS |
|
43 // |
|
44 class CMPXVideoPlaybackController; |
|
45 |
|
46 // |
|
47 // CLASS DECLARATION |
|
48 // |
|
49 |
|
50 NONSHARABLE_CLASS( CMpxVideoPlayerUtility ) : public CBase, |
|
51 public MMMFControllerEventMonitorObserver |
|
52 { |
|
53 public: |
|
54 |
|
55 static CMpxVideoPlayerUtility* NewL( CMPXVideoPlaybackController* aVideoPlaybackCtrl ); |
|
56 ~CMpxVideoPlayerUtility(); |
|
57 |
|
58 void Reset(); |
|
59 |
|
60 void OpenFileL( const TDesC& aFileName ); |
|
61 void OpenFileL( const RFile& aFile ); |
|
62 void OpenUrlL( const TDesC& aUrl, TInt aApId ); |
|
63 |
|
64 TTimeIntervalMicroSeconds PositionL() const; |
|
65 TTimeIntervalMicroSeconds DurationL() const; |
|
66 |
|
67 TInt NumberOfMetaDataEntriesL() const; |
|
68 CMMFMetaDataEntry* MetaDataEntryL( TInt aIndex ) const; |
|
69 |
|
70 TBool AudioEnabledL() const; |
|
71 void SetVolumeL( TInt aVolume ); |
|
72 TInt Volume() const; |
|
73 TInt MaxVolume() const; |
|
74 |
|
75 void VideoFrameSizeL( TSize& aSize ) const; |
|
76 TInt VideoBitRateL() const; |
|
77 TInt AudioBitRateL() const; |
|
78 TInt VideoFormatMimeType( TDes8& aMimeType ) const; |
|
79 TUint32 FourCCCode() const; |
|
80 void RefreshFrameL(); |
|
81 |
|
82 void RestartDsa( const TRegion& aRegion ); |
|
83 void AbortDsa(); |
|
84 void SetDisplayWindowL( const TRect& aScreenRect, |
|
85 const TRect& aClipRect, |
|
86 const TRegion& aDrawingRegion ); |
|
87 |
|
88 TInt CustomCommandSync( const TMMFMessageDestinationPckg& aDestination, |
|
89 TInt aFunction, |
|
90 const TDesC8& aDataTo1, |
|
91 const TDesC8& aDataTo2 ); |
|
92 |
|
93 void Prepare(); |
|
94 void Play(); |
|
95 void PauseL(); |
|
96 void Close(); |
|
97 TInt Stop(); |
|
98 |
|
99 void SetPositionL( const TTimeIntervalMicroSeconds& aPosition ); |
|
100 |
|
101 void SetPlayVelocityL( TInt aVelocity ); |
|
102 |
|
103 void GetVideoLoadingProgressL( TInt& aPercentageProgress ); |
|
104 |
|
105 // |
|
106 // MMMFControllerEventMonitorObserver Implementation |
|
107 // |
|
108 void HandleEvent( const TMMFEvent& aEvent ); |
|
109 |
|
110 void AddStifObserver( MStifTestObserver* aStifObserver ); |
|
111 |
|
112 void SetVolumeSteps( TInt aVolumeSteps ); |
|
113 |
|
114 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
|
115 void OpenFile64L( const RFile64& aFile ); |
|
116 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
|
117 |
|
118 #ifdef SYMBIAN_BUILD_GCE |
|
119 |
|
120 TInt VideoSurfaceCreated(); |
|
121 TInt SurfaceParametersChanged(); |
|
122 TInt RemoveSurface(); |
|
123 |
|
124 #endif |
|
125 |
|
126 private: |
|
127 |
|
128 void ConstructL(); |
|
129 CMpxVideoPlayerUtility( CMPXVideoPlaybackController* aVideoPlaybackCtrl ); |
|
130 void OpenControllerL(); |
|
131 |
|
132 static TInt SendMmfEvent( TAny* aPtr ); |
|
133 void DoSendMmfEvent(); |
|
134 void AddCallbackEvent( TMMFEvent* event ); |
|
135 |
|
136 TInt ReadOpenError(); |
|
137 void ReadFileDetails( const RFile& aFile ); |
|
138 void ParseFileDetails( TDesC8& aBuffer ); |
|
139 TInt ParseDetail( TPtrC8& aData ); |
|
140 void FindFileDetail( TPtrC8& aItem, TPtrC8& value ); |
|
141 |
|
142 private: |
|
143 |
|
144 // |
|
145 // Data |
|
146 // |
|
147 CMPXVideoPlaybackController* iVideoPlaybackController; |
|
148 CIdle* iCallback; |
|
149 CMmfCallbackArray* iEventArray; |
|
150 MStifTestObserver* iStifObserver; |
|
151 |
|
152 TBool iFirstPlayCmd; |
|
153 |
|
154 RArray<CMMFMetaDataEntry*> iMetaData; |
|
155 |
|
156 HBufC8* iMimeType; |
|
157 HBufC8* iTitle; |
|
158 HBufC8* iDescription; |
|
159 HBufC8* iArtist; |
|
160 |
|
161 TSize iSize; |
|
162 |
|
163 TInt iNumMetaDataEntries; |
|
164 TInt iAudioBitRate; |
|
165 TInt iVideoBitRate; |
|
166 TInt iVolume; |
|
167 |
|
168 TBool iAudioEnabled; |
|
169 TBool iSeekable; |
|
170 TBool iLiveStream; |
|
171 |
|
172 TTimeIntervalMicroSeconds iPosition; |
|
173 TTimeIntervalMicroSeconds iDuration; |
|
174 }; |
|
175 |
|
176 #endif /* __MPXVIDEOPLAYERUTILITY__ */ |