|
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 Ilbc encoder config custom interface pair |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef ILBCENCODERCONFIGCI_H |
|
19 #define ILBCENCODERCONFIGCI_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 TMMFDevSoundCIIlbcEncoderIntfcCommands |
|
38 { |
|
39 EMMFDevSoundCIIlbcEncoderIntfcSetEncoderMode, |
|
40 EMMFDevSoundCIIlbcEncoderIntfcGetEncoderMode, |
|
41 EMMFDevSoundCIIlbcEncoderIntfcSetVadMode, |
|
42 EMMFDevSoundCIIlbcEncoderIntfcGetVadMode |
|
43 }; |
|
44 |
|
45 |
|
46 /** |
|
47 Implementation of the Ilbc encoder config custom interface Mux |
|
48 @internalComponent |
|
49 @prototype |
|
50 @file |
|
51 */ |
|
52 class CMMFIlbcEncoderIntfcMux : public CBase, |
|
53 public MMMFDevSoundCustomInterfaceMuxPlugin, |
|
54 public MIlbcEncoderIntfc |
|
55 { |
|
56 public: |
|
57 |
|
58 // from MMMFDevSoundCustomInterfaceMuxPlugin |
|
59 /** |
|
60 Attempt to open the interface. |
|
61 @param aInterfaceId |
|
62 The UID of the interface to open. |
|
63 @return one of the system wide error codes |
|
64 */ |
|
65 virtual TInt OpenInterface(TUid aInterfaceId); |
|
66 |
|
67 /** |
|
68 Equivalent to destructor. Called to destroy plugin. |
|
69 */ |
|
70 virtual void Release(); |
|
71 |
|
72 /** |
|
73 Pass destructor key. |
|
74 Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation() |
|
75 @param aDestructorKey |
|
76 The Uid returned by REComSession::CreateImplementationL() or similar |
|
77 */ |
|
78 virtual void PassDestructorKey(TUid aDestructorKey); |
|
79 |
|
80 /** |
|
81 Complete construction. |
|
82 Pass additional values from the construction phase, used subsequently by the plugin. |
|
83 @param aCustomUtility |
|
84 The custom interface utility used by the plugin to communicate with the remote |
|
85 server side DeMux plugin |
|
86 */ |
|
87 virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceMuxUtility* aCustomUtility); |
|
88 |
|
89 /** |
|
90 Return the custom interface |
|
91 @param aInterfaceId |
|
92 The UID of the required custom interface |
|
93 @return the custom interface supported by this plugin |
|
94 */ |
|
95 virtual TAny* CustomInterface(TUid aInterfaceId); |
|
96 |
|
97 /** |
|
98 Instantiate a CI Mux class |
|
99 @return the pointer to the new class, cast to the Mux plugin mixin |
|
100 */ |
|
101 static MMMFDevSoundCustomInterfaceMuxPlugin* NewL(); |
|
102 |
|
103 // from MIlbcEncoderIntfc |
|
104 //@see MIlbcEncoderIntfc |
|
105 virtual TInt SetEncoderMode(TEncodeMode aEncodeMode); |
|
106 //@see MIlbcEncoderIntfc |
|
107 virtual TInt GetEncoderMode(TEncodeMode& aEncodeMode); |
|
108 //@see MIlbcEncoderIntfc |
|
109 virtual TInt SetVadMode(TBool aVadModeOn); |
|
110 //@see MIlbcEncoderIntfc |
|
111 virtual TInt GetVadMode(TBool& aVadModeOn); |
|
112 |
|
113 protected: |
|
114 CMMFIlbcEncoderIntfcMux(); |
|
115 ~CMMFIlbcEncoderIntfcMux(); |
|
116 |
|
117 protected: |
|
118 TUid iKey; |
|
119 TInt iRemoteHandle; |
|
120 MMMFDevSoundCustomInterfaceMuxUtility* iUtility; |
|
121 }; |
|
122 |
|
123 |
|
124 /** |
|
125 Implementation of the Ilbc Decoder config custom interface DeMux |
|
126 @internalComponent |
|
127 @prototype |
|
128 @file |
|
129 */ |
|
130 class CMMFIlbcEncoderIntfcDeMux : public CBase, |
|
131 public MMMFDevSoundCustomInterfaceDeMuxPlugin |
|
132 { |
|
133 public: |
|
134 /** |
|
135 Instantiate a CMMFIlbcEncoderIntfcDeMux class |
|
136 @return A pointer to the new class cast to the DeMux plugin mixin |
|
137 @leave This method may leave with one of the system-wide error codes. |
|
138 */ |
|
139 static MMMFDevSoundCustomInterfaceDeMuxPlugin* NewL(); |
|
140 |
|
141 /** |
|
142 Attempt to open the interface. |
|
143 @param aInterfaceId |
|
144 The UID of the interface to open. |
|
145 @return A handle to the remote plugin |
|
146 */ |
|
147 virtual TInt OpenInterface(TUid aInterfaceId); |
|
148 |
|
149 /** |
|
150 Equivalent to destructor. Called to destroy plugin. |
|
151 */ |
|
152 virtual void Release(); |
|
153 |
|
154 /** |
|
155 Pass destructor key. |
|
156 Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation() |
|
157 @param aDestructorKey |
|
158 The Uid returned by REComSession::CreateImplementationL() or similar |
|
159 */ |
|
160 virtual void PassDestructorKey(TUid aDestructorKey); |
|
161 |
|
162 /** |
|
163 Set the target of the custom interface call |
|
164 @param aTarget |
|
165 The DevSound to call the custom interface on. |
|
166 */ |
|
167 virtual void SetInterfaceTarget(MMMFDevSoundCustomInterfaceTarget* aTarget); |
|
168 |
|
169 /** |
|
170 Complete construction. |
|
171 @param aUtility |
|
172 The DeMux utility to use |
|
173 @leave This method may leave with one of the system-wide error codes. |
|
174 */ |
|
175 virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceDeMuxUtility* aUtility); |
|
176 |
|
177 /** |
|
178 Refresh the current custom interface connections |
|
179 @leave This method may leave with one of the system-wide error codes. |
|
180 */ |
|
181 virtual void RefreshL(); |
|
182 |
|
183 // from MMMFDevSoundCustomInterfaceDeMuxPlugin |
|
184 /** |
|
185 Open the slave |
|
186 @param aInterface |
|
187 The UID of the requested interface |
|
188 @param aPackageBuf |
|
189 A package of data that can be supplied for initialisation |
|
190 @return The result of the operation |
|
191 @leave This method may leave with one of the system-wide error codes. |
|
192 */ |
|
193 virtual TInt DoOpenSlaveL(TUid aInterface, const TDesC8& aPackageBuf); |
|
194 |
|
195 /** |
|
196 Close the slave |
|
197 @param aHandle |
|
198 The handle of the slave plugin |
|
199 @leave This method may leave with one of the system-wide error codes. |
|
200 */ |
|
201 virtual void DoCloseSlaveL(TInt aHandle); |
|
202 |
|
203 /** |
|
204 Relay the synchronous custom command onto the slave |
|
205 @param aMessage |
|
206 The IPC message to be sent to the slave |
|
207 @return the result of the operation |
|
208 @leave This method may leave with one of the system-wide error codes. |
|
209 */ |
|
210 virtual TInt DoSendSlaveSyncCommandL(const RMmfIpcMessage& aMessage); |
|
211 |
|
212 /** |
|
213 Relay the synchronous custom command onto the slave and obtain a result |
|
214 @param aMessage |
|
215 The IPC message to be sent to the slave |
|
216 @return the result of the operation |
|
217 @leave This method may leave with one of the system-wide error codes. |
|
218 */ |
|
219 virtual TInt DoSendSlaveSyncCommandResultL(const RMmfIpcMessage& aMessage); |
|
220 |
|
221 /** |
|
222 Relay an asynchronous command onto the slave |
|
223 @param aMessage |
|
224 The IPC message to be sent to the slave |
|
225 @leave This method may leave with one of the system-wide error codes. |
|
226 */ |
|
227 virtual void DoSendSlaveAsyncCommandL(const RMmfIpcMessage& aMessage); |
|
228 |
|
229 /** |
|
230 Relay an asynchronous command onto the slave and obtain a result |
|
231 @param aMessage |
|
232 The IPC message to be sent to the slave@param aMessage |
|
233 @leave This method may leave with one of the system-wide error codes. |
|
234 */ |
|
235 virtual void DoSendSlaveAsyncCommandResultL(const RMmfIpcMessage& aMessage); |
|
236 |
|
237 protected: |
|
238 ~CMMFIlbcEncoderIntfcDeMux(); |
|
239 CMMFIlbcEncoderIntfcDeMux(); |
|
240 |
|
241 // from mirror MIlbcEncoderIntfc method. |
|
242 TInt DoSetEncoderModeL(MIlbcEncoderIntfc::TEncodeMode aEncodeMode); |
|
243 TInt DoGetEncoderModeL(MIlbcEncoderIntfc::TEncodeMode& aEncodeMode); |
|
244 TInt DoSetVadModeL(TBool aVadModeOn); |
|
245 TInt DoGetVadModeL(TBool& aVadModeOn); |
|
246 |
|
247 protected: |
|
248 MMMFDevSoundCustomInterfaceDeMuxUtility* iUtility; |
|
249 MMMFDevSoundCustomInterfaceTarget* iTarget; |
|
250 TUid iKey; |
|
251 MIlbcEncoderIntfc* iInterfaceIlbcEncoderIntfc; |
|
252 }; |
|
253 |
|
254 #endif |