44
|
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 |
|
63
|
18 |
// Version : %version: da1mmcf#25 %
|
44
|
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;
|
55
|
49 |
class CVideoPlaybackDisplayHandler;
|
44
|
50 |
class VideoPlaybackViewFileDetails;
|
55
|
51 |
class CVideoPlaybackUserInputHandler;
|
44
|
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 |
|
50
|
171 |
void IssueVideoAppForegroundCmdL( TBool aViewForeground, TBool aAppForegournd );
|
44
|
172 |
|
|
173 |
void RequestMediaL();
|
|
174 |
|
|
175 |
void CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd, TBool aDoSync = ETrue );
|
|
176 |
|
|
177 |
void ActivateClosePlayerActiveObject();
|
|
178 |
|
|
179 |
void CreateControlsL();
|
|
180 |
|
|
181 |
TBool IsMultiItemPlaylist();
|
|
182 |
|
|
183 |
void UpdateVideoRect( TInt aX, TInt aY, TInt aWidth, TInt aHeight, TBool transitionEffect );
|
|
184 |
|
|
185 |
void UpdateVideoRectDone();
|
|
186 |
|
|
187 |
void HandlePluginError( TInt aError );
|
|
188 |
|
|
189 |
void ClosePlaybackViewL();
|
|
190 |
|
|
191 |
void HandleBufferingStateL();
|
|
192 |
|
|
193 |
/*
|
|
194 |
* Provides the static function for the callback to close the player
|
|
195 |
* Called by CIdle iIdle
|
|
196 |
* @since 3.2
|
|
197 |
* @param aPtr Pointer to callback class
|
|
198 |
* @return KErrNone
|
|
199 |
*/
|
|
200 |
static TInt ClosePlayer( TAny* aPtr );
|
|
201 |
|
|
202 |
/*
|
|
203 |
* Called to stop and exit the player
|
|
204 |
* @since 3.2
|
|
205 |
* @return void
|
|
206 |
*/
|
|
207 |
void DoClosePlayer();
|
|
208 |
|
|
209 |
void HandleVideoPlaybackMessage( CMPXMessage* aMessage );
|
50
|
210 |
|
44
|
211 |
TBool IsResumingPlaybackAfterTermination();
|
|
212 |
|
50
|
213 |
void SurfacedAttached( TBool aAttached );
|
|
214 |
|
63
|
215 |
void ActivateL();
|
|
216 |
|
|
217 |
void Deactivate();
|
|
218 |
|
44
|
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 );
|
50
|
268 |
|
49
|
269 |
TInt GetMediaId();
|
50
|
270 |
|
44
|
271 |
protected: // data
|
|
272 |
MMPXPlaybackUtility* iPlaybackUtility;
|
|
273 |
MMPXCollectionUtility* iCollectionUtility;
|
|
274 |
TMPXPlaybackState iPlaybackState;
|
|
275 |
|
|
276 |
VideoPlaybackViewFileDetails* iFileDetails;
|
|
277 |
CIdle* iCloseAO;
|
|
278 |
|
|
279 |
VideoBasePlaybackView* iView;
|
55
|
280 |
CVideoPlaybackDisplayHandler* iDisplayHandler;
|
|
281 |
CVideoPlaybackUserInputHandler* iUserInputHandler;
|
44
|
282 |
VideoPlaybackControlsController* iControlsController;
|
|
283 |
|
|
284 |
TMPXMediaRequestStatus iMediaRequestStatus;
|
|
285 |
TBool iCollectionMediaRequested;
|
|
286 |
TBool iPlaylistView;
|
|
287 |
int iPlayPosition;
|
50
|
288 |
|
44
|
289 |
public:
|
50
|
290 |
friend class VideoBasePlaybackView;
|
44
|
291 |
};
|
|
292 |
|
|
293 |
#endif // __MPXVIDEOVIEWWRAPPER_H__
|
|
294 |
|
|
295 |
// EOF
|