1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/devsound/devsoundpluginsupport/src/CustomInterfaces/aacdecoderconfigci.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,256 @@
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 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 +
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 TMMFDevSoundCIAacDecoderConfigCommands
1.41 + {
1.42 + EMMFDevSoundCIAacDecoderConfigSetAudioConfig = 0,
1.43 + EMMFDevSoundCIAacDecoderConfigGetSupportedAudioConfig = 1,
1.44 + EMMFDevSoundCIAacDecoderConfigGetSupportedAudioConfigArray
1.45 + };
1.46 +
1.47 +
1.48 +/**
1.49 +Implementation of the Aac decoder config custom interface Mux
1.50 +@internalComponent
1.51 +@prototype
1.52 +@file
1.53 +*/
1.54 +class CMMFAacDecoderConfigMux : public CBase,
1.55 + public MMMFDevSoundCustomInterfaceMuxPlugin,
1.56 + public MAacDecoderConfig
1.57 + {
1.58 +public:
1.59 +
1.60 + // from MMMFDevSoundCustomInterfaceMuxPlugin
1.61 + /**
1.62 + Attempt to open the interface.
1.63 + @param aInterfaceId
1.64 + The UID of the interface to open.
1.65 + @return one of the system wide error codes
1.66 + */
1.67 + virtual TInt OpenInterface(TUid aInterfaceId);
1.68 +
1.69 + /**
1.70 + Equivalent to destructor. Called to destroy plugin.
1.71 + */
1.72 + virtual void Release();
1.73 +
1.74 + /**
1.75 + Pass destructor key.
1.76 + Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
1.77 + @param aDestructorKey
1.78 + The Uid returned by REComSession::CreateImplementationL() or similar
1.79 + */
1.80 + virtual void PassDestructorKey(TUid aDestructorKey);
1.81 +
1.82 + /**
1.83 + Complete construction.
1.84 + Pass additional values from the construction phase, used subsequently by the plugin.
1.85 + @param aCustomUtility
1.86 + The custom interface utility used by the plugin to communicate with the remote
1.87 + server side DeMux plugin
1.88 + @leave This method may leave with one of the system-wide error codes.
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 + @leave This method may leave with one of the system-wide error codes.
1.104 + */
1.105 + static MMMFDevSoundCustomInterfaceMuxPlugin* NewL();
1.106 +
1.107 + // from MAacDecoderConfig
1.108 + //@see MAacDecoderConfig
1.109 + virtual TInt SetAudioConfig(TAudioConfig& aAudioConfig);
1.110 + //@see MAacDecoderConfig
1.111 + virtual TInt GetSupportedAudioConfigs(RArray<TAudioConfig>& aSupportedAudioConfigs);
1.112 +
1.113 +protected:
1.114 + CMMFAacDecoderConfigMux();
1.115 + ~CMMFAacDecoderConfigMux();
1.116 +
1.117 +protected:
1.118 + TUid iKey;
1.119 + TInt iRemoteHandle;
1.120 + MMMFDevSoundCustomInterfaceMuxUtility* iUtility;
1.121 + };
1.122 +
1.123 +
1.124 +/**
1.125 +Implementation of the Aac decoder config custom interface DeMux
1.126 +@internalComponent
1.127 +@prototype
1.128 +@file
1.129 +*/
1.130 +class CMMFAacDecoderConfigDeMux : public CBase,
1.131 + public MMMFDevSoundCustomInterfaceDeMuxPlugin
1.132 + {
1.133 +public:
1.134 + /**
1.135 + Instantiate a CMMFAacDecoderConfigDeMux class
1.136 + @return a pointer to the new class cast to the DeMux plugin mixin
1.137 + @leave This method may leave with one of the system-wide error codes.
1.138 + */
1.139 + static MMMFDevSoundCustomInterfaceDeMuxPlugin* NewL();
1.140 +
1.141 + /**
1.142 + Attempt to open the interface.
1.143 + @param aInterfaceId
1.144 + The UID of the interface to open.
1.145 + @return a handle to the remote plugin
1.146 + */
1.147 + virtual TInt OpenInterface(TUid aInterfaceId);
1.148 +
1.149 + /**
1.150 + Equivalent to destructor. Called to destroy plugin.
1.151 + */
1.152 + virtual void Release();
1.153 +
1.154 + /**
1.155 + Pass destructor key.
1.156 + Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
1.157 + @param aDestructorKey
1.158 + The Uid returned by REComSession::CreateImplementationL() or similar
1.159 + */
1.160 + virtual void PassDestructorKey(TUid aDestructorKey);
1.161 +
1.162 + /**
1.163 + Set the target of the custom interface call
1.164 + @param aTarget
1.165 + The DevSound to call the custom interface on.
1.166 + */
1.167 + virtual void SetInterfaceTarget(MMMFDevSoundCustomInterfaceTarget* aTarget);
1.168 +
1.169 + /**
1.170 + Complete construction.
1.171 + @param aUtility
1.172 + The DeMux utility to use
1.173 + @leave This method may leave with one of the system-wide error codes.
1.174 + */
1.175 + virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceDeMuxUtility* aUtility);
1.176 +
1.177 + /**
1.178 + Refresh the current custom interface connections
1.179 + @leave This method may leave with one of the system-wide error codes.
1.180 + */
1.181 + virtual void RefreshL();
1.182 +
1.183 + // from MMMFDevSoundCustomInterfaceDeMuxPlugin
1.184 + /**
1.185 + Open the slave
1.186 + @param aInterface
1.187 + The UID of the requested interface
1.188 + @param aPackageBuf
1.189 + A package of data that can be supplied for initialisation
1.190 + @return the result of the operation
1.191 + @leave This method may leave with one of the system-wide error codes.
1.192 + */
1.193 + virtual TInt DoOpenSlaveL(TUid aInterface, const TDesC8& aPackageBuf);
1.194 +
1.195 + /**
1.196 + Close the slave
1.197 + @param aHandle
1.198 + The handle of the slave plugin
1.199 + @leave This method may leave with one of the system-wide error codes.
1.200 + */
1.201 + virtual void DoCloseSlaveL(TInt aHandle);
1.202 +
1.203 + // original RMessage is supplied so that remote DeMux plugin can extract necessary details
1.204 + // using DeMux utility
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 + ~CMMFAacDecoderConfigDeMux();
1.242 + CMMFAacDecoderConfigDeMux();
1.243 +
1.244 + // from mirror MAacDecoderConfig method.
1.245 + TInt DoSetAudioConfigL(MAacDecoderConfig::TAudioConfig& aAudioConfig);
1.246 + TInt DoGetSupportedAudioConfigsL(RArray<MAacDecoderConfig::TAudioConfig>& aSupportedAudioConfigs);
1.247 +
1.248 +private:
1.249 + void DoCopyAudioConfigsBufferToClientL(const RMmfIpcMessage& aMessage);
1.250 +
1.251 +protected:
1.252 + MMMFDevSoundCustomInterfaceDeMuxUtility* iUtility;
1.253 + MMMFDevSoundCustomInterfaceTarget* iTarget;
1.254 + TUid iKey;
1.255 + MAacDecoderConfig* iInterfaceAacDecoderConfig;
1.256 + RArray<MAacDecoderConfig::TAudioConfig> iSupportedAudioConfigs;
1.257 + };
1.258 +
1.259 +#endif