|
1 /* |
|
2 * Copyright (c) 2004 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: Class definition for the SourceAdapter functions. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CDATASOURCEADAPTER_H |
|
21 #define CDATASOURCEADAPTER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <mmfbuffer.h> |
|
25 #include <mmfutilities.h> |
|
26 #include <e32base.h> |
|
27 #include <mmfbase.h> |
|
28 #include <caf/manager.h> |
|
29 |
|
30 // CONSTANTS |
|
31 const TUid KS60AudioStreamingSourceUid = {0x10207AF3}; |
|
32 const TUid KMmdsProgDLSourceUid = {0x10207B46}; |
|
33 const TUid KMmdsStreamingSourceUid = {0x10207B7B}; |
|
34 const TUid KOldProgDLSourceUid = {0x10207A7C}; |
|
35 const TUid KMmdsFileSourceUid = {0x10207B89}; |
|
36 const TUid KMmdsDescriptorSourceUid = {0x10207B8B}; |
|
37 |
|
38 const TInt KErrSourceAdapter = -1001; |
|
39 |
|
40 // FORWARD DECLARATIONS |
|
41 class CMMFClip; |
|
42 class CMMFDataBuffer; |
|
43 class MDataSink; |
|
44 class MDataSource; |
|
45 class MAsyncEventHandler; |
|
46 class CConfigurationComponentsFactory; |
|
47 class CAudioOutputControlUtility; |
|
48 class CDRMConfigIntfc; |
|
49 class CMMFDevSound; |
|
50 class CMMFBuffer; |
|
51 class MMultimediaDataSourceObserver; |
|
52 class CMultimediaDataSource; |
|
53 class CAudioOutputControlUtility; |
|
54 // CLASS DEFINITIONS |
|
55 |
|
56 /** |
|
57 * This class provides CDataSourceAdapter functions. |
|
58 * |
|
59 * @lib CDataSourceAdapter.lib |
|
60 * @since 3.2 |
|
61 */ |
|
62 class CDataSourceAdapter : public CBase |
|
63 { |
|
64 public: // Constructors and destructor |
|
65 |
|
66 /** |
|
67 * Two-phased constructor. |
|
68 */ |
|
69 IMPORT_C static CDataSourceAdapter* NewL(); |
|
70 |
|
71 /** |
|
72 * Destructor. |
|
73 */ |
|
74 IMPORT_C virtual ~CDataSourceAdapter(); |
|
75 |
|
76 // New (like MDataSource) |
|
77 IMPORT_C virtual TUid DataSourceType(); |
|
78 IMPORT_C virtual void FillBufferL(CMMFBuffer* aBuffer, MDataSink* aConsumer, TMediaId aMediaId); |
|
79 IMPORT_C virtual void BufferEmptiedL(CMMFBuffer* aBuffer); |
|
80 IMPORT_C virtual TBool CanCreateSourceBuffer(); |
|
81 IMPORT_C virtual CMMFBuffer* CreateSourceBufferL(TMediaId aMediaId, TBool &aReference); |
|
82 IMPORT_C virtual TInt SourceThreadLogon(MAsyncEventHandler& aEventHandler); |
|
83 IMPORT_C virtual void SourceThreadLogoff(); |
|
84 IMPORT_C virtual void SourcePrimeL(); |
|
85 IMPORT_C virtual void SourceStopL(); |
|
86 IMPORT_C virtual void SourcePlayL(); |
|
87 IMPORT_C virtual void Event(TUid aEvent); |
|
88 |
|
89 // New |
|
90 IMPORT_C virtual TInt SeekToPosition(TUint aPosition); |
|
91 IMPORT_C virtual TInt SeekToTime(TUint aTimeMs); |
|
92 IMPORT_C virtual TInt SeekToTime(TUint aTimeMs, TUint& aFoundTimeMs); |
|
93 IMPORT_C virtual TBool IsTimeSeekable(); |
|
94 IMPORT_C virtual TBool IsPositonSeekable(); |
|
95 IMPORT_C virtual void SetDataSourceL(MDataSource* aDataSource, |
|
96 MMultimediaDataSourceObserver* aMMultimediaDataSourceObserver, |
|
97 MAsyncEventHandler* aMAsyncEventHandler); |
|
98 IMPORT_C virtual TInt SourceSize(); |
|
99 IMPORT_C virtual TInt IsProtectedL(); |
|
100 IMPORT_C virtual void SetSourcePrioritySettings(const TMMFPrioritySettings& aPrioritySettings); |
|
101 IMPORT_C virtual TInt ExecuteIntent(ContentAccess::TIntent aIntent); |
|
102 IMPORT_C virtual TInt SetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue); |
|
103 IMPORT_C virtual TInt EvaluateIntent(ContentAccess::TIntent aIntent); |
|
104 IMPORT_C virtual TInt GetInterface(TUid aInterfaceId, TVersion& aVer, TAny*& aInterfaceImpl); |
|
105 IMPORT_C virtual TBool OnlyHeaderPresent(); |
|
106 |
|
107 //sets the AudioOutputControlUtitlity reference and sets Datasource to AudioOutputContolUtility |
|
108 IMPORT_C TInt SetAudioOutputControlUtil(CAudioOutputControlUtility* aAudioOutputControlUtility); |
|
109 protected: |
|
110 |
|
111 /** |
|
112 * C++ default constructor. |
|
113 */ |
|
114 IMPORT_C CDataSourceAdapter(); |
|
115 |
|
116 private: |
|
117 |
|
118 /** |
|
119 * By default Symbian 2nd phase constructor is private. |
|
120 */ |
|
121 void ConstructL(); |
|
122 |
|
123 protected: |
|
124 class CAsyncProxyFillBuffer : public CActive |
|
125 { |
|
126 public: // may want to export constructor and fillbuffer for 3gpdatasourceadapter |
|
127 CAsyncProxyFillBuffer(MDataSource* aDataSource); |
|
128 ~CAsyncProxyFillBuffer(); |
|
129 void FillBuffer(CMMFBuffer* aBuffer, MDataSink* aConsumer, TMediaId aMediaId); |
|
130 void Reset(); |
|
131 |
|
132 protected: |
|
133 void RunL(); |
|
134 TInt RunError(TInt aError); |
|
135 void DoCancel(); |
|
136 |
|
137 private: |
|
138 TRequestStatus* iRequestStatus; |
|
139 MDataSource* iDataSource; |
|
140 CMMFBuffer* iBuffer; |
|
141 MDataSink* iConsumer; |
|
142 TMediaId iMediaId; |
|
143 RPointerArray<CMMFBuffer> iQueuedAsyncBuffers; |
|
144 TInt iReadPos; |
|
145 }; |
|
146 |
|
147 protected: // Data |
|
148 |
|
149 TUid iSourceType; |
|
150 MDataSource* iDataSource; |
|
151 CMultimediaDataSource* iMMDataSource; |
|
152 MAsyncEventHandler* iAsyncEventHandler; |
|
153 TInt iSourceSize; |
|
154 TBool iPosSeekable; |
|
155 TBool iTimeSeekable; |
|
156 TBool iIsProtected; |
|
157 CMMFDataBuffer* iZeroBuffer; |
|
158 CMMFDataBuffer* iHdrBuffer; |
|
159 CMMFClip* iClip; |
|
160 CAsyncProxyFillBuffer* iAsyncProxyFillBuffer; |
|
161 TBool iHeaderOnly; |
|
162 CAudioOutputControlUtility* iAudioOutputControlUtility; |
|
163 }; |
|
164 |
|
165 #endif // CDATASOURCEADAPTER_H |
|
166 |
|
167 // End of File |