os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/MMFDevSoundCIMuxDeMuxPluginImp.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/MMFDevSoundCIMuxDeMuxPluginImp.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,256 @@
1.4 +// Copyright (c) 2008-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 aac decoder config custom interface pair
1.18 +//
1.19 +//
1.20 +
1.21 +#ifndef AACDECODERCONFIGCI_H
1.22 +#define AACDECODERCONFIGCI_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 +#include "devsoundciutestdevices.hrh"
1.34 +
1.35 +/**
1.36 +Enum to represent the method called by this custom interface
1.37 +@internalComponent
1.38 +@prototype
1.39 +@file
1.40 +*/
1.41 +enum TMMFDevSoundCIMuxDemuxCommands
1.42 + {
1.43 + EMMFDevSoundCIMuxDemuxCauseHeapFail = 0,
1.44 + EMMFDevSoundCIMuxDemuxStopHeapFail,
1.45 + EMMFDevSoundCIMuxDemuxCheckHeapFail
1.46 + };
1.47 +
1.48 +class MMMFDevSoundCIMuxPluginInterface
1.49 + {
1.50 +public:
1.51 + virtual TInt DevSoundCIMuxCauseHeapFail(TInt aFailCount) =0;
1.52 + virtual TInt DevSoundCIMuxStopHeapFail() =0;
1.53 + virtual TInt DevSoundCIMuxCheckHeapFail() =0;
1.54 + };
1.55 +
1.56 +
1.57 +/**
1.58 +Implementation of the DevSound Interface Mux
1.59 +@internalComponent
1.60 +@prototype
1.61 +@file
1.62 +*/
1.63 +class CMMFDevSoundCIMuxPluginImp : public CBase,
1.64 + public MMMFDevSoundCustomInterfaceMuxPlugin,
1.65 + public MMMFDevSoundCIMuxPluginInterface
1.66 + {
1.67 +public:
1.68 +
1.69 + // from MMMFDevSoundCustomInterfaceMuxPlugin
1.70 + /**
1.71 + Attempt to open the interface.
1.72 + @param aInterfaceId
1.73 + The UID of the interface to open.
1.74 + @return one of the system wide error codes
1.75 + */
1.76 + virtual TInt OpenInterface(TUid aInterfaceId);
1.77 +
1.78 + /**
1.79 + Equivalent to destructor. Called to destroy plugin.
1.80 + */
1.81 + virtual void Release();
1.82 +
1.83 + /**
1.84 + Pass destructor key.
1.85 + Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
1.86 + @param aDestructorKey
1.87 + The Uid returned by REComSession::CreateImplementationL() or similar
1.88 + */
1.89 + virtual void PassDestructorKey(TUid aDestructorKey);
1.90 +
1.91 + /**
1.92 + Complete construction.
1.93 + Pass additional values from the construction phase, used subsequently by the plugin.
1.94 + @param aCustomUtility
1.95 + The custom interface utility used by the plugin to communicate with the remote
1.96 + server side DeMux plugin
1.97 + @leave This method may leave with one of the system-wide error codes.
1.98 + */
1.99 + virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceMuxUtility* aCustomUtility);
1.100 +
1.101 + /**
1.102 + Return the custom interface
1.103 + @param aInterfaceId
1.104 + The UID of the required custom interface
1.105 + @return the custom interface supported by this plugin
1.106 + */
1.107 + virtual TAny* CustomInterface(TUid aInterfaceId);
1.108 +
1.109 + /**
1.110 + Instantiate a CI Mux class
1.111 + @return the pointer to the new class, cast to the Mux plugin mixin
1.112 + @leave This method may leave with one of the system-wide error codes.
1.113 + */
1.114 + static MMMFDevSoundCustomInterfaceMuxPlugin* NewL();
1.115 +
1.116 + //Specific public method calls for this mux
1.117 + TInt DevSoundCIMuxStopHeapFail();
1.118 + TInt DevSoundCIMuxCauseHeapFail(TInt aFailCount);
1.119 + TInt DevSoundCIMuxCheckHeapFail();
1.120 +
1.121 +protected:
1.122 + CMMFDevSoundCIMuxPluginImp();
1.123 + ~CMMFDevSoundCIMuxPluginImp();
1.124 +
1.125 +protected:
1.126 + TUid iKey;
1.127 + TInt iRemoteHandle;
1.128 + MMMFDevSoundCustomInterfaceMuxUtility* iUtility;
1.129 + };
1.130 +
1.131 +
1.132 +/**
1.133 +Implementation of the DevSound custom interface DeMux
1.134 +@internalComponent
1.135 +@prototype
1.136 +@file
1.137 +*/
1.138 +class CMMFDevSoundCIDemuxPluginImp : public CBase,
1.139 + public MMMFDevSoundCustomInterfaceDeMuxPlugin
1.140 + {
1.141 +public:
1.142 + /**
1.143 + Instantiate a CMMFAacDecoderConfigDeMux class
1.144 + @return a pointer to the new class cast to the DeMux plugin mixin
1.145 + @leave This method may leave with one of the system-wide error codes.
1.146 + */
1.147 + static MMMFDevSoundCustomInterfaceDeMuxPlugin* NewL();
1.148 +
1.149 + /**
1.150 + Attempt to open the interface.
1.151 + @param aInterfaceId
1.152 + The UID of the interface to open.
1.153 + @return a handle to the remote plugin
1.154 + */
1.155 + virtual TInt OpenInterface(TUid aInterfaceId);
1.156 +
1.157 + /**
1.158 + Equivalent to destructor. Called to destroy plugin.
1.159 + */
1.160 + virtual void Release();
1.161 +
1.162 + /**
1.163 + Pass destructor key.
1.164 + Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
1.165 + @param aDestructorKey
1.166 + The Uid returned by REComSession::CreateImplementationL() or similar
1.167 + */
1.168 + virtual void PassDestructorKey(TUid aDestructorKey);
1.169 +
1.170 + /**
1.171 + Set the target of the custom interface call
1.172 + @param aTarget
1.173 + The DevSound to call the custom interface on.
1.174 + */
1.175 + virtual void SetInterfaceTarget(MMMFDevSoundCustomInterfaceTarget* aTarget);
1.176 +
1.177 + /**
1.178 + Complete construction.
1.179 + @param aUtility
1.180 + The DeMux utility to use
1.181 + @leave This method may leave with one of the system-wide error codes.
1.182 + */
1.183 + virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceDeMuxUtility* aUtility);
1.184 +
1.185 + /**
1.186 + Refresh the current custom interface connections
1.187 + @leave This method may leave with one of the system-wide error codes.
1.188 + */
1.189 + virtual void RefreshL();
1.190 +
1.191 + // from MMMFDevSoundCustomInterfaceDeMuxPlugin
1.192 + /**
1.193 + Open the slave
1.194 + @param aInterface
1.195 + The UID of the requested interface
1.196 + @param aPackageBuf
1.197 + A package of data that can be supplied for initialisation
1.198 + @return the result of the operation
1.199 + @leave This method may leave with one of the system-wide error codes.
1.200 + */
1.201 + virtual TInt DoOpenSlaveL(TUid aInterface, const TDesC8& aPackageBuf);
1.202 +
1.203 + /**
1.204 + Close the slave
1.205 + @param aHandle
1.206 + The handle of the slave plugin
1.207 + @leave This method may leave with one of the system-wide error codes.
1.208 + */
1.209 + virtual void DoCloseSlaveL(TInt aHandle);
1.210 +
1.211 + // original RMessage is supplied so that remote DeMux plugin can extract necessary details
1.212 + // using DeMux utility
1.213 +
1.214 + /**
1.215 + Relay the synchronous custom command onto the slave
1.216 + @param aMessage
1.217 + The IPC message to be sent to the slave
1.218 + @return the result of the operation
1.219 + @leave This method may leave with one of the system-wide error codes.
1.220 + */
1.221 + virtual TInt DoSendSlaveSyncCommandL(const RMmfIpcMessage& aMessage);
1.222 +
1.223 + /**
1.224 + Relay the synchronous custom command onto the slave and obtain a result
1.225 + @param aMessage
1.226 + The IPC message to be sent to the slave
1.227 + @return the result of the operation
1.228 + @leave This method may leave with one of the system-wide error codes.
1.229 + */
1.230 + virtual TInt DoSendSlaveSyncCommandResultL(const RMmfIpcMessage& aMessage);
1.231 +
1.232 + /**
1.233 + Relay an asynchronous command onto the slave
1.234 + @param aMessage
1.235 + The IPC message to be sent to the slave
1.236 + @leave This method may leave with one of the system-wide error codes.
1.237 + */
1.238 + virtual void DoSendSlaveAsyncCommandL(const RMmfIpcMessage& aMessage);
1.239 +
1.240 + /**
1.241 + Relay an asynchronous command onto the slave and obtain a result
1.242 + @param aMessage
1.243 + The IPC message to be sent to the slave@param aMessage
1.244 + @leave This method may leave with one of the system-wide error codes.
1.245 + */
1.246 + virtual void DoSendSlaveAsyncCommandResultL(const RMmfIpcMessage& aMessage);
1.247 +
1.248 +protected:
1.249 + //Specific public method calls for this demux
1.250 + ~CMMFDevSoundCIDemuxPluginImp();
1.251 + CMMFDevSoundCIDemuxPluginImp();
1.252 +
1.253 +protected:
1.254 + MMMFDevSoundCustomInterfaceDeMuxUtility* iUtility;
1.255 + MMMFDevSoundCustomInterfaceTarget* iTarget;
1.256 + TUid iKey;
1.257 + };
1.258 +
1.259 +#endif