devsound/devsoundpluginsupport/src/CustomInterfaces/aacdecoderconfigci.h
changeset 0 79dd3e2336a0
equal deleted inserted replaced
-1:000000000000 0:79dd3e2336a0
       
     1 // Copyright (c) 2007-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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Implementation of aac decoder config custom interface pair
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef AACDECODERCONFIGCI_H
       
    19 #define AACDECODERCONFIGCI_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <mmf/common/mmfipc.h>
       
    23 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    24 #include <mmf/common/mmfipcserver.h>
       
    25 #endif
       
    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 
       
    31 /**
       
    32 Enum to represent the method called by this custom interface
       
    33 @internalComponent
       
    34 @prototype
       
    35 @file
       
    36 */
       
    37 enum TMMFDevSoundCIAacDecoderConfigCommands
       
    38 	{
       
    39 	EMMFDevSoundCIAacDecoderConfigSetAudioConfig				= 0,
       
    40 	EMMFDevSoundCIAacDecoderConfigGetSupportedAudioConfig		= 1,
       
    41 	EMMFDevSoundCIAacDecoderConfigGetSupportedAudioConfigArray
       
    42 	};
       
    43 
       
    44 
       
    45 /**
       
    46 Implementation of the Aac decoder config custom interface Mux
       
    47 @internalComponent
       
    48 @prototype
       
    49 @file
       
    50 */
       
    51 class CMMFAacDecoderConfigMux : public CBase,
       
    52 								public MMMFDevSoundCustomInterfaceMuxPlugin,
       
    53 								public MAacDecoderConfig
       
    54 	{
       
    55 public:
       
    56 
       
    57 	// from MMMFDevSoundCustomInterfaceMuxPlugin
       
    58 	/**
       
    59 	Attempt to open the interface.
       
    60 	@param  aInterfaceId
       
    61 		    The UID of the interface to open.
       
    62 	@return one of the system wide error codes
       
    63 	*/
       
    64 	virtual TInt OpenInterface(TUid aInterfaceId);
       
    65 
       
    66 	/**
       
    67 	Equivalent to destructor.  Called to destroy plugin.
       
    68 	*/
       
    69 	virtual void Release();
       
    70 
       
    71 	/**
       
    72 	Pass destructor key.
       
    73 	Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
       
    74 	@param aDestructorKey
       
    75 		   The Uid returned by REComSession::CreateImplementationL() or similar
       
    76 	*/
       
    77 	virtual void PassDestructorKey(TUid aDestructorKey);
       
    78 
       
    79 	/**
       
    80 	Complete construction.
       
    81 	Pass additional values from the construction phase, used subsequently by the plugin.
       
    82 	@param aCustomUtility
       
    83 		   The custom interface utility used by the plugin to communicate with the remote
       
    84 		   server side DeMux plugin
       
    85 	@leave This method may leave with one of the system-wide error codes.
       
    86 	*/
       
    87 	virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceMuxUtility* aCustomUtility);
       
    88 
       
    89 	/**
       
    90 	Return the custom interface
       
    91 	@param  aInterfaceId
       
    92 		    The UID of the required custom interface
       
    93 	@return the custom interface supported by this plugin
       
    94 	*/
       
    95 	virtual TAny* CustomInterface(TUid aInterfaceId);
       
    96 
       
    97 	/**
       
    98 	Instantiate a CI Mux class
       
    99 	@return the pointer to the new class, cast to the Mux plugin mixin
       
   100 	@leave  This method may leave with one of the system-wide error codes.
       
   101 	*/
       
   102 	static MMMFDevSoundCustomInterfaceMuxPlugin* NewL();
       
   103 
       
   104 	// from MAacDecoderConfig
       
   105 	//@see MAacDecoderConfig
       
   106 	virtual TInt SetAudioConfig(TAudioConfig& aAudioConfig);
       
   107 	//@see MAacDecoderConfig
       
   108 	virtual TInt GetSupportedAudioConfigs(RArray<TAudioConfig>& aSupportedAudioConfigs);
       
   109 
       
   110 protected:
       
   111 	CMMFAacDecoderConfigMux();
       
   112 	~CMMFAacDecoderConfigMux();
       
   113 
       
   114 protected:
       
   115 	TUid iKey;
       
   116 	TInt iRemoteHandle;
       
   117 	MMMFDevSoundCustomInterfaceMuxUtility* iUtility;
       
   118 	};
       
   119 
       
   120 
       
   121 /**
       
   122 Implementation of the Aac decoder config custom interface DeMux
       
   123 @internalComponent
       
   124 @prototype
       
   125 @file
       
   126 */
       
   127 class CMMFAacDecoderConfigDeMux : public CBase,
       
   128 								  public MMMFDevSoundCustomInterfaceDeMuxPlugin
       
   129 	{
       
   130 public:
       
   131 	/**
       
   132 	Instantiate a CMMFAacDecoderConfigDeMux class
       
   133 	@return a pointer to the new class cast to the DeMux plugin mixin
       
   134 	@leave  This method may leave with one of the system-wide error codes.
       
   135 	*/
       
   136 	static MMMFDevSoundCustomInterfaceDeMuxPlugin* NewL();
       
   137 		
       
   138 	/**
       
   139 	Attempt to open the interface.
       
   140 	@param  aInterfaceId
       
   141 		    The UID of the interface to open.
       
   142 	@return a handle to the remote plugin
       
   143 	*/
       
   144 	virtual TInt OpenInterface(TUid aInterfaceId);
       
   145 
       
   146 	/**
       
   147 	Equivalent to destructor.  Called to destroy plugin.
       
   148 	*/
       
   149 	virtual void Release();
       
   150 
       
   151 	/**
       
   152 	Pass destructor key.
       
   153 	Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
       
   154 	@param aDestructorKey
       
   155 		   The Uid returned by REComSession::CreateImplementationL() or similar
       
   156 	*/
       
   157 	virtual void PassDestructorKey(TUid aDestructorKey);
       
   158 
       
   159 	/**
       
   160 	Set the target of the custom interface call
       
   161 	@param aTarget
       
   162 		   The DevSound to call the custom interface on.
       
   163 	*/
       
   164 	virtual void SetInterfaceTarget(MMMFDevSoundCustomInterfaceTarget* aTarget);
       
   165 
       
   166 	/**
       
   167 	Complete construction.
       
   168 	@param aUtility
       
   169 		   The DeMux utility to use
       
   170 	@leave This method may leave with one of the system-wide error codes.
       
   171 	*/
       
   172 	virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceDeMuxUtility* aUtility);
       
   173 
       
   174 	/**
       
   175 	Refresh the current custom interface connections
       
   176 	@leave This method may leave with one of the system-wide error codes.
       
   177 	*/
       
   178 	virtual void RefreshL();
       
   179 
       
   180 	// from MMMFDevSoundCustomInterfaceDeMuxPlugin
       
   181 	/**
       
   182 	Open the slave
       
   183 	@param  aInterface
       
   184 		    The UID of the requested interface
       
   185 	@param  aPackageBuf
       
   186 		    A package of data that can be supplied for initialisation
       
   187 	@return the result of the operation
       
   188 	@leave  This method may leave with one of the system-wide error codes.
       
   189 	*/
       
   190 	virtual TInt DoOpenSlaveL(TUid aInterface, const TDesC8& aPackageBuf);
       
   191 
       
   192 	/**
       
   193 	Close the slave
       
   194 	@param aHandle
       
   195 		   The handle of the slave plugin
       
   196 	@leave This method may leave with one of the system-wide error codes.
       
   197 	*/
       
   198 	virtual void DoCloseSlaveL(TInt aHandle);
       
   199 
       
   200 	// original RMessage is supplied so that remote DeMux plugin can extract necessary details
       
   201 	// using DeMux utility
       
   202 
       
   203 	/**
       
   204 	Relay the synchronous custom command onto the slave
       
   205 	@param  aMessage
       
   206 		    The IPC message to be sent to the slave
       
   207 	@return the result of the operation
       
   208 	@leave  This method may leave with one of the system-wide error codes.
       
   209 	*/
       
   210 	virtual TInt DoSendSlaveSyncCommandL(const RMmfIpcMessage& aMessage);
       
   211 
       
   212 	/**
       
   213 	Relay the synchronous custom command onto the slave and obtain a result
       
   214 	@param  aMessage
       
   215 		    The IPC message to be sent to the slave
       
   216 	@return the result of the operation
       
   217 	@leave  This method may leave with one of the system-wide error codes.
       
   218 	*/
       
   219 	virtual TInt DoSendSlaveSyncCommandResultL(const RMmfIpcMessage& aMessage);
       
   220 
       
   221 	/**
       
   222 	Relay an asynchronous command onto the slave
       
   223 	@param aMessage
       
   224 		   The IPC message to be sent to the slave
       
   225 	@leave This method may leave with one of the system-wide error codes.
       
   226 	*/
       
   227 	virtual void DoSendSlaveAsyncCommandL(const RMmfIpcMessage& aMessage);
       
   228 
       
   229 	/**
       
   230 	Relay an asynchronous command onto the slave and obtain a result
       
   231 	@param aMessage
       
   232 		   The IPC message to be sent to the slave@param aMessage
       
   233 	@leave This method may leave with one of the system-wide error codes.
       
   234 	*/
       
   235 	virtual void DoSendSlaveAsyncCommandResultL(const RMmfIpcMessage& aMessage);
       
   236 
       
   237 protected:
       
   238 	~CMMFAacDecoderConfigDeMux();
       
   239 	CMMFAacDecoderConfigDeMux();
       
   240 
       
   241 	// from mirror MAacDecoderConfig method.
       
   242 	TInt DoSetAudioConfigL(MAacDecoderConfig::TAudioConfig& aAudioConfig);
       
   243 	TInt DoGetSupportedAudioConfigsL(RArray<MAacDecoderConfig::TAudioConfig>& aSupportedAudioConfigs);
       
   244 
       
   245 private:
       
   246 	void DoCopyAudioConfigsBufferToClientL(const RMmfIpcMessage& aMessage);
       
   247 
       
   248 protected:
       
   249 	MMMFDevSoundCustomInterfaceDeMuxUtility* iUtility;
       
   250 	MMMFDevSoundCustomInterfaceTarget*		 iTarget;
       
   251 	TUid									 iKey;
       
   252 	MAacDecoderConfig*						 iInterfaceAacDecoderConfig;
       
   253 	RArray<MAacDecoderConfig::TAudioConfig>	 iSupportedAudioConfigs;
       
   254 	};
       
   255 
       
   256 #endif