os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/MMFDevSoundCIMuxDeMuxPluginImp.h
First public contribution.
1 // Copyright (c) 2008-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Implementation of aac decoder config custom interface pair
18 #ifndef AACDECODERCONFIGCI_H
19 #define AACDECODERCONFIGCI_H
22 #include <mmf/common/mmfipc.h>
23 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
24 #include <mmf/common/mmfipcserver.h>
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 #include "devsoundciutestdevices.hrh"
33 Enum to represent the method called by this custom interface
38 enum TMMFDevSoundCIMuxDemuxCommands
40 EMMFDevSoundCIMuxDemuxCauseHeapFail = 0,
41 EMMFDevSoundCIMuxDemuxStopHeapFail,
42 EMMFDevSoundCIMuxDemuxCheckHeapFail
45 class MMMFDevSoundCIMuxPluginInterface
48 virtual TInt DevSoundCIMuxCauseHeapFail(TInt aFailCount) =0;
49 virtual TInt DevSoundCIMuxStopHeapFail() =0;
50 virtual TInt DevSoundCIMuxCheckHeapFail() =0;
55 Implementation of the DevSound Interface Mux
60 class CMMFDevSoundCIMuxPluginImp : public CBase,
61 public MMMFDevSoundCustomInterfaceMuxPlugin,
62 public MMMFDevSoundCIMuxPluginInterface
66 // from MMMFDevSoundCustomInterfaceMuxPlugin
68 Attempt to open the interface.
70 The UID of the interface to open.
71 @return one of the system wide error codes
73 virtual TInt OpenInterface(TUid aInterfaceId);
76 Equivalent to destructor. Called to destroy plugin.
78 virtual void Release();
82 Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
84 The Uid returned by REComSession::CreateImplementationL() or similar
86 virtual void PassDestructorKey(TUid aDestructorKey);
89 Complete construction.
90 Pass additional values from the construction phase, used subsequently by the plugin.
92 The custom interface utility used by the plugin to communicate with the remote
93 server side DeMux plugin
94 @leave This method may leave with one of the system-wide error codes.
96 virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceMuxUtility* aCustomUtility);
99 Return the custom interface
101 The UID of the required custom interface
102 @return the custom interface supported by this plugin
104 virtual TAny* CustomInterface(TUid aInterfaceId);
107 Instantiate a CI Mux class
108 @return the pointer to the new class, cast to the Mux plugin mixin
109 @leave This method may leave with one of the system-wide error codes.
111 static MMMFDevSoundCustomInterfaceMuxPlugin* NewL();
113 //Specific public method calls for this mux
114 TInt DevSoundCIMuxStopHeapFail();
115 TInt DevSoundCIMuxCauseHeapFail(TInt aFailCount);
116 TInt DevSoundCIMuxCheckHeapFail();
119 CMMFDevSoundCIMuxPluginImp();
120 ~CMMFDevSoundCIMuxPluginImp();
125 MMMFDevSoundCustomInterfaceMuxUtility* iUtility;
130 Implementation of the DevSound custom interface DeMux
135 class CMMFDevSoundCIDemuxPluginImp : public CBase,
136 public MMMFDevSoundCustomInterfaceDeMuxPlugin
140 Instantiate a CMMFAacDecoderConfigDeMux class
141 @return a pointer to the new class cast to the DeMux plugin mixin
142 @leave This method may leave with one of the system-wide error codes.
144 static MMMFDevSoundCustomInterfaceDeMuxPlugin* NewL();
147 Attempt to open the interface.
149 The UID of the interface to open.
150 @return a handle to the remote plugin
152 virtual TInt OpenInterface(TUid aInterfaceId);
155 Equivalent to destructor. Called to destroy plugin.
157 virtual void Release();
161 Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
162 @param aDestructorKey
163 The Uid returned by REComSession::CreateImplementationL() or similar
165 virtual void PassDestructorKey(TUid aDestructorKey);
168 Set the target of the custom interface call
170 The DevSound to call the custom interface on.
172 virtual void SetInterfaceTarget(MMMFDevSoundCustomInterfaceTarget* aTarget);
175 Complete construction.
177 The DeMux utility to use
178 @leave This method may leave with one of the system-wide error codes.
180 virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceDeMuxUtility* aUtility);
183 Refresh the current custom interface connections
184 @leave This method may leave with one of the system-wide error codes.
186 virtual void RefreshL();
188 // from MMMFDevSoundCustomInterfaceDeMuxPlugin
192 The UID of the requested interface
194 A package of data that can be supplied for initialisation
195 @return the result of the operation
196 @leave This method may leave with one of the system-wide error codes.
198 virtual TInt DoOpenSlaveL(TUid aInterface, const TDesC8& aPackageBuf);
203 The handle of the slave plugin
204 @leave This method may leave with one of the system-wide error codes.
206 virtual void DoCloseSlaveL(TInt aHandle);
208 // original RMessage is supplied so that remote DeMux plugin can extract necessary details
209 // using DeMux utility
212 Relay the synchronous custom command onto the slave
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.
218 virtual TInt DoSendSlaveSyncCommandL(const RMmfIpcMessage& aMessage);
221 Relay the synchronous custom command onto the slave and obtain a result
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.
227 virtual TInt DoSendSlaveSyncCommandResultL(const RMmfIpcMessage& aMessage);
230 Relay an asynchronous command onto the slave
232 The IPC message to be sent to the slave
233 @leave This method may leave with one of the system-wide error codes.
235 virtual void DoSendSlaveAsyncCommandL(const RMmfIpcMessage& aMessage);
238 Relay an asynchronous command onto the slave and obtain a result
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.
243 virtual void DoSendSlaveAsyncCommandResultL(const RMmfIpcMessage& aMessage);
246 //Specific public method calls for this demux
247 ~CMMFDevSoundCIDemuxPluginImp();
248 CMMFDevSoundCIDemuxPluginImp();
251 MMMFDevSoundCustomInterfaceDeMuxUtility* iUtility;
252 MMMFDevSoundCustomInterfaceTarget* iTarget;