|
1 /* |
|
2 * Copyright (c) 2008 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: MPX Video base playback view |
|
15 * |
|
16 */ |
|
17 |
|
18 // Version : %version: da1mmcf#20 % |
|
19 |
|
20 |
|
21 |
|
22 // This file defines the API for .dll |
|
23 |
|
24 #ifndef __MPXVIDEOVIEWWRAPPER_H__ |
|
25 #define __MPXVIDEOVIEWWRAPPER_H__ |
|
26 |
|
27 // Include Files |
|
28 |
|
29 #include <e32base.h> // CBase |
|
30 #include <e32std.h> // TBuf |
|
31 #include <mpxplaybackobserver.h> |
|
32 #include <mpxvideoplaybackdefs.h> |
|
33 #include <mpxviewactivationobserver.h> |
|
34 #include <mpxcollectionobserver.h> |
|
35 |
|
36 #include "videoplaybackcontrol.hrh" |
|
37 |
|
38 enum TMPXMediaRequestStatus |
|
39 { |
|
40 MediaNotRequested, |
|
41 MediaRequested, |
|
42 MediaDelivered |
|
43 }; |
|
44 |
|
45 // Forward Declarations |
|
46 class MMPXPlaybackUtility; |
|
47 class MMPXCollectionUtility; |
|
48 class VideoBasePlaybackView; |
|
49 class CMPXVideoPlaybackDisplayHandler; |
|
50 class VideoPlaybackViewFileDetails; |
|
51 class CMPXVideoPlaybackUserInputHandler; |
|
52 class VideoPlaybackControlsController; |
|
53 |
|
54 // Class Definitions |
|
55 |
|
56 class CMPXVideoViewWrapper : public CBase, |
|
57 public MMPXPlaybackObserver, |
|
58 public MMPXViewActivationObserver, |
|
59 public MMPXPlaybackCallback, |
|
60 public MMPXCollectionObserver |
|
61 { |
|
62 public: |
|
63 static CMPXVideoViewWrapper* NewL( VideoBasePlaybackView* aView ); |
|
64 virtual ~CMPXVideoViewWrapper(); |
|
65 |
|
66 private: |
|
67 CMPXVideoViewWrapper( VideoBasePlaybackView* aView ); |
|
68 void ConstructL(); |
|
69 |
|
70 public: |
|
71 virtual void HandleCommandL( TInt aCommand ); |
|
72 |
|
73 void RetrieveFileNameAndModeL( CMPXCommand* aCmd ); |
|
74 |
|
75 /* |
|
76 * From MMPXViewActivationObserver |
|
77 * Handle view activation. |
|
78 * |
|
79 * @param aCurrentViewType Current view type Uid. |
|
80 * @param aPreviousViewType Previous view type Uid. |
|
81 */ |
|
82 inline void HandleViewActivation( const TUid& /*aCurrentViewType*/, |
|
83 const TUid& /*aPreviousViewType*/ ) {} |
|
84 |
|
85 /** |
|
86 * From MMPXPlaybackObserver |
|
87 * Handle playback message |
|
88 * |
|
89 * @param aMessage Playback Message |
|
90 * @param aErr system error code. |
|
91 */ |
|
92 virtual void HandlePlaybackMessage( CMPXMessage* aMessage, TInt aError ); |
|
93 |
|
94 /** |
|
95 * From MMPXPlaybackCallback |
|
96 * Handle playback property |
|
97 * |
|
98 * @param aProperty the property |
|
99 * @param aValue the value of the property |
|
100 * @param aError error code |
|
101 */ |
|
102 void HandlePropertyL( TMPXPlaybackProperty aProperty, |
|
103 TInt aValue, |
|
104 TInt aError ); |
|
105 |
|
106 /** |
|
107 * Method is called continously until aComplete=ETrue, signifying that |
|
108 * it is done and there will be no more callbacks |
|
109 * Only new items are passed each time |
|
110 * |
|
111 * @param aPlayer UID of the subplayer |
|
112 * @param aSubPlayers a list of sub players |
|
113 * @param aComplete ETrue no more sub players. EFalse more subplayer |
|
114 * expected |
|
115 * @param aError error code |
|
116 */ |
|
117 inline void HandleSubPlayerNamesL( TUid /*aPlayer*/, |
|
118 const MDesCArray* /*aSubPlayers*/, |
|
119 TBool /*aComplete*/, |
|
120 TInt /*aError*/ ) |
|
121 {} |
|
122 |
|
123 /** |
|
124 * Call back of media request |
|
125 * |
|
126 * @param aMedia media |
|
127 * @param aError error code |
|
128 */ |
|
129 void HandleMediaL( const CMPXMedia& aProperties, TInt aError ); |
|
130 |
|
131 |
|
132 /** |
|
133 * Handle completion of a asynchronous command |
|
134 * @param aCommandResult result of the command, NULL if error |
|
135 * @param aError error code |
|
136 */ |
|
137 void HandlePlaybackCommandComplete( CMPXCommand* /*aCommandResult*/, |
|
138 TInt /*aError*/); |
|
139 /* |
|
140 * From base class MMPXCollectionMediaObserver |
|
141 * (via MMPXCollectionObserver) |
|
142 * Handle extended media properties |
|
143 * |
|
144 * @param aMedia media |
|
145 * @param aError error code |
|
146 */ |
|
147 inline void HandleCollectionMediaL( const CMPXMedia& /*aMedia*/, TInt /*aError*/ ) {} |
|
148 |
|
149 /* |
|
150 * From base class MMPXCollectionObserver |
|
151 */ |
|
152 inline void HandleCollectionMessage( CMPXMessage* /*aMsg*/, TInt /*aErr*/ ) {} |
|
153 |
|
154 inline void HandleOpenL( const CMPXMedia& /*aEntries*/, |
|
155 TInt /*aIndex*/, |
|
156 TBool /*aComplete*/, |
|
157 TInt /*aError*/ ) {} |
|
158 |
|
159 inline void HandleOpenL( const CMPXCollectionPlaylist& /*aPlaylist*/, TInt /*aError*/ ) {} |
|
160 |
|
161 /** |
|
162 * Set property |
|
163 */ |
|
164 void SetPropertyL( TMPXPlaybackProperty aProperty, TInt aValue ); |
|
165 virtual void RetrievePdlInformationL(); |
|
166 |
|
167 TBool IsLive(); |
|
168 |
|
169 TBool IsPlaylist(); |
|
170 |
|
171 void IssueVideoAppForegroundCmdL(TBool aForeground); |
|
172 |
|
173 void RequestMediaL(); |
|
174 |
|
175 void CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd, TBool aDoSync = ETrue ); |
|
176 |
|
177 TBool IsAppInFrontL(); |
|
178 |
|
179 /* |
|
180 * Activates an active object to close the player |
|
181 * @since 5.0 |
|
182 */ |
|
183 void ActivateClosePlayerActiveObject(); |
|
184 |
|
185 void CreateControlsL(); |
|
186 |
|
187 TBool IsMultiItemPlaylist(); |
|
188 |
|
189 void UpdateVideoRect( TInt aX, TInt aY, TInt aWidth, TInt aHeight, TBool transitionEffect ); |
|
190 |
|
191 void UpdateVideoRectDone(); |
|
192 |
|
193 void HandlePluginError( TInt aError ); |
|
194 |
|
195 void ClosePlaybackViewL(); |
|
196 |
|
197 void HandleBufferingStateL(); |
|
198 |
|
199 /* |
|
200 * Provides the static function for the callback to close the player |
|
201 * Called by CIdle iIdle |
|
202 * @since 3.2 |
|
203 * @param aPtr Pointer to callback class |
|
204 * @return KErrNone |
|
205 */ |
|
206 static TInt ClosePlayer( TAny* aPtr ); |
|
207 |
|
208 /* |
|
209 * Called to stop and exit the player |
|
210 * @since 3.2 |
|
211 * @return void |
|
212 */ |
|
213 void DoClosePlayer(); |
|
214 |
|
215 void HandleVideoPlaybackMessage( CMPXMessage* aMessage ); |
|
216 |
|
217 TBool IsResumingPlaybackAfterTermination(); |
|
218 |
|
219 private: |
|
220 |
|
221 /** |
|
222 * Handle playback message |
|
223 * |
|
224 * @param aMsg playback message |
|
225 */ |
|
226 virtual void DoHandlePlaybackMessageL( CMPXMessage* aMessage ); |
|
227 |
|
228 /** |
|
229 * Handle playback error message |
|
230 * |
|
231 * @param aErr system error code. |
|
232 */ |
|
233 void DoHandleErrorPlaybackMessageL( TInt aError ); |
|
234 |
|
235 void DisplayFileDetailsDialogL(); |
|
236 |
|
237 /** |
|
238 * Handle media properties. |
|
239 * |
|
240 * @param aMedia media properties |
|
241 * @param aError error code |
|
242 */ |
|
243 virtual void DoHandleMediaL( const CMPXMedia& aMedia, TInt aError ); |
|
244 |
|
245 void CreateVideoSpecificCmdL( TMPXVideoPlaybackCommand aCmd ); |
|
246 |
|
247 void ParseMetaDataL( const CMPXMedia& aMedia ); |
|
248 |
|
249 void DoHandleStateChangeL( TInt aNewState ); |
|
250 |
|
251 void HandleGeneralPlaybackMessageL( CMPXMessage* aMessage ); |
|
252 |
|
253 void SetAspectRatioL( TMPXVideoPlaybackCommand aCmd ); |
|
254 |
|
255 void HandleVolumeCmdL( TMPXPlaybackCommand aCmd ); |
|
256 |
|
257 void HandleShortPressBackwardL(); |
|
258 |
|
259 void IssuePlayCommandL(); |
|
260 |
|
261 void RequestPlaybackMediaL(); |
|
262 |
|
263 void RequestCollectionMediaL(); |
|
264 |
|
265 TBool IsInMemoryPlugin(); |
|
266 |
|
267 void UpdatePbPluginMediaL( TBool aSeek ); |
|
268 |
|
269 protected: // data |
|
270 MMPXPlaybackUtility* iPlaybackUtility; |
|
271 MMPXCollectionUtility* iCollectionUtility; |
|
272 TMPXPlaybackState iPlaybackState; |
|
273 |
|
274 VideoPlaybackViewFileDetails* iFileDetails; |
|
275 CIdle* iCloseAO; |
|
276 |
|
277 VideoBasePlaybackView* iView; |
|
278 CMPXVideoPlaybackDisplayHandler* iDisplayHandler; |
|
279 CMPXVideoPlaybackUserInputHandler* iUserInputHandler; |
|
280 VideoPlaybackControlsController* iControlsController; |
|
281 |
|
282 TMPXMediaRequestStatus iMediaRequestStatus; |
|
283 TBool iCollectionMediaRequested; |
|
284 TBool iPlaylistView; |
|
285 int iPlayPosition; |
|
286 |
|
287 public: |
|
288 friend class VideoBasePlaybackView; |
|
289 }; |
|
290 |
|
291 #endif // __MPXVIDEOVIEWWRAPPER_H__ |
|
292 |
|
293 // EOF |