|
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 // Implementation of g711 decoder config custom interface pair |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef G711DECODERCONFIGCI_H |
|
19 #define G711DECODERCONFIGCI_H |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <mmf/common/mmfipc.h> |
|
23 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
24 #include <mmf/common/mmfipcserver.h> |
|
25 #endif |
|
26 #include <mmf/server/mmfdevsoundcustominterface.h> |
|
27 #include <mmf/server/mmfdevsoundcustomcommands.h> |
|
28 #include <mmf/server/devsoundstandardcustominterfaces.h> |
|
29 #include <mmf/plugin/mmfdevsoundcustominterface.hrh> |
|
30 |
|
31 /** |
|
32 Enum to represent the method called by this custom interface |
|
33 @internalComponent |
|
34 @prototype |
|
35 @file |
|
36 */ |
|
37 enum TMMFDevSoundCIG711DecoderIntfcCommands |
|
38 { |
|
39 EMMFDevSoundCIG711DecoderIntfcSetDecoderMode, |
|
40 EMMFDevSoundCIG711DecoderIntfcGetDecoderMode, |
|
41 EMMFDevSoundCIG711DecoderIntfcSetComfortNoiseGeneration, |
|
42 EMMFDevSoundCIG711DecoderIntfcGetComfortNoiseGeneration, |
|
43 EMMFDevSoundCIG711DecoderIntfcSetPacketLossConcealment, |
|
44 EMMFDevSoundCIG711DecoderIntfcGetPacketLossConcealment |
|
45 }; |
|
46 |
|
47 |
|
48 /** |
|
49 Implementation of the g711 decoder config custom interface Mux |
|
50 @internalComponent |
|
51 @prototype |
|
52 @file |
|
53 */ |
|
54 class CMMFG711DecoderIntfcMux : public CBase, |
|
55 public MMMFDevSoundCustomInterfaceMuxPlugin, |
|
56 public MG711DecoderIntfc |
|
57 { |
|
58 public: |
|
59 |
|
60 // from MMMFDevSoundCustomInterfaceMuxPlugin |
|
61 /** |
|
62 Attempt to open the interface. |
|
63 @param aInterfaceId |
|
64 The UID of the interface to open. |
|
65 @return One of the system wide error codes |
|
66 */ |
|
67 virtual TInt OpenInterface(TUid aInterfaceId); |
|
68 |
|
69 /** |
|
70 Equivalent to destructor. Called to destroy plugin. |
|
71 */ |
|
72 virtual void Release(); |
|
73 |
|
74 /** |
|
75 Pass destructor key. |
|
76 Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation() |
|
77 @param aDestructorKey |
|
78 The Uid returned by REComSession::CreateImplementationL() or similar |
|
79 */ |
|
80 virtual void PassDestructorKey(TUid aDestructorKey); |
|
81 |
|
82 /** |
|
83 Complete construction. |
|
84 Pass additional values from the construction phase, used subsequently by the plugin. |
|
85 @param aCustomUtility |
|
86 The custom interface utility used by the plugin to communicate with the remote |
|
87 server side DeMux plugin |
|
88 @leave This method may leave with one of the system-wide error codes. |
|
89 */ |
|
90 virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceMuxUtility* aCustomUtility); |
|
91 |
|
92 /** |
|
93 Return the custom interface |
|
94 @param aInterfaceId |
|
95 The UID of the required custom interface |
|
96 @return The custom interface supported by this plugin |
|
97 */ |
|
98 virtual TAny* CustomInterface(TUid aInterfaceId); |
|
99 |
|
100 /** |
|
101 Instantiate a CI Mux class |
|
102 @return The pointer to the new class, cast to the Mux plugin mixin |
|
103 @leave This method may leave with one of the system-wide error codes. |
|
104 */ |
|
105 static MMMFDevSoundCustomInterfaceMuxPlugin* NewL(); |
|
106 |
|
107 // from MG711DecoderIntfc |
|
108 //@see MG711DecoderIntfc |
|
109 virtual TInt SetDecoderMode(TDecodeMode aDecodeMode); |
|
110 //@see MG711DecoderIntfc |
|
111 virtual TInt GetDecoderMode(TDecodeMode& aDecodeMode); |
|
112 //@see MG711DecoderIntfc |
|
113 virtual TInt SetComfortNoiseGeneration(TBool aCng); |
|
114 //@see MG711DecoderIntfc |
|
115 virtual TInt GetComfortNoiseGeneration(TBool& aCng); |
|
116 //@see MG711DecoderIntfc |
|
117 virtual TInt SetPacketLossConcealment(TBool aPlc); |
|
118 //@see MG711DecoderIntfc |
|
119 virtual TInt GetPacketLossConcealment(TBool& aPlc); |
|
120 |
|
121 protected: |
|
122 CMMFG711DecoderIntfcMux(); |
|
123 ~CMMFG711DecoderIntfcMux(); |
|
124 |
|
125 protected: |
|
126 TUid iKey; |
|
127 TInt iRemoteHandle; |
|
128 MMMFDevSoundCustomInterfaceMuxUtility* iUtility; |
|
129 }; |
|
130 |
|
131 |
|
132 /** |
|
133 Implementation of the G711 Decoder config custom interface DeMux |
|
134 @internalComponent |
|
135 @prototype |
|
136 @file |
|
137 */ |
|
138 class CMMFG711DecoderIntfcDeMux : public CBase, |
|
139 public MMMFDevSoundCustomInterfaceDeMuxPlugin |
|
140 { |
|
141 public: |
|
142 /** |
|
143 Instantiate a CMMFG711DecoderIntfcDeMux class |
|
144 @return A pointer to the new class cast to the DeMux plugin mixin |
|
145 @leave This method may leave with one of the system-wide error codes. |
|
146 */ |
|
147 static MMMFDevSoundCustomInterfaceDeMuxPlugin* NewL(); |
|
148 |
|
149 /** |
|
150 Attempt to open the interface. |
|
151 @param aInterfaceId |
|
152 The UID of the interface to open. |
|
153 @return A handle to the remote plugin |
|
154 */ |
|
155 virtual TInt OpenInterface(TUid aInterfaceId); |
|
156 |
|
157 /** |
|
158 Equivalent to destructor. Called to destroy plugin. |
|
159 */ |
|
160 virtual void Release(); |
|
161 |
|
162 /** |
|
163 Pass destructor key. |
|
164 Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation() |
|
165 @param aDestructorKey |
|
166 The Uid returned by REComSession::CreateImplementationL() or similar |
|
167 */ |
|
168 virtual void PassDestructorKey(TUid aDestructorKey); |
|
169 |
|
170 /** |
|
171 Set the target of the custom interface call |
|
172 @param aTarget |
|
173 The DevSound to call the custom interface on. |
|
174 */ |
|
175 virtual void SetInterfaceTarget(MMMFDevSoundCustomInterfaceTarget* aTarget); |
|
176 |
|
177 /** |
|
178 Complete construction. |
|
179 @param aUtility |
|
180 The DeMux utility to use |
|
181 @leave This method may leave with one of the system-wide error codes. |
|
182 */ |
|
183 virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceDeMuxUtility* aUtility); |
|
184 |
|
185 /** |
|
186 Refresh the current custom interface connections |
|
187 @leave This method may leave with one of the system-wide error codes. |
|
188 */ |
|
189 virtual void RefreshL(); |
|
190 |
|
191 // from MMMFDevSoundCustomInterfaceDeMuxPlugin |
|
192 /** |
|
193 Open the slave |
|
194 @param aInterface |
|
195 The UID of the requested interface |
|
196 @param aPackageBuf |
|
197 A package of data that can be supplied for initialisation |
|
198 @return The result of the operation |
|
199 @leave This method may leave with one of the system-wide error codes. |
|
200 */ |
|
201 virtual TInt DoOpenSlaveL(TUid aInterface, const TDesC8& aPackageBuf); |
|
202 |
|
203 /** |
|
204 Close the slave |
|
205 @param aHandle |
|
206 The handle of the slave plugin |
|
207 @leave This method may leave with one of the system-wide error codes. |
|
208 */ |
|
209 virtual void DoCloseSlaveL(TInt aHandle); |
|
210 |
|
211 /** |
|
212 Relay the synchronous custom command onto the slave |
|
213 @param aMessage |
|
214 The IPC message to be sent to the slave |
|
215 @return the result of the operation |
|
216 @leave This method may leave with one of the system-wide error codes. |
|
217 */ |
|
218 virtual TInt DoSendSlaveSyncCommandL(const RMmfIpcMessage& aMessage); |
|
219 |
|
220 /** |
|
221 Relay the synchronous custom command onto the slave and obtain a result |
|
222 @param aMessage |
|
223 The IPC message to be sent to the slave |
|
224 @return the result of the operation |
|
225 @leave This method may leave with one of the system-wide error codes. |
|
226 */ |
|
227 virtual TInt DoSendSlaveSyncCommandResultL(const RMmfIpcMessage& aMessage); |
|
228 |
|
229 /** |
|
230 Relay an asynchronous command onto the slave |
|
231 @param aMessage |
|
232 The IPC message to be sent to the slave |
|
233 @leave This method may leave with one of the system-wide error codes. |
|
234 */ |
|
235 virtual void DoSendSlaveAsyncCommandL(const RMmfIpcMessage& aMessage); |
|
236 |
|
237 /** |
|
238 Relay an asynchronous command onto the slave and obtain a result |
|
239 @param aMessage |
|
240 The IPC message to be sent to the slave@param aMessage |
|
241 @leave This method may leave with one of the system-wide error codes. |
|
242 */ |
|
243 virtual void DoSendSlaveAsyncCommandResultL(const RMmfIpcMessage& aMessage); |
|
244 |
|
245 protected: |
|
246 ~CMMFG711DecoderIntfcDeMux(); |
|
247 CMMFG711DecoderIntfcDeMux(); |
|
248 |
|
249 // from mirror MG711DecoderIntfc method. |
|
250 TInt DoSetDecoderModeL(MG711DecoderIntfc::TDecodeMode aDecodeMode); |
|
251 TInt DoGetDecoderModeL(MG711DecoderIntfc::TDecodeMode& aDecodeMode); |
|
252 TInt DoSetComfortNoiseGenerationL(TBool aCng); |
|
253 TInt DoGetComfortNoiseGenerationL(TBool& aCng); |
|
254 TInt DoSetPacketLossConcealmentL(TBool aPlc); |
|
255 TInt DoGetPacketLossConcealmentL(TBool& aPlc); |
|
256 |
|
257 protected: |
|
258 MMMFDevSoundCustomInterfaceDeMuxUtility* iUtility; |
|
259 MMMFDevSoundCustomInterfaceTarget* iTarget; |
|
260 TUid iKey; |
|
261 MG711DecoderIntfc* iInterfaceG711DecoderIntfc; |
|
262 }; |
|
263 |
|
264 #endif |