1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/devsound/devsoundpluginsupport/src/CustomInterfaces/ilbcencoderconfigci.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,254 @@
1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// Implementation of Ilbc encoder config custom interface pair
1.18 +//
1.19 +//
1.20 +
1.21 +#ifndef ILBCENCODERCONFIGCI_H
1.22 +#define ILBCENCODERCONFIGCI_H
1.23 +
1.24 +#include <e32base.h>
1.25 +#include <mmf/common/mmfipc.h>
1.26 +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
1.27 +#include <mmf/common/mmfipcserver.h>
1.28 +#endif
1.29 +#include <mmf/server/mmfdevsoundcustominterface.h>
1.30 +#include <mmf/server/mmfdevsoundcustomcommands.h>
1.31 +#include <mmf/server/devsoundstandardcustominterfaces.h>
1.32 +#include <mmf/plugin/mmfdevsoundcustominterface.hrh>
1.33 +
1.34 +/**
1.35 +Enum to represent the method called by this custom interface
1.36 +@internalComponent
1.37 +@prototype
1.38 +@file
1.39 +*/
1.40 +enum TMMFDevSoundCIIlbcEncoderIntfcCommands
1.41 + {
1.42 + EMMFDevSoundCIIlbcEncoderIntfcSetEncoderMode,
1.43 + EMMFDevSoundCIIlbcEncoderIntfcGetEncoderMode,
1.44 + EMMFDevSoundCIIlbcEncoderIntfcSetVadMode,
1.45 + EMMFDevSoundCIIlbcEncoderIntfcGetVadMode
1.46 + };
1.47 +
1.48 +
1.49 +/**
1.50 +Implementation of the Ilbc encoder config custom interface Mux
1.51 +@internalComponent
1.52 +@prototype
1.53 +@file
1.54 +*/
1.55 +class CMMFIlbcEncoderIntfcMux : public CBase,
1.56 + public MMMFDevSoundCustomInterfaceMuxPlugin,
1.57 + public MIlbcEncoderIntfc
1.58 + {
1.59 +public:
1.60 +
1.61 + // from MMMFDevSoundCustomInterfaceMuxPlugin
1.62 + /**
1.63 + Attempt to open the interface.
1.64 + @param aInterfaceId
1.65 + The UID of the interface to open.
1.66 + @return one of the system wide error codes
1.67 + */
1.68 + virtual TInt OpenInterface(TUid aInterfaceId);
1.69 +
1.70 + /**
1.71 + Equivalent to destructor. Called to destroy plugin.
1.72 + */
1.73 + virtual void Release();
1.74 +
1.75 + /**
1.76 + Pass destructor key.
1.77 + Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
1.78 + @param aDestructorKey
1.79 + The Uid returned by REComSession::CreateImplementationL() or similar
1.80 + */
1.81 + virtual void PassDestructorKey(TUid aDestructorKey);
1.82 +
1.83 + /**
1.84 + Complete construction.
1.85 + Pass additional values from the construction phase, used subsequently by the plugin.
1.86 + @param aCustomUtility
1.87 + The custom interface utility used by the plugin to communicate with the remote
1.88 + server side DeMux plugin
1.89 + */
1.90 + virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceMuxUtility* aCustomUtility);
1.91 +
1.92 + /**
1.93 + Return the custom interface
1.94 + @param aInterfaceId
1.95 + The UID of the required custom interface
1.96 + @return the custom interface supported by this plugin
1.97 + */
1.98 + virtual TAny* CustomInterface(TUid aInterfaceId);
1.99 +
1.100 + /**
1.101 + Instantiate a CI Mux class
1.102 + @return the pointer to the new class, cast to the Mux plugin mixin
1.103 + */
1.104 + static MMMFDevSoundCustomInterfaceMuxPlugin* NewL();
1.105 +
1.106 + // from MIlbcEncoderIntfc
1.107 + //@see MIlbcEncoderIntfc
1.108 + virtual TInt SetEncoderMode(TEncodeMode aEncodeMode);
1.109 + //@see MIlbcEncoderIntfc
1.110 + virtual TInt GetEncoderMode(TEncodeMode& aEncodeMode);
1.111 + //@see MIlbcEncoderIntfc
1.112 + virtual TInt SetVadMode(TBool aVadModeOn);
1.113 + //@see MIlbcEncoderIntfc
1.114 + virtual TInt GetVadMode(TBool& aVadModeOn);
1.115 +
1.116 +protected:
1.117 + CMMFIlbcEncoderIntfcMux();
1.118 + ~CMMFIlbcEncoderIntfcMux();
1.119 +
1.120 +protected:
1.121 + TUid iKey;
1.122 + TInt iRemoteHandle;
1.123 + MMMFDevSoundCustomInterfaceMuxUtility* iUtility;
1.124 + };
1.125 +
1.126 +
1.127 +/**
1.128 +Implementation of the Ilbc Decoder config custom interface DeMux
1.129 +@internalComponent
1.130 +@prototype
1.131 +@file
1.132 +*/
1.133 +class CMMFIlbcEncoderIntfcDeMux : public CBase,
1.134 + public MMMFDevSoundCustomInterfaceDeMuxPlugin
1.135 + {
1.136 +public:
1.137 + /**
1.138 + Instantiate a CMMFIlbcEncoderIntfcDeMux class
1.139 + @return A pointer to the new class cast to the DeMux plugin mixin
1.140 + @leave This method may leave with one of the system-wide error codes.
1.141 + */
1.142 + static MMMFDevSoundCustomInterfaceDeMuxPlugin* NewL();
1.143 +
1.144 + /**
1.145 + Attempt to open the interface.
1.146 + @param aInterfaceId
1.147 + The UID of the interface to open.
1.148 + @return A handle to the remote plugin
1.149 + */
1.150 + virtual TInt OpenInterface(TUid aInterfaceId);
1.151 +
1.152 + /**
1.153 + Equivalent to destructor. Called to destroy plugin.
1.154 + */
1.155 + virtual void Release();
1.156 +
1.157 + /**
1.158 + Pass destructor key.
1.159 + Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
1.160 + @param aDestructorKey
1.161 + The Uid returned by REComSession::CreateImplementationL() or similar
1.162 + */
1.163 + virtual void PassDestructorKey(TUid aDestructorKey);
1.164 +
1.165 + /**
1.166 + Set the target of the custom interface call
1.167 + @param aTarget
1.168 + The DevSound to call the custom interface on.
1.169 + */
1.170 + virtual void SetInterfaceTarget(MMMFDevSoundCustomInterfaceTarget* aTarget);
1.171 +
1.172 + /**
1.173 + Complete construction.
1.174 + @param aUtility
1.175 + The DeMux utility to use
1.176 + @leave This method may leave with one of the system-wide error codes.
1.177 + */
1.178 + virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceDeMuxUtility* aUtility);
1.179 +
1.180 + /**
1.181 + Refresh the current custom interface connections
1.182 + @leave This method may leave with one of the system-wide error codes.
1.183 + */
1.184 + virtual void RefreshL();
1.185 +
1.186 + // from MMMFDevSoundCustomInterfaceDeMuxPlugin
1.187 + /**
1.188 + Open the slave
1.189 + @param aInterface
1.190 + The UID of the requested interface
1.191 + @param aPackageBuf
1.192 + A package of data that can be supplied for initialisation
1.193 + @return The result of the operation
1.194 + @leave This method may leave with one of the system-wide error codes.
1.195 + */
1.196 + virtual TInt DoOpenSlaveL(TUid aInterface, const TDesC8& aPackageBuf);
1.197 +
1.198 + /**
1.199 + Close the slave
1.200 + @param aHandle
1.201 + The handle of the slave plugin
1.202 + @leave This method may leave with one of the system-wide error codes.
1.203 + */
1.204 + virtual void DoCloseSlaveL(TInt aHandle);
1.205 +
1.206 + /**
1.207 + Relay the synchronous custom command onto the slave
1.208 + @param aMessage
1.209 + The IPC message to be sent to the slave
1.210 + @return the result of the operation
1.211 + @leave This method may leave with one of the system-wide error codes.
1.212 + */
1.213 + virtual TInt DoSendSlaveSyncCommandL(const RMmfIpcMessage& aMessage);
1.214 +
1.215 + /**
1.216 + Relay the synchronous custom command onto the slave and obtain a result
1.217 + @param aMessage
1.218 + The IPC message to be sent to the slave
1.219 + @return the result of the operation
1.220 + @leave This method may leave with one of the system-wide error codes.
1.221 + */
1.222 + virtual TInt DoSendSlaveSyncCommandResultL(const RMmfIpcMessage& aMessage);
1.223 +
1.224 + /**
1.225 + Relay an asynchronous command onto the slave
1.226 + @param aMessage
1.227 + The IPC message to be sent to the slave
1.228 + @leave This method may leave with one of the system-wide error codes.
1.229 + */
1.230 + virtual void DoSendSlaveAsyncCommandL(const RMmfIpcMessage& aMessage);
1.231 +
1.232 + /**
1.233 + Relay an asynchronous command onto the slave and obtain a result
1.234 + @param aMessage
1.235 + The IPC message to be sent to the slave@param aMessage
1.236 + @leave This method may leave with one of the system-wide error codes.
1.237 + */
1.238 + virtual void DoSendSlaveAsyncCommandResultL(const RMmfIpcMessage& aMessage);
1.239 +
1.240 +protected:
1.241 + ~CMMFIlbcEncoderIntfcDeMux();
1.242 + CMMFIlbcEncoderIntfcDeMux();
1.243 +
1.244 + // from mirror MIlbcEncoderIntfc method.
1.245 + TInt DoSetEncoderModeL(MIlbcEncoderIntfc::TEncodeMode aEncodeMode);
1.246 + TInt DoGetEncoderModeL(MIlbcEncoderIntfc::TEncodeMode& aEncodeMode);
1.247 + TInt DoSetVadModeL(TBool aVadModeOn);
1.248 + TInt DoGetVadModeL(TBool& aVadModeOn);
1.249 +
1.250 +protected:
1.251 + MMMFDevSoundCustomInterfaceDeMuxUtility* iUtility;
1.252 + MMMFDevSoundCustomInterfaceTarget* iTarget;
1.253 + TUid iKey;
1.254 + MIlbcEncoderIntfc* iInterfaceIlbcEncoderIntfc;
1.255 + };
1.256 +
1.257 +#endif