sl@0
|
1 |
// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// Client utility functions
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
#ifndef __MMF_CLIENT_UTILITY_H__
|
sl@0
|
19 |
#define __MMF_CLIENT_UTILITY_H__
|
sl@0
|
20 |
|
sl@0
|
21 |
#include <mda/common/audio.h>
|
sl@0
|
22 |
#include <mda/common/gsmaudio.h>
|
sl@0
|
23 |
#include <mda/client/utility.h>
|
sl@0
|
24 |
#include <mmf/common/mmffourcc.h>
|
sl@0
|
25 |
#include <mmfformatimplementationuids.hrh>
|
sl@0
|
26 |
#include "mmf/common/mmfcontrollerpluginresolver.h"
|
sl@0
|
27 |
#include <mmf/server/mmffile.h>
|
sl@0
|
28 |
#include <mmf/server/mmfdes.h>
|
sl@0
|
29 |
#include "mmf/common/mmfcontroller.h"
|
sl@0
|
30 |
|
sl@0
|
31 |
#include <f32file.h>
|
sl@0
|
32 |
#include <caf/content.h>
|
sl@0
|
33 |
#include <caf/data.h>
|
sl@0
|
34 |
#include <mmf/common/mmfstandardcustomcommands.h>
|
sl@0
|
35 |
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
|
sl@0
|
36 |
#include <mmf/common/mmfstandardcustomcommandsenums.h>
|
sl@0
|
37 |
#include <mmf/common/mmfstandardcustomcommandsimpl.h>
|
sl@0
|
38 |
#endif
|
sl@0
|
39 |
#ifdef SYMBIAN_BUILD_GCE
|
sl@0
|
40 |
#include <mmf/common/mmfvideosurfacecustomcommands.h>
|
sl@0
|
41 |
#endif
|
sl@0
|
42 |
|
sl@0
|
43 |
class CMMSourceSink; // declared here.
|
sl@0
|
44 |
|
sl@0
|
45 |
NONSHARABLE_CLASS( CMMSourceSink ): public CBase
|
sl@0
|
46 |
{
|
sl@0
|
47 |
public:
|
sl@0
|
48 |
IMPORT_C static CMMSourceSink* NewL(TUid aUid, const TDesC8& aDescriptor);
|
sl@0
|
49 |
IMPORT_C static CMMSourceSink* NewLC(TUid aUid, const TDesC8& aDescriptor);
|
sl@0
|
50 |
|
sl@0
|
51 |
virtual ~CMMSourceSink();
|
sl@0
|
52 |
virtual TUid SourceSinkUid() const;
|
sl@0
|
53 |
virtual const TDesC8& SourceSinkData() const;
|
sl@0
|
54 |
|
sl@0
|
55 |
virtual TBool CarryingFileHandle() const;
|
sl@0
|
56 |
|
sl@0
|
57 |
virtual void EvaluateIntentL();
|
sl@0
|
58 |
protected:
|
sl@0
|
59 |
CMMSourceSink(TUid aUid);
|
sl@0
|
60 |
|
sl@0
|
61 |
|
sl@0
|
62 |
private:
|
sl@0
|
63 |
void ConstructL(const TDesC8& aDescriptor);
|
sl@0
|
64 |
|
sl@0
|
65 |
const TUid iUid;
|
sl@0
|
66 |
HBufC8* iBuf;
|
sl@0
|
67 |
};
|
sl@0
|
68 |
|
sl@0
|
69 |
|
sl@0
|
70 |
|
sl@0
|
71 |
|
sl@0
|
72 |
class CMMFileSourceSink; // declared here.
|
sl@0
|
73 |
|
sl@0
|
74 |
NONSHARABLE_CLASS( CMMFileSourceSink ): public CMMSourceSink
|
sl@0
|
75 |
{
|
sl@0
|
76 |
public:
|
sl@0
|
77 |
IMPORT_C static CMMFileSourceSink* NewL(TUid aUid, const RFile& aFile);
|
sl@0
|
78 |
IMPORT_C static CMMFileSourceSink* NewLC(TUid aUid, const RFile& aFile);
|
sl@0
|
79 |
|
sl@0
|
80 |
IMPORT_C static CMMFileSourceSink* NewL(TUid aUid, const TMMSource& aMMSource);
|
sl@0
|
81 |
IMPORT_C static CMMFileSourceSink* NewLC(TUid aUid, const TMMSource& aMMSource);
|
sl@0
|
82 |
|
sl@0
|
83 |
const TDesC& UniqueId() const {return *iUniqueId;}
|
sl@0
|
84 |
|
sl@0
|
85 |
virtual ~CMMFileSourceSink();
|
sl@0
|
86 |
|
sl@0
|
87 |
const TDesC& FileName() const {return *iFileName;}
|
sl@0
|
88 |
const TDesC8& SourceSinkData() const;
|
sl@0
|
89 |
|
sl@0
|
90 |
IMPORT_C void EvaluateIntentL(ContentAccess::TIntent aIntent);
|
sl@0
|
91 |
virtual void EvaluateIntentL();
|
sl@0
|
92 |
|
sl@0
|
93 |
TBool CarryingFileHandle() const;
|
sl@0
|
94 |
|
sl@0
|
95 |
TBool UsingFileHandle() const {return iUsingFileHandle;};
|
sl@0
|
96 |
const RFile& FileHandle() const {return iHandle;};
|
sl@0
|
97 |
protected:
|
sl@0
|
98 |
CMMFileSourceSink(TUid aUid);
|
sl@0
|
99 |
|
sl@0
|
100 |
private:
|
sl@0
|
101 |
void ConstructL(const TMMSource& aSource);
|
sl@0
|
102 |
void DoCreateFileSourceConfigDataL();
|
sl@0
|
103 |
void ConstructL(const RFile& aFile);
|
sl@0
|
104 |
void DoCreateFileHandleSourceConfigDataL();
|
sl@0
|
105 |
|
sl@0
|
106 |
TBool iUsingFileHandle;
|
sl@0
|
107 |
RFile iHandle;
|
sl@0
|
108 |
HBufC* iFileName;
|
sl@0
|
109 |
HBufC8* iSourceSinkData;
|
sl@0
|
110 |
HBufC* iUniqueId;
|
sl@0
|
111 |
ContentAccess::TIntent iIntent;
|
sl@0
|
112 |
|
sl@0
|
113 |
TBool iEnableUI;
|
sl@0
|
114 |
};
|
sl@0
|
115 |
|
sl@0
|
116 |
|
sl@0
|
117 |
|
sl@0
|
118 |
class CMMFMdaObjectStateChangeObserverCallback; // declared here.
|
sl@0
|
119 |
/**
|
sl@0
|
120 |
Active object utility class to allow the callback to be called asynchronously.
|
sl@0
|
121 |
This should help prevent re-entrant code in clients of the mediaframework.
|
sl@0
|
122 |
*/
|
sl@0
|
123 |
NONSHARABLE_CLASS( CMMFMdaObjectStateChangeObserverCallback ): public CActive
|
sl@0
|
124 |
{
|
sl@0
|
125 |
public:
|
sl@0
|
126 |
IMPORT_C static CMMFMdaObjectStateChangeObserverCallback* NewL(MMdaObjectStateChangeObserver& aCallback);
|
sl@0
|
127 |
virtual ~CMMFMdaObjectStateChangeObserverCallback();
|
sl@0
|
128 |
IMPORT_C void CallBack(CBase* aObject, TInt aPreviousState, TInt aCurrentState, TInt aErrorCode);
|
sl@0
|
129 |
private:
|
sl@0
|
130 |
CMMFMdaObjectStateChangeObserverCallback(MMdaObjectStateChangeObserver& aCallback);
|
sl@0
|
131 |
void RunL();
|
sl@0
|
132 |
void DoCancel();
|
sl@0
|
133 |
private:
|
sl@0
|
134 |
MMdaObjectStateChangeObserver& iCallback;
|
sl@0
|
135 |
CBase* iObject;
|
sl@0
|
136 |
TInt iPreviousState;
|
sl@0
|
137 |
TInt iCurrentState;
|
sl@0
|
138 |
TInt iErrorCode;
|
sl@0
|
139 |
};
|
sl@0
|
140 |
|
sl@0
|
141 |
class CMMFClientUtility; // declared here.
|
sl@0
|
142 |
|
sl@0
|
143 |
NONSHARABLE_CLASS( CMMFClientUtility )
|
sl@0
|
144 |
{
|
sl@0
|
145 |
public:
|
sl@0
|
146 |
IMPORT_C static TUid ConvertMdaFormatUidToECOMWrite(TUid aMdaFormatUid);
|
sl@0
|
147 |
IMPORT_C static TUid ConvertMdaFormatUidToECOMRead(TUid aMdaFormatUid);
|
sl@0
|
148 |
IMPORT_C static TFourCC ConvertMdaCodecToFourCC(TMdaPackage& aCodec);
|
sl@0
|
149 |
IMPORT_C static TInt GetFileHeaderData(const TDesC& aFileName, TDes8& aHeaderData, TInt aMaxLength);
|
sl@0
|
150 |
IMPORT_C static HBufC8* GetFileExtensionL(const TDesC& aFileName);
|
sl@0
|
151 |
static void PrioritiseControllersL(
|
sl@0
|
152 |
const RMMFControllerImplInfoArray& aControllers,
|
sl@0
|
153 |
const TDesC8& aHeaderDataPlayback,
|
sl@0
|
154 |
const TDesC8& aFileExtensionPlayback,
|
sl@0
|
155 |
const TDesC8& aHeaderDataRecord,
|
sl@0
|
156 |
const TDesC8& aFileExtensionRecord,
|
sl@0
|
157 |
RMMFControllerImplInfoArray& aPrioritisedControllers);
|
sl@0
|
158 |
static TInt GetBestMatchL(const CMMFFormatImplementationInformation* format, const TDesC8& aHeaderData, const TDesC8& aFileExtension);
|
sl@0
|
159 |
|
sl@0
|
160 |
private:
|
sl@0
|
161 |
CMMFClientUtility();
|
sl@0
|
162 |
};
|
sl@0
|
163 |
|
sl@0
|
164 |
class CMMFUtilityFileInfo; // declared here.
|
sl@0
|
165 |
class RMMFDRMPluginServerProxy;
|
sl@0
|
166 |
|
sl@0
|
167 |
NONSHARABLE_CLASS( CMMFUtilityFileInfo ): public CBase
|
sl@0
|
168 |
{
|
sl@0
|
169 |
public:
|
sl@0
|
170 |
|
sl@0
|
171 |
static CMMFUtilityFileInfo* NewL(TMMSource& aSource, TBool aSecureDRMMode = EFalse);
|
sl@0
|
172 |
static CMMFUtilityFileInfo* NewLC(TMMSource& aSource, TBool aSecureDRMMode = EFalse);
|
sl@0
|
173 |
|
sl@0
|
174 |
~CMMFUtilityFileInfo();
|
sl@0
|
175 |
|
sl@0
|
176 |
TBool GetFileMimeTypeL(TDes8& aMimeType);
|
sl@0
|
177 |
void GetFileHeaderDataL(TDes8& aHeaderData, TInt aMaxLength);
|
sl@0
|
178 |
TInt EvaluateIntent(ContentAccess::TIntent aIntent);
|
sl@0
|
179 |
|
sl@0
|
180 |
private:
|
sl@0
|
181 |
CMMFUtilityFileInfo();
|
sl@0
|
182 |
|
sl@0
|
183 |
void ConstructL(const TMMSource& aSource, TBool aSecureDRMMode);
|
sl@0
|
184 |
|
sl@0
|
185 |
private:
|
sl@0
|
186 |
ContentAccess::CData* iData;
|
sl@0
|
187 |
RMMFDRMPluginServerProxy* iDrmPluginServer;
|
sl@0
|
188 |
};
|
sl@0
|
189 |
|
sl@0
|
190 |
inline CMMFUtilityFileInfo::CMMFUtilityFileInfo()
|
sl@0
|
191 |
{
|
sl@0
|
192 |
};
|
sl@0
|
193 |
|
sl@0
|
194 |
/**
|
sl@0
|
195 |
* Mixin class that the user of the class CMMFFindAndOpenController must derive from.
|
sl@0
|
196 |
* @internalComponent
|
sl@0
|
197 |
*/
|
sl@0
|
198 |
class MMMFFindAndOpenControllerObserver
|
sl@0
|
199 |
{
|
sl@0
|
200 |
public:
|
sl@0
|
201 |
/**
|
sl@0
|
202 |
* Callback function to indicate the success or failure
|
sl@0
|
203 |
* of an attempt to find and open a suitable controller and
|
sl@0
|
204 |
* to add a source and sink.
|
sl@0
|
205 |
* @see CMMFFindAndOpenController
|
sl@0
|
206 |
*
|
sl@0
|
207 |
* @param aError
|
sl@0
|
208 |
* Indicates whether a controller has been opened sucessfully
|
sl@0
|
209 |
* This is passed by reference, mainly for the audio recorder utility
|
sl@0
|
210 |
* which opens two controllers: if the secondary controller (which is
|
sl@0
|
211 |
* always opened first) fails to open, then the audio recorder utility
|
sl@0
|
212 |
* may choose to set aError = KErrNone in the MfaocComplete() callback
|
sl@0
|
213 |
* to indicate to CFindAndOpenControler() that it should continue
|
sl@0
|
214 |
* to open the primary controller, even though opening the secondary failed.
|
sl@0
|
215 |
* @param aController
|
sl@0
|
216 |
* A pointer to the controller that has been opened or has failed to open
|
sl@0
|
217 |
* This is mainly for the audio recorder utility to indicate
|
sl@0
|
218 |
* which controller (primary or secondary) has been opened.
|
sl@0
|
219 |
* @param aControllerUid
|
sl@0
|
220 |
* the UID of the controller that has been opened
|
sl@0
|
221 |
* @param aSourceHandle
|
sl@0
|
222 |
* a pointer to the source handle
|
sl@0
|
223 |
* @internalComponent
|
sl@0
|
224 |
* a pointer to the sink handle
|
sl@0
|
225 |
*/
|
sl@0
|
226 |
virtual void MfaocComplete(
|
sl@0
|
227 |
TInt& aError,
|
sl@0
|
228 |
RMMFController* aController,
|
sl@0
|
229 |
TUid aControllerUid = KNullUid,
|
sl@0
|
230 |
TMMFMessageDestination* aSourceHandle = NULL,
|
sl@0
|
231 |
TMMFMessageDestination* aSinkHandle = NULL) = 0;
|
sl@0
|
232 |
};
|
sl@0
|
233 |
|
sl@0
|
234 |
|
sl@0
|
235 |
class CMMFFindAndOpenController; // declared here.
|
sl@0
|
236 |
/**
|
sl@0
|
237 |
* Utility class used by the MMF client API classes.
|
sl@0
|
238 |
* Finds and opens a suitable controller and adds a source and a sink
|
sl@0
|
239 |
* asynchronously. Completion is indicated asynchronously
|
sl@0
|
240 |
* using the MMMFFindAndOpenControllerObserver mixin class.
|
sl@0
|
241 |
*
|
sl@0
|
242 |
* @internalComponent
|
sl@0
|
243 |
*/
|
sl@0
|
244 |
NONSHARABLE_CLASS( CMMFFindAndOpenController ): public CActive, public MMMFAddDataSourceSinkAsyncObserver
|
sl@0
|
245 |
{
|
sl@0
|
246 |
public:
|
sl@0
|
247 |
enum TControllerMode
|
sl@0
|
248 |
{
|
sl@0
|
249 |
EPlayback,
|
sl@0
|
250 |
ERecord,
|
sl@0
|
251 |
EConvert
|
sl@0
|
252 |
};
|
sl@0
|
253 |
|
sl@0
|
254 |
enum TControllerNumber
|
sl@0
|
255 |
{
|
sl@0
|
256 |
EPrimaryController,
|
sl@0
|
257 |
ESecondaryController
|
sl@0
|
258 |
};
|
sl@0
|
259 |
|
sl@0
|
260 |
class TSourceSink
|
sl@0
|
261 |
{
|
sl@0
|
262 |
public:
|
sl@0
|
263 |
IMPORT_C TSourceSink(TUid aUid, const TDesC8& aData = KNullDesC8);
|
sl@0
|
264 |
IMPORT_C TSourceSink(TUid aUid, const RFile& aFile);
|
sl@0
|
265 |
|
sl@0
|
266 |
TUid iUid;
|
sl@0
|
267 |
const TDesC8& iConfigData;
|
sl@0
|
268 |
TBool iUseFileHandle;
|
sl@0
|
269 |
RFile iFileHandle;
|
sl@0
|
270 |
};
|
sl@0
|
271 |
|
sl@0
|
272 |
|
sl@0
|
273 |
|
sl@0
|
274 |
|
sl@0
|
275 |
public:
|
sl@0
|
276 |
IMPORT_C static CMMFFindAndOpenController* NewL(MMMFFindAndOpenControllerObserver& aObserver);
|
sl@0
|
277 |
virtual ~CMMFFindAndOpenController();
|
sl@0
|
278 |
|
sl@0
|
279 |
// from CActive
|
sl@0
|
280 |
virtual void DoCancel();
|
sl@0
|
281 |
virtual void RunL();
|
sl@0
|
282 |
|
sl@0
|
283 |
// from MMMFAddDataSourceSinkAsyncObserver
|
sl@0
|
284 |
virtual void MadssaoAddDataSourceSinkAsyncComplete(TInt aError, const TMMFMessageDestination& aHandle);
|
sl@0
|
285 |
|
sl@0
|
286 |
IMPORT_C void Configure(
|
sl@0
|
287 |
TUid aMediaId,
|
sl@0
|
288 |
TMMFPrioritySettings aPrioritySettings,
|
sl@0
|
289 |
CMMFPluginSelectionParameters::TMediaIdMatchType aMediaIdMatchType = CMMFPluginSelectionParameters::EAllowOnlySuppliedMediaIds);
|
sl@0
|
290 |
|
sl@0
|
291 |
IMPORT_C void ConfigureController(RMMFController& aController, CMMFControllerEventMonitor& aEventMonitor, TControllerMode aControllerMode = EPlayback);
|
sl@0
|
292 |
IMPORT_C void ConfigureSecondaryController(RMMFController& aController, CMMFControllerEventMonitor& aEventMonitor, TControllerMode aControllerMode = EPlayback);
|
sl@0
|
293 |
|
sl@0
|
294 |
IMPORT_C void UseSharedHeap();
|
sl@0
|
295 |
|
sl@0
|
296 |
IMPORT_C void ConfigureSourceSink(
|
sl@0
|
297 |
TSourceSink aSource,
|
sl@0
|
298 |
TSourceSink aSink);
|
sl@0
|
299 |
IMPORT_C void ConfigureSecondarySourceSink(
|
sl@0
|
300 |
TSourceSink aSource,
|
sl@0
|
301 |
TSourceSink aSink);
|
sl@0
|
302 |
|
sl@0
|
303 |
IMPORT_C void ConfigureSourceSink(
|
sl@0
|
304 |
const TMMSource& aSource,
|
sl@0
|
305 |
TSourceSink aSink);
|
sl@0
|
306 |
|
sl@0
|
307 |
IMPORT_C void OpenByFileSource(const TMMSource& aFileSource, const TDesC& aFileNameSecondary = KNullDesC);
|
sl@0
|
308 |
|
sl@0
|
309 |
IMPORT_C void OpenByFormatUid(TUid aFormatUid, TUid aFormatUidSecondary = KNullUid);
|
sl@0
|
310 |
IMPORT_C void OpenByDescriptor(const TDesC8& aDescriptor);
|
sl@0
|
311 |
IMPORT_C void OpenByUrl(const TDesC& aUrl, TInt aIapId, const TDesC8& aMimeType);
|
sl@0
|
312 |
IMPORT_C void OpenByControllerUid(TUid aControllerUid, TUid aSecondaryControllerUid = KNullUid);
|
sl@0
|
313 |
IMPORT_C void ReOpen();
|
sl@0
|
314 |
IMPORT_C void Close();
|
sl@0
|
315 |
|
sl@0
|
316 |
IMPORT_C static TMMFFileConfig GetConfigFile(const TDesC& aFileName);
|
sl@0
|
317 |
IMPORT_C static TMMFDescriptorConfig GetConfigDescriptor(const TDesC8& aDescriptor);
|
sl@0
|
318 |
IMPORT_C void CloseConfig();
|
sl@0
|
319 |
IMPORT_C static void GetConfigUrlL(CBufFlat*& aUrlCfgBuffer, const TDesC& aUrl, TInt aIapId);
|
sl@0
|
320 |
|
sl@0
|
321 |
/** made public to check for further selected controllers in the queue */
|
sl@0
|
322 |
inline TInt ControllerIndex() const;
|
sl@0
|
323 |
inline TInt ControllerCount() const;
|
sl@0
|
324 |
|
sl@0
|
325 |
/** made public to stop checking for further selected controllers in the queue */
|
sl@0
|
326 |
inline TBool StopTryLoadController() const;
|
sl@0
|
327 |
IMPORT_C void SetInitScreenNumber(TInt aScreenNumber, RMMFVideoSetInitScreenCustomCommands* aVideoSetInitScreenCustomCommands);
|
sl@0
|
328 |
#ifdef SYMBIAN_BUILD_GCE
|
sl@0
|
329 |
inline void SetSurfaceMode(TBool aUseSurface, RMMFVideoPlaySurfaceSupportCustomCommands* aVideoPlaySurfaceSupportCustomCommands);
|
sl@0
|
330 |
inline TInt SurfaceSupported();
|
sl@0
|
331 |
#endif
|
sl@0
|
332 |
|
sl@0
|
333 |
private:
|
sl@0
|
334 |
class CConfig: public CBase
|
sl@0
|
335 |
{
|
sl@0
|
336 |
public:
|
sl@0
|
337 |
CConfig();
|
sl@0
|
338 |
~CConfig();
|
sl@0
|
339 |
void Close();
|
sl@0
|
340 |
public:
|
sl@0
|
341 |
RMMFController* iController; // not owned
|
sl@0
|
342 |
CMMFControllerEventMonitor* iEventMonitor; // not owned
|
sl@0
|
343 |
|
sl@0
|
344 |
/** indicates whether this controller is being used for
|
sl@0
|
345 |
playback, recording or converting */
|
sl@0
|
346 |
TControllerMode iControllerMode;
|
sl@0
|
347 |
|
sl@0
|
348 |
CMMSourceSink* iSource;
|
sl@0
|
349 |
CMMSourceSink* iSink;
|
sl@0
|
350 |
TUid iControllerUid;
|
sl@0
|
351 |
};
|
sl@0
|
352 |
|
sl@0
|
353 |
CMMFFindAndOpenController(MMMFFindAndOpenControllerObserver& aObserver);
|
sl@0
|
354 |
void ConstructL();
|
sl@0
|
355 |
|
sl@0
|
356 |
void Init();
|
sl@0
|
357 |
|
sl@0
|
358 |
void ConfigureSourceSink(
|
sl@0
|
359 |
CConfig& config,
|
sl@0
|
360 |
TSourceSink aSource,
|
sl@0
|
361 |
TSourceSink aSink);
|
sl@0
|
362 |
|
sl@0
|
363 |
void ConfigureSourceSink(
|
sl@0
|
364 |
CConfig& config,
|
sl@0
|
365 |
const TMMSource& aSource,
|
sl@0
|
366 |
TSourceSink aSink);
|
sl@0
|
367 |
|
sl@0
|
368 |
|
sl@0
|
369 |
void ConfigureController(
|
sl@0
|
370 |
CConfig& config,
|
sl@0
|
371 |
RMMFController& aController,
|
sl@0
|
372 |
CMMFControllerEventMonitor& aEventMonitor,
|
sl@0
|
373 |
TControllerMode aControllerMode);
|
sl@0
|
374 |
|
sl@0
|
375 |
void CloseController();
|
sl@0
|
376 |
|
sl@0
|
377 |
void OpenPrimaryController(void);
|
sl@0
|
378 |
|
sl@0
|
379 |
void KickState();
|
sl@0
|
380 |
void Process();
|
sl@0
|
381 |
void SendError(TInt aError = KErrNone, TBool aForcedError = EFalse);
|
sl@0
|
382 |
void SchedSendError(TInt aError = KErrNone);
|
sl@0
|
383 |
void BuildControllerListFileNameL();
|
sl@0
|
384 |
void BuildControllerListDescriptorL();
|
sl@0
|
385 |
void BuildControllerListUrlL();
|
sl@0
|
386 |
void BuildControllerListFormatL();
|
sl@0
|
387 |
void TryNextController();
|
sl@0
|
388 |
|
sl@0
|
389 |
CMMSourceSink* CreateSourceSinkL(const TSourceSink& aParams);
|
sl@0
|
390 |
CMMSourceSink* CreateSourceSinkL(const TMMSource& aSource);
|
sl@0
|
391 |
|
sl@0
|
392 |
CMMFUtilityFileInfo* CreateFileInfoL(TBool aSecureDRMMode = EFalse);
|
sl@0
|
393 |
void UseSecureDRMProcessL(TBool& aIsSecureDrmProcess);
|
sl@0
|
394 |
private:
|
sl@0
|
395 |
/** primary controller details */
|
sl@0
|
396 |
CConfig* iPrimaryConfig;
|
sl@0
|
397 |
/** secondary controller details */
|
sl@0
|
398 |
CConfig* iSecondaryConfig;
|
sl@0
|
399 |
/** points to either iPrimaryConfig or iSecondaryConfig */
|
sl@0
|
400 |
CConfig* iCurrentConfig; // not owned
|
sl@0
|
401 |
|
sl@0
|
402 |
enum TMode
|
sl@0
|
403 |
{
|
sl@0
|
404 |
EOpenByControllerUid,
|
sl@0
|
405 |
EOpenByFileName,
|
sl@0
|
406 |
EOpenByDescriptor,
|
sl@0
|
407 |
EOpenByUrl,
|
sl@0
|
408 |
EOpenByFormatUid
|
sl@0
|
409 |
};
|
sl@0
|
410 |
TMode iMode;
|
sl@0
|
411 |
|
sl@0
|
412 |
/** indicates what state the state machine is in */
|
sl@0
|
413 |
enum TState
|
sl@0
|
414 |
{
|
sl@0
|
415 |
EIdle,
|
sl@0
|
416 |
EBuildControllerList,
|
sl@0
|
417 |
EOpenController,
|
sl@0
|
418 |
EAddSource,
|
sl@0
|
419 |
EAddSink,
|
sl@0
|
420 |
EWaitingForSource,
|
sl@0
|
421 |
EWaitingForSink,
|
sl@0
|
422 |
ESendError
|
sl@0
|
423 |
};
|
sl@0
|
424 |
TState iState;
|
sl@0
|
425 |
|
sl@0
|
426 |
MMMFFindAndOpenControllerObserver& iObserver;
|
sl@0
|
427 |
CMMFAddDataSourceSinkAsync* iAddDataSourceSinkAsync;
|
sl@0
|
428 |
|
sl@0
|
429 |
TInt iControllerIndex;
|
sl@0
|
430 |
TInt iControllerCount;
|
sl@0
|
431 |
|
sl@0
|
432 |
TFileName iFileNameSecondary; // for converting
|
sl@0
|
433 |
|
sl@0
|
434 |
TFileName iFileName;
|
sl@0
|
435 |
TBool iUseFileHandle;
|
sl@0
|
436 |
TBool iOwnFileHandle;
|
sl@0
|
437 |
HBufC* iUniqueId;
|
sl@0
|
438 |
RFile iFileHandle;
|
sl@0
|
439 |
ContentAccess::TIntent iIntent;
|
sl@0
|
440 |
|
sl@0
|
441 |
HBufC* iUrl;
|
sl@0
|
442 |
HBufC8* iMimeType;
|
sl@0
|
443 |
TPtr8 iDescriptor;
|
sl@0
|
444 |
TInt iIapId;
|
sl@0
|
445 |
TUid iFormatUid;
|
sl@0
|
446 |
TUid iFormatUidSecondary; // for converting
|
sl@0
|
447 |
|
sl@0
|
448 |
TUid iMediaId;
|
sl@0
|
449 |
TMMFPrioritySettings iPrioritySettings;
|
sl@0
|
450 |
CMMFPluginSelectionParameters::TMediaIdMatchType iMediaIdMatchType;
|
sl@0
|
451 |
|
sl@0
|
452 |
RMMFControllerImplInfoArray iControllers;
|
sl@0
|
453 |
RMMFControllerImplInfoArray iPrioritisedControllers;
|
sl@0
|
454 |
|
sl@0
|
455 |
// if this is non-null, then it points to an element in
|
sl@0
|
456 |
// either iControllers or iPrioritisedControllers
|
sl@0
|
457 |
CMMFControllerImplementationInformation* iControllerImplInfo; // not owned
|
sl@0
|
458 |
|
sl@0
|
459 |
TControllerMode iControllerMode;
|
sl@0
|
460 |
TBool iSourceSinkConfigured;
|
sl@0
|
461 |
TInt iError;
|
sl@0
|
462 |
|
sl@0
|
463 |
TMMFMessageDestination iSourceHandle;
|
sl@0
|
464 |
TMMFMessageDestination iSinkHandle;
|
sl@0
|
465 |
TBool iEnableUi;
|
sl@0
|
466 |
|
sl@0
|
467 |
TBool iUseSharedHeap; // should new controllers use shared heaps?
|
sl@0
|
468 |
TBool iStopTryLoadController; //stop to try loading the selected conrollers from the list
|
sl@0
|
469 |
RMMFVideoSetInitScreenCustomCommands* iVideoSetInitScreenCustomCommands;
|
sl@0
|
470 |
TInt iScreenNumber;
|
sl@0
|
471 |
TBool iHasDrmCapability;
|
sl@0
|
472 |
TBool iUsingSecureDrmProcess;
|
sl@0
|
473 |
|
sl@0
|
474 |
#ifdef SYMBIAN_BUILD_GCE
|
sl@0
|
475 |
RMMFVideoPlaySurfaceSupportCustomCommands* iVideoPlaySurfaceSupportCustomCommands;
|
sl@0
|
476 |
TBool iUseVPU2;
|
sl@0
|
477 |
TInt iSurfaceSupported;
|
sl@0
|
478 |
#endif
|
sl@0
|
479 |
};
|
sl@0
|
480 |
|
sl@0
|
481 |
inline TInt CMMFFindAndOpenController::ControllerIndex() const
|
sl@0
|
482 |
{
|
sl@0
|
483 |
return iControllerIndex;
|
sl@0
|
484 |
}
|
sl@0
|
485 |
|
sl@0
|
486 |
inline TInt CMMFFindAndOpenController::ControllerCount() const
|
sl@0
|
487 |
{
|
sl@0
|
488 |
return iControllerCount;
|
sl@0
|
489 |
}
|
sl@0
|
490 |
|
sl@0
|
491 |
inline TBool CMMFFindAndOpenController::StopTryLoadController() const
|
sl@0
|
492 |
{
|
sl@0
|
493 |
return iStopTryLoadController;
|
sl@0
|
494 |
}
|
sl@0
|
495 |
|
sl@0
|
496 |
#ifdef SYMBIAN_BUILD_GCE
|
sl@0
|
497 |
inline void CMMFFindAndOpenController::SetSurfaceMode(TBool aUseVPU2, RMMFVideoPlaySurfaceSupportCustomCommands* aVideoPlaySurfaceSupportCustomCommands)
|
sl@0
|
498 |
{
|
sl@0
|
499 |
iUseVPU2 = aUseVPU2;
|
sl@0
|
500 |
iSurfaceSupported = KErrNone;
|
sl@0
|
501 |
iVideoPlaySurfaceSupportCustomCommands = aVideoPlaySurfaceSupportCustomCommands;
|
sl@0
|
502 |
}
|
sl@0
|
503 |
|
sl@0
|
504 |
inline TInt CMMFFindAndOpenController::SurfaceSupported()
|
sl@0
|
505 |
{
|
sl@0
|
506 |
return iSurfaceSupported;
|
sl@0
|
507 |
}
|
sl@0
|
508 |
#endif // SYMBIAN_BUILD_GCE
|
sl@0
|
509 |
|
sl@0
|
510 |
#endif // __MMF_CLIENT_UTILITY_H__
|