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 |
|
55
|
18 |
// Version : %version: da1mmcf#24 %
|
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 |
|
44
|
215 |
private:
|
|
216 |
|
|
217 |
/**
|
|
218 |
* Handle playback message
|
|
219 |
*
|
|
220 |
* @param aMsg playback message
|
|
221 |
*/
|
|
222 |
virtual void DoHandlePlaybackMessageL( CMPXMessage* aMessage );
|
|
223 |
|
|
224 |
/**
|
|
225 |
* Handle playback error message
|
|
226 |
*
|
|
227 |
* @param aErr system error code.
|
|
228 |
*/
|
|
229 |
void DoHandleErrorPlaybackMessageL( TInt aError );
|
|
230 |
|
|
231 |
void DisplayFileDetailsDialogL();
|
|
232 |
|
|
233 |
/**
|
|
234 |
* Handle media properties.
|
|
235 |
*
|
|
236 |
* @param aMedia media properties
|
|
237 |
* @param aError error code
|
|
238 |
*/
|
|
239 |
virtual void DoHandleMediaL( const CMPXMedia& aMedia, TInt aError );
|
|
240 |
|
|
241 |
void CreateVideoSpecificCmdL( TMPXVideoPlaybackCommand aCmd );
|
|
242 |
|
|
243 |
void ParseMetaDataL( const CMPXMedia& aMedia );
|
|
244 |
|
|
245 |
void DoHandleStateChangeL( TInt aNewState );
|
|
246 |
|
|
247 |
void HandleGeneralPlaybackMessageL( CMPXMessage* aMessage );
|
|
248 |
|
|
249 |
void SetAspectRatioL( TMPXVideoPlaybackCommand aCmd );
|
|
250 |
|
|
251 |
void HandleVolumeCmdL( TMPXPlaybackCommand aCmd );
|
|
252 |
|
|
253 |
void HandleShortPressBackwardL();
|
|
254 |
|
|
255 |
void IssuePlayCommandL();
|
|
256 |
|
|
257 |
void RequestPlaybackMediaL();
|
|
258 |
|
|
259 |
void RequestCollectionMediaL();
|
|
260 |
|
|
261 |
TBool IsInMemoryPlugin();
|
|
262 |
|
|
263 |
void UpdatePbPluginMediaL( TBool aSeek );
|
50
|
264 |
|
49
|
265 |
TInt GetMediaId();
|
50
|
266 |
|
44
|
267 |
protected: // data
|
|
268 |
MMPXPlaybackUtility* iPlaybackUtility;
|
|
269 |
MMPXCollectionUtility* iCollectionUtility;
|
|
270 |
TMPXPlaybackState iPlaybackState;
|
|
271 |
|
|
272 |
VideoPlaybackViewFileDetails* iFileDetails;
|
|
273 |
CIdle* iCloseAO;
|
|
274 |
|
|
275 |
VideoBasePlaybackView* iView;
|
55
|
276 |
CVideoPlaybackDisplayHandler* iDisplayHandler;
|
|
277 |
CVideoPlaybackUserInputHandler* iUserInputHandler;
|
44
|
278 |
VideoPlaybackControlsController* iControlsController;
|
|
279 |
|
|
280 |
TMPXMediaRequestStatus iMediaRequestStatus;
|
|
281 |
TBool iCollectionMediaRequested;
|
|
282 |
TBool iPlaylistView;
|
|
283 |
int iPlayPosition;
|
50
|
284 |
|
44
|
285 |
public:
|
50
|
286 |
friend class VideoBasePlaybackView;
|
44
|
287 |
};
|
|
288 |
|
|
289 |
#endif // __MPXVIDEOVIEWWRAPPER_H__
|
|
290 |
|
|
291 |
// EOF
|