os/mm/devsound/devsoundpluginsupport/src/CustomInterfaces/eaacplusdecoderci.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/devsound/devsoundpluginsupport/src/CustomInterfaces/eaacplusdecoderci.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,314 @@
     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 +//
    1.18 +
    1.19 +#ifndef EAACPLUSDECODERCI_H
    1.20 +#define EAACPLUSDECODERCI_H
    1.21 +
    1.22 +#include <e32base.h>
    1.23 +#include <mmf/common/mmfipc.h>
    1.24 +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
    1.25 +#include <mmf/common/mmfipcserver.h>
    1.26 +#endif
    1.27 +#include <mmf/server/mmfdevsoundcustominterface.h>
    1.28 +#include <mmf/server/mmfdevsoundcustomcommands.h>
    1.29 +#include <mmf/server/devsoundstandardcustominterfaces.h>
    1.30 +#include <mmf/plugin/mmfdevsoundcustominterface.hrh>
    1.31 +
    1.32 +/**
    1.33 + Enum to represent the methods called by this custom interface
    1.34 + @internalComponent
    1.35 + @prototype
    1.36 + @file
    1.37 + */
    1.38 +enum TMMFDevSoundCIEAacPlusDecoderCommands
    1.39 +	{
    1.40 +	EMMFDevSoundCIEAacPlusDecoderSetInputSamplingFrequency = 0,
    1.41 +	EMMFDevSoundCIEAacPlusDecoderSetAudioObjectType,
    1.42 +	EMMFDevSoundCIEAacPlusDecoderSetNumOfChannels,
    1.43 +	EMMFDevSoundCIEAacPlusDecoderSetSbr,
    1.44 +	EMMFDevSoundCIEAacPlusDecoderSetDownSampledMode,
    1.45 +	EMMFDevSoundCIEAacPlusDecoderApplyConfig,
    1.46 +	EMMFDevSoundCIEAacPlusDecoderGetInputSamplingFrequency,
    1.47 +	EMMFDevSoundCIEAacPlusDecoderGetAudioObjectType,
    1.48 +	EMMFDevSoundCIEAacPlusDecoderGetNumOfChannels,
    1.49 +	EMMFDevSoundCIEAacPlusDecoderGetSbr,
    1.50 +	EMMFDevSoundCIEAacPlusDecoderGetDownSampledMode
    1.51 +	};
    1.52 +
    1.53 +
    1.54 +/**
    1.55 + CMMFEAacPlusDecoderMux - implementation of the EAAC+ Decoder custom interface pair
    1.56 + @internalComponent
    1.57 + @prototype
    1.58 + @file
    1.59 + */
    1.60 +class CMMFEAacPlusDecoderMux : public CBase,
    1.61 +							   public MMMFDevSoundCustomInterfaceMuxPlugin,
    1.62 +							   public MEAacPlusDecoderIntfc  
    1.63 +	{
    1.64 +public:
    1.65 +
    1.66 +	// from MMMFDevSoundCustomInterfaceMuxPlugin
    1.67 +	/**
    1.68 +	Attempt to open the interface.
    1.69 +	@param aInterfaceId
    1.70 +		   The UID of the interface to open.
    1.71 +	@return One of the system wide error codes
    1.72 +	*/
    1.73 +	virtual TInt OpenInterface(TUid aInterfaceId);
    1.74 +
    1.75 +	/**
    1.76 +	Equivalent to destructor.  Called to destroy plugin.
    1.77 +	*/
    1.78 +	virtual void Release();
    1.79 +	
    1.80 +	/**
    1.81 +	Pass destructor key.
    1.82 +	Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
    1.83 +	@param aDestructorKey
    1.84 +	       The Uid returned by REComSession::CreateImplementationL() or similar
    1.85 +	*/
    1.86 +	virtual void PassDestructorKey(TUid aDestructorKey);
    1.87 +	
    1.88 +	/**
    1.89 +	Complete construction.
    1.90 +	Pass additional values from the construction phase, used subsequently by the plugin.
    1.91 +	@param aCustomUtility
    1.92 +	       The custom interface utility used by the plugin to communicate with the remote
    1.93 +		   server side DeMux plugin
    1.94 +	@leave This method may leave with one of the system-wide error codes.
    1.95 +	*/
    1.96 +	virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceMuxUtility* aCustomUtility);
    1.97 +
    1.98 +	/** 
    1.99 +	Return the custom interface
   1.100 +	@param aInterfaceId
   1.101 +		   The UID of the required custom interface
   1.102 +	@return The custom interface supported by this plugin
   1.103 +	*/
   1.104 +	virtual TAny* CustomInterface(TUid aInterfaceId);
   1.105 +
   1.106 +	/**
   1.107 +	Instantiate a CI Mux class
   1.108 +	@leave This method may leave with one of the system-wide error codes.
   1.109 +	@return The pointer to the new class, cast to the Mux plugin mixin
   1.110 +	*/
   1.111 +	static MMMFDevSoundCustomInterfaceMuxPlugin* NewL();
   1.112 +
   1.113 +	// from MEAacPlusDecoderIntfc
   1.114 +	/** 
   1.115 +	@see MEAacPlusDecoderIntfc
   1.116 +	*/
   1.117 +	virtual void SetInputSamplingFrequency(TUint aInputSamplingFrequency);
   1.118 +	
   1.119 +	/** 
   1.120 +	@see MEAacPlusDecoderIntfc
   1.121 +	*/
   1.122 +	virtual void SetAudioObjectType(MEAacPlusDecoderIntfc::TAudioObjectType aAudioObjectType);
   1.123 +	
   1.124 +	/** 
   1.125 +	@see MEAacPlusDecoderIntfc
   1.126 +	*/
   1.127 +	virtual void SetNumOfChannels(TUint aNumOfChannels);
   1.128 +	
   1.129 +	/** 
   1.130 +	@see MEAacPlusDecoderIntfc
   1.131 +	*/
   1.132 +	virtual void SetSbr(TBool aSbrEnabled);
   1.133 +	
   1.134 +	/** 
   1.135 +	@see MEAacPlusDecoderIntfc
   1.136 +	*/
   1.137 +	virtual void SetDownSampledMode(TBool aDsmEnabled);
   1.138 +	
   1.139 +	/** 
   1.140 +	@see MEAacPlusDecoderIntfc
   1.141 +	*/
   1.142 +	virtual TInt ApplyConfig();
   1.143 +	
   1.144 +	/** 
   1.145 +	@see MEAacPlusDecoderIntfc
   1.146 +	*/
   1.147 +	virtual TInt GetInputSamplingFrequency ( TUint& aInputSamplingFrequency );
   1.148 +	
   1.149 +	/** 
   1.150 +	@see MEAacPlusDecoderIntfc
   1.151 +	*/
   1.152 +	virtual TInt GetAudioObjectType(MEAacPlusDecoderIntfc::TAudioObjectType& aAudioObjectType);
   1.153 +	
   1.154 +	/** 
   1.155 +	@see MEAacPlusDecoderIntfc
   1.156 +	*/
   1.157 +	virtual TInt GetNumOfChannels ( TUint& aNumOfChannels );
   1.158 +	
   1.159 +	/** 
   1.160 +	@see MEAacPlusDecoderIntfc
   1.161 +	*/
   1.162 +	virtual TInt GetSbr (TBool& aSbrEnabled);
   1.163 +	
   1.164 +	/** 
   1.165 +	@see MEAacPlusDecoderIntfc
   1.166 +	*/
   1.167 +	virtual TInt GetDownSampledMode (TBool& aDsmEnabled);
   1.168 +
   1.169 +protected:
   1.170 +	CMMFEAacPlusDecoderMux();
   1.171 +	~CMMFEAacPlusDecoderMux();
   1.172 +
   1.173 +protected:
   1.174 +	TUid iDestructorKey;
   1.175 +	TInt iRemoteHandle;
   1.176 +	MMMFDevSoundCustomInterfaceMuxUtility* iUtility;
   1.177 +	};
   1.178 +
   1.179 +/**
   1.180 + CMMFEAacPlusDecoderDeMux - DeMux side of pair
   1.181 + @internalComponent
   1.182 + @prototype
   1.183 + @file
   1.184 + */
   1.185 +class CMMFEAacPlusDecoderDeMux : public CBase, public MMMFDevSoundCustomInterfaceDeMuxPlugin
   1.186 +	{
   1.187 +public:
   1.188 +	/**
   1.189 +	Instantiate a CMMFEAacPlusDecoderDeMux class
   1.190 +	@leave This method may leave with one of the system-wide error codes.
   1.191 +	@return A pointer to the new class cast to the DeMux plugin mixin
   1.192 +	*/
   1.193 +	static MMMFDevSoundCustomInterfaceDeMuxPlugin* NewL();
   1.194 +		
   1.195 +	/**
   1.196 +	Attempt to open the interface.
   1.197 +	@param aInterfaceId
   1.198 +		   The UID of the interface to open.
   1.199 +	@return A handle to the remote plugin
   1.200 +	*/
   1.201 +	virtual TInt OpenInterface(TUid aInterfaceId);
   1.202 +
   1.203 +	/**
   1.204 +	Equivalent to destructor.  Called to destroy plugin.
   1.205 +	*/
   1.206 +	virtual void Release();
   1.207 +	/**
   1.208 +	Pass destructor key.
   1.209 +	Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
   1.210 +	@param aDestructorKey
   1.211 +	       The Uid returned by REComSession::CreateImplementationL() or similar
   1.212 +	*/
   1.213 +	virtual void PassDestructorKey(TUid aDestructorKey);
   1.214 +	
   1.215 +	/**
   1.216 +	Set the target of the custom interface call
   1.217 +	@param aTarget
   1.218 +	       The DevSound to call the custom interface on.
   1.219 +	*/
   1.220 +	virtual void SetInterfaceTarget(MMMFDevSoundCustomInterfaceTarget* aTarget);
   1.221 +	
   1.222 +	/**
   1.223 +	Complete construction.
   1.224 +	@param aUtility
   1.225 +	       The DeMux utility to use
   1.226 +	@leave This method may leave with one of the system-wide error codes.
   1.227 +	*/
   1.228 +	virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceDeMuxUtility* aUtility);
   1.229 +
   1.230 +	/**
   1.231 +	Refresh the current custom interface connections
   1.232 +	@leave This method may leave with one of the system-wide error codes.
   1.233 +	*/
   1.234 +	virtual void RefreshL();
   1.235 +
   1.236 +	// from MMMFDevSoundCustomInterfaceDeMuxPlugin
   1.237 +	/**
   1.238 +	Open the slave
   1.239 +	@param aInterface
   1.240 +		   The UID of the requested interface
   1.241 +	@param aPackageBuf
   1.242 +		   A package of data that can be supplied for initialisation
   1.243 +	@leave This method may leave with one of the system-wide error codes.
   1.244 +	@return The result of the operation
   1.245 +	*/
   1.246 +	virtual TInt DoOpenSlaveL(TUid aInterface, const TDesC8& aPackageBuf);
   1.247 +
   1.248 +	/** 
   1.249 +	Close the slave
   1.250 +	@param aHandle
   1.251 +		   The handle of the slave plugin
   1.252 +	@leave This method may leave with one of the system-wide error codes.
   1.253 +	*/
   1.254 +	virtual void DoCloseSlaveL(TInt aHandle);
   1.255 +
   1.256 +	// original RMessage is supplied so that remote demux plugin can extract necessary details
   1.257 +	// using DeMux utility
   1.258 +
   1.259 +	/**
   1.260 +	Relay the synchronous custom command onto the slave
   1.261 +	@param aMessage
   1.262 +		   The IPC message to be sent to the slave
   1.263 +	@leave This method may leave with one of the system-wide error codes.
   1.264 +	@return The result of the operation
   1.265 +	*/
   1.266 +	virtual TInt DoSendSlaveSyncCommandL(const RMmfIpcMessage& aMessage);
   1.267 +
   1.268 +	/**
   1.269 +	Relay the synchronous custom command onto the slave and obtain a result
   1.270 +	@param aMessage
   1.271 +		   The IPC message to be sent to the slave
   1.272 +	@leave This method may leave with one of the system-wide error codes.
   1.273 +	@return The result of the operation
   1.274 +	*/
   1.275 +	virtual TInt DoSendSlaveSyncCommandResultL(const RMmfIpcMessage& aMessage);
   1.276 +
   1.277 +	/**
   1.278 +	Relay an asynchronous command onto the slave
   1.279 +	@param aMessage
   1.280 +		   The IPC message to be sent to the slave
   1.281 +	@leave This method may leave with one of the system-wide error codes.
   1.282 +	*/
   1.283 +	virtual void DoSendSlaveAsyncCommandL(const RMmfIpcMessage& aMessage);
   1.284 +
   1.285 +	/**
   1.286 +	Relay an asynchronous command onto the slave and obtain a result
   1.287 +	@param aMessage
   1.288 +		   The IPC message to be sent to the slave@param aMessage
   1.289 +	@leave This method may leave with one of the system-wide error codes.
   1.290 +	*/
   1.291 +	virtual void DoSendSlaveAsyncCommandResultL(const RMmfIpcMessage& aMessage);
   1.292 +
   1.293 +protected:
   1.294 +	~CMMFEAacPlusDecoderDeMux();
   1.295 +	CMMFEAacPlusDecoderDeMux();
   1.296 +
   1.297 +	// mirrors MEAacPlusDecoderIntfc methods.
   1.298 +	void DoSetInputSamplingFrequency(TUint aInputSamplingFrequency);
   1.299 +	void DoSetAudioObjectType(MEAacPlusDecoderIntfc::TAudioObjectType aAudioObjectType);
   1.300 +	void DoSetNumOfChannels(TUint aNumOfChannels);
   1.301 +	void DoSetSbr(TBool aSbrEnabled);
   1.302 +	void DoSetDownSampledMode(TBool aDsmEnabled);
   1.303 +	TInt DoApplyConfig();
   1.304 +	TInt DoGetInputSamplingFrequency(TUint& aInputSamplingFrequency);
   1.305 +	TInt DoGetAudioObjectType(MEAacPlusDecoderIntfc::TAudioObjectType& aAudioObjectType);
   1.306 +	TInt DoGetNumOfChannels(TUint& aNumOfChannels);
   1.307 +	TInt DoGetSbr(TBool& aSbrEnabled);
   1.308 +	TInt DoGetDownSampledMode(TBool& aDsmEnabled);
   1.309 +	
   1.310 +protected:
   1.311 +	MMMFDevSoundCustomInterfaceDeMuxUtility* iUtility;
   1.312 +	MMMFDevSoundCustomInterfaceTarget* iTarget;
   1.313 +	TUid iDestructorKey;
   1.314 +	MEAacPlusDecoderIntfc* iInterfaceEAacPlusDecoder;
   1.315 +	};
   1.316 +
   1.317 +#endif