|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef EAACPLUSDECODERCI_H |
|
17 #define EAACPLUSDECODERCI_H |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <mmf/common/mmfipc.h> |
|
21 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
22 #include <mmf/common/mmfipcserver.h> |
|
23 #endif |
|
24 #include <mmf/server/mmfdevsoundcustominterface.h> |
|
25 #include <mmf/server/mmfdevsoundcustomcommands.h> |
|
26 #include <mmf/server/devsoundstandardcustominterfaces.h> |
|
27 #include <mmf/plugin/mmfdevsoundcustominterface.hrh> |
|
28 |
|
29 /** |
|
30 Enum to represent the methods called by this custom interface |
|
31 @internalComponent |
|
32 @prototype |
|
33 @file |
|
34 */ |
|
35 enum TMMFDevSoundCIEAacPlusDecoderCommands |
|
36 { |
|
37 EMMFDevSoundCIEAacPlusDecoderSetInputSamplingFrequency = 0, |
|
38 EMMFDevSoundCIEAacPlusDecoderSetAudioObjectType, |
|
39 EMMFDevSoundCIEAacPlusDecoderSetNumOfChannels, |
|
40 EMMFDevSoundCIEAacPlusDecoderSetSbr, |
|
41 EMMFDevSoundCIEAacPlusDecoderSetDownSampledMode, |
|
42 EMMFDevSoundCIEAacPlusDecoderApplyConfig, |
|
43 EMMFDevSoundCIEAacPlusDecoderGetInputSamplingFrequency, |
|
44 EMMFDevSoundCIEAacPlusDecoderGetAudioObjectType, |
|
45 EMMFDevSoundCIEAacPlusDecoderGetNumOfChannels, |
|
46 EMMFDevSoundCIEAacPlusDecoderGetSbr, |
|
47 EMMFDevSoundCIEAacPlusDecoderGetDownSampledMode |
|
48 }; |
|
49 |
|
50 |
|
51 /** |
|
52 CMMFEAacPlusDecoderMux - implementation of the EAAC+ Decoder custom interface pair |
|
53 @internalComponent |
|
54 @prototype |
|
55 @file |
|
56 */ |
|
57 class CMMFEAacPlusDecoderMux : public CBase, |
|
58 public MMMFDevSoundCustomInterfaceMuxPlugin, |
|
59 public MEAacPlusDecoderIntfc |
|
60 { |
|
61 public: |
|
62 |
|
63 // from MMMFDevSoundCustomInterfaceMuxPlugin |
|
64 /** |
|
65 Attempt to open the interface. |
|
66 @param aInterfaceId |
|
67 The UID of the interface to open. |
|
68 @return One of the system wide error codes |
|
69 */ |
|
70 virtual TInt OpenInterface(TUid aInterfaceId); |
|
71 |
|
72 /** |
|
73 Equivalent to destructor. Called to destroy plugin. |
|
74 */ |
|
75 virtual void Release(); |
|
76 |
|
77 /** |
|
78 Pass destructor key. |
|
79 Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation() |
|
80 @param aDestructorKey |
|
81 The Uid returned by REComSession::CreateImplementationL() or similar |
|
82 */ |
|
83 virtual void PassDestructorKey(TUid aDestructorKey); |
|
84 |
|
85 /** |
|
86 Complete construction. |
|
87 Pass additional values from the construction phase, used subsequently by the plugin. |
|
88 @param aCustomUtility |
|
89 The custom interface utility used by the plugin to communicate with the remote |
|
90 server side DeMux plugin |
|
91 @leave This method may leave with one of the system-wide error codes. |
|
92 */ |
|
93 virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceMuxUtility* aCustomUtility); |
|
94 |
|
95 /** |
|
96 Return the custom interface |
|
97 @param aInterfaceId |
|
98 The UID of the required custom interface |
|
99 @return The custom interface supported by this plugin |
|
100 */ |
|
101 virtual TAny* CustomInterface(TUid aInterfaceId); |
|
102 |
|
103 /** |
|
104 Instantiate a CI Mux class |
|
105 @leave This method may leave with one of the system-wide error codes. |
|
106 @return The pointer to the new class, cast to the Mux plugin mixin |
|
107 */ |
|
108 static MMMFDevSoundCustomInterfaceMuxPlugin* NewL(); |
|
109 |
|
110 // from MEAacPlusDecoderIntfc |
|
111 /** |
|
112 @see MEAacPlusDecoderIntfc |
|
113 */ |
|
114 virtual void SetInputSamplingFrequency(TUint aInputSamplingFrequency); |
|
115 |
|
116 /** |
|
117 @see MEAacPlusDecoderIntfc |
|
118 */ |
|
119 virtual void SetAudioObjectType(MEAacPlusDecoderIntfc::TAudioObjectType aAudioObjectType); |
|
120 |
|
121 /** |
|
122 @see MEAacPlusDecoderIntfc |
|
123 */ |
|
124 virtual void SetNumOfChannels(TUint aNumOfChannels); |
|
125 |
|
126 /** |
|
127 @see MEAacPlusDecoderIntfc |
|
128 */ |
|
129 virtual void SetSbr(TBool aSbrEnabled); |
|
130 |
|
131 /** |
|
132 @see MEAacPlusDecoderIntfc |
|
133 */ |
|
134 virtual void SetDownSampledMode(TBool aDsmEnabled); |
|
135 |
|
136 /** |
|
137 @see MEAacPlusDecoderIntfc |
|
138 */ |
|
139 virtual TInt ApplyConfig(); |
|
140 |
|
141 /** |
|
142 @see MEAacPlusDecoderIntfc |
|
143 */ |
|
144 virtual TInt GetInputSamplingFrequency ( TUint& aInputSamplingFrequency ); |
|
145 |
|
146 /** |
|
147 @see MEAacPlusDecoderIntfc |
|
148 */ |
|
149 virtual TInt GetAudioObjectType(MEAacPlusDecoderIntfc::TAudioObjectType& aAudioObjectType); |
|
150 |
|
151 /** |
|
152 @see MEAacPlusDecoderIntfc |
|
153 */ |
|
154 virtual TInt GetNumOfChannels ( TUint& aNumOfChannels ); |
|
155 |
|
156 /** |
|
157 @see MEAacPlusDecoderIntfc |
|
158 */ |
|
159 virtual TInt GetSbr (TBool& aSbrEnabled); |
|
160 |
|
161 /** |
|
162 @see MEAacPlusDecoderIntfc |
|
163 */ |
|
164 virtual TInt GetDownSampledMode (TBool& aDsmEnabled); |
|
165 |
|
166 protected: |
|
167 CMMFEAacPlusDecoderMux(); |
|
168 ~CMMFEAacPlusDecoderMux(); |
|
169 |
|
170 protected: |
|
171 TUid iDestructorKey; |
|
172 TInt iRemoteHandle; |
|
173 MMMFDevSoundCustomInterfaceMuxUtility* iUtility; |
|
174 }; |
|
175 |
|
176 /** |
|
177 CMMFEAacPlusDecoderDeMux - DeMux side of pair |
|
178 @internalComponent |
|
179 @prototype |
|
180 @file |
|
181 */ |
|
182 class CMMFEAacPlusDecoderDeMux : public CBase, public MMMFDevSoundCustomInterfaceDeMuxPlugin |
|
183 { |
|
184 public: |
|
185 /** |
|
186 Instantiate a CMMFEAacPlusDecoderDeMux class |
|
187 @leave This method may leave with one of the system-wide error codes. |
|
188 @return A pointer to the new class cast to the DeMux plugin mixin |
|
189 */ |
|
190 static MMMFDevSoundCustomInterfaceDeMuxPlugin* NewL(); |
|
191 |
|
192 /** |
|
193 Attempt to open the interface. |
|
194 @param aInterfaceId |
|
195 The UID of the interface to open. |
|
196 @return A handle to the remote plugin |
|
197 */ |
|
198 virtual TInt OpenInterface(TUid aInterfaceId); |
|
199 |
|
200 /** |
|
201 Equivalent to destructor. Called to destroy plugin. |
|
202 */ |
|
203 virtual void Release(); |
|
204 /** |
|
205 Pass destructor key. |
|
206 Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation() |
|
207 @param aDestructorKey |
|
208 The Uid returned by REComSession::CreateImplementationL() or similar |
|
209 */ |
|
210 virtual void PassDestructorKey(TUid aDestructorKey); |
|
211 |
|
212 /** |
|
213 Set the target of the custom interface call |
|
214 @param aTarget |
|
215 The DevSound to call the custom interface on. |
|
216 */ |
|
217 virtual void SetInterfaceTarget(MMMFDevSoundCustomInterfaceTarget* aTarget); |
|
218 |
|
219 /** |
|
220 Complete construction. |
|
221 @param aUtility |
|
222 The DeMux utility to use |
|
223 @leave This method may leave with one of the system-wide error codes. |
|
224 */ |
|
225 virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceDeMuxUtility* aUtility); |
|
226 |
|
227 /** |
|
228 Refresh the current custom interface connections |
|
229 @leave This method may leave with one of the system-wide error codes. |
|
230 */ |
|
231 virtual void RefreshL(); |
|
232 |
|
233 // from MMMFDevSoundCustomInterfaceDeMuxPlugin |
|
234 /** |
|
235 Open the slave |
|
236 @param aInterface |
|
237 The UID of the requested interface |
|
238 @param aPackageBuf |
|
239 A package of data that can be supplied for initialisation |
|
240 @leave This method may leave with one of the system-wide error codes. |
|
241 @return The result of the operation |
|
242 */ |
|
243 virtual TInt DoOpenSlaveL(TUid aInterface, const TDesC8& aPackageBuf); |
|
244 |
|
245 /** |
|
246 Close the slave |
|
247 @param aHandle |
|
248 The handle of the slave plugin |
|
249 @leave This method may leave with one of the system-wide error codes. |
|
250 */ |
|
251 virtual void DoCloseSlaveL(TInt aHandle); |
|
252 |
|
253 // original RMessage is supplied so that remote demux plugin can extract necessary details |
|
254 // using DeMux utility |
|
255 |
|
256 /** |
|
257 Relay the synchronous custom command onto the slave |
|
258 @param aMessage |
|
259 The IPC message to be sent to the slave |
|
260 @leave This method may leave with one of the system-wide error codes. |
|
261 @return The result of the operation |
|
262 */ |
|
263 virtual TInt DoSendSlaveSyncCommandL(const RMmfIpcMessage& aMessage); |
|
264 |
|
265 /** |
|
266 Relay the synchronous custom command onto the slave and obtain a result |
|
267 @param aMessage |
|
268 The IPC message to be sent to the slave |
|
269 @leave This method may leave with one of the system-wide error codes. |
|
270 @return The result of the operation |
|
271 */ |
|
272 virtual TInt DoSendSlaveSyncCommandResultL(const RMmfIpcMessage& aMessage); |
|
273 |
|
274 /** |
|
275 Relay an asynchronous command onto the slave |
|
276 @param aMessage |
|
277 The IPC message to be sent to the slave |
|
278 @leave This method may leave with one of the system-wide error codes. |
|
279 */ |
|
280 virtual void DoSendSlaveAsyncCommandL(const RMmfIpcMessage& aMessage); |
|
281 |
|
282 /** |
|
283 Relay an asynchronous command onto the slave and obtain a result |
|
284 @param aMessage |
|
285 The IPC message to be sent to the slave@param aMessage |
|
286 @leave This method may leave with one of the system-wide error codes. |
|
287 */ |
|
288 virtual void DoSendSlaveAsyncCommandResultL(const RMmfIpcMessage& aMessage); |
|
289 |
|
290 protected: |
|
291 ~CMMFEAacPlusDecoderDeMux(); |
|
292 CMMFEAacPlusDecoderDeMux(); |
|
293 |
|
294 // mirrors MEAacPlusDecoderIntfc methods. |
|
295 void DoSetInputSamplingFrequency(TUint aInputSamplingFrequency); |
|
296 void DoSetAudioObjectType(MEAacPlusDecoderIntfc::TAudioObjectType aAudioObjectType); |
|
297 void DoSetNumOfChannels(TUint aNumOfChannels); |
|
298 void DoSetSbr(TBool aSbrEnabled); |
|
299 void DoSetDownSampledMode(TBool aDsmEnabled); |
|
300 TInt DoApplyConfig(); |
|
301 TInt DoGetInputSamplingFrequency(TUint& aInputSamplingFrequency); |
|
302 TInt DoGetAudioObjectType(MEAacPlusDecoderIntfc::TAudioObjectType& aAudioObjectType); |
|
303 TInt DoGetNumOfChannels(TUint& aNumOfChannels); |
|
304 TInt DoGetSbr(TBool& aSbrEnabled); |
|
305 TInt DoGetDownSampledMode(TBool& aDsmEnabled); |
|
306 |
|
307 protected: |
|
308 MMMFDevSoundCustomInterfaceDeMuxUtility* iUtility; |
|
309 MMMFDevSoundCustomInterfaceTarget* iTarget; |
|
310 TUid iDestructorKey; |
|
311 MEAacPlusDecoderIntfc* iInterfaceEAacPlusDecoder; |
|
312 }; |
|
313 |
|
314 #endif |