epoc32/include/mmf/server/devsoundstandardcustominterfaces.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
williamr@2
     1
// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@2
     4
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
williamr@2
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
//
williamr@2
    15
williamr@2
    16
#ifndef __DEVSOUNDSTANDARDCUSTOMINTERFACES_H__
williamr@2
    17
#define __DEVSOUNDSTANDARDCUSTOMINTERFACES_H__
williamr@2
    18
williamr@2
    19
#include <e32std.h>
williamr@2
    20
williamr@2
    21
/*****************************************************************************/
williamr@2
    22
/**
williamr@2
    23
UID associated with the custom interface MMMFDevSoundCustomInterfaceBitRate.
williamr@2
    24
@publishedAll
williamr@2
    25
@released
williamr@2
    26
*/
williamr@2
    27
const TUid KUidCustomInterfaceDevSoundBitRate = {0x101F7DD5};
williamr@2
    28
williamr@2
    29
williamr@2
    30
williamr@2
    31
/**
williamr@2
    32
This class provides an interface to set and retrive the DevSound bit rate.
williamr@2
    33
williamr@2
    34
@publishedAll
williamr@2
    35
@released
williamr@2
    36
*/
williamr@2
    37
class MMMFDevSoundCustomInterfaceBitRate
williamr@2
    38
	{	
williamr@2
    39
public:
williamr@2
    40
	
williamr@2
    41
	/**
williamr@2
    42
	Gets the bit rates that are supported by DevSound in its current configuration.
williamr@2
    43
williamr@2
    44
	@param  aSupportedBitRates
williamr@2
    45
	The supported bit rates, in bits per second, shall be appended to this array. Note that 
williamr@2
    46
	the array shall be reset by this method.
williamr@2
    47
	*/
williamr@2
    48
	virtual void GetSupportedBitRatesL(RArray<TInt>& aSupportedBitRates) = 0;
williamr@2
    49
williamr@2
    50
	/**
williamr@2
    51
	Returns	the current bit rate.
williamr@2
    52
williamr@2
    53
	@return	The current bit rate, in bits per second.
williamr@2
    54
	*/
williamr@2
    55
	virtual TInt BitRateL() = 0;
williamr@2
    56
williamr@2
    57
	/**
williamr@2
    58
	Sets the bit rate to a new value.
williamr@2
    59
williamr@2
    60
	@param  aBitRate
williamr@2
    61
	The new bit rate, in bits per second.
williamr@2
    62
	*/
williamr@2
    63
	virtual void SetBitRateL(TInt aBitRate) = 0;
williamr@2
    64
	};
williamr@2
    65
williamr@2
    66
williamr@2
    67
/*****************************************************************************/
williamr@2
    68
/**
williamr@2
    69
UID associated with the Custom interface MMMFDevSoundCustomInterfaceFileBlockLength.
williamr@2
    70
williamr@2
    71
@publishedPartner
williamr@2
    72
@prototype
williamr@2
    73
williamr@2
    74
*/
williamr@2
    75
const TUid KUidCustomInterfaceDevSoundFileBlockLength = {0x10273806};
williamr@2
    76
williamr@2
    77
/**
williamr@2
    78
Custom interface class for setting the file's block length on the hwdevice. 
williamr@2
    79
williamr@2
    80
Note also that this interface is just a simple interface to 
williamr@2
    81
set file's block length. No checking is perfomed on the values sent (hence the
williamr@2
    82
Set methods do not return an error code).
williamr@2
    83
williamr@2
    84
@publishedPartner
williamr@2
    85
@prototype
williamr@2
    86
*/
williamr@2
    87
class MMMFDevSoundCustomInterfaceFileBlockLength
williamr@2
    88
	{
williamr@2
    89
public:
williamr@2
    90
	/**
williamr@2
    91
	Sets the file's block length on the hwdevice
williamr@2
    92
	@param aBlockAlign
williamr@2
    93
	       The file's block length 
williamr@2
    94
	*/
williamr@2
    95
	virtual void SetFileBlockLength(TUint aBlockAlign)=0;
williamr@2
    96
	};
williamr@2
    97
williamr@2
    98
/*****************************************************************************/
williamr@2
    99
/**
williamr@2
   100
UID associated with the Custom interface MMMFGsmConfig
williamr@2
   101
williamr@2
   102
@publishedPartner
williamr@2
   103
@prototype
williamr@2
   104
*/
williamr@2
   105
const TUid KUidGsmConfig = {0x102825FC};
williamr@2
   106
williamr@2
   107
/**
williamr@2
   108
This class provides an interface to set and retrive the GSM conversion format.
williamr@2
   109
williamr@2
   110
@publishedPartner
williamr@2
   111
@prototype
williamr@2
   112
*/
williamr@2
   113
class MMMFGsmConfig
williamr@2
   114
	{
williamr@2
   115
public: 
williamr@2
   116
	/** The GSM conversion format */
williamr@2
   117
	enum TMMFGsmConversionFormat
williamr@2
   118
		{
williamr@2
   119
		/** no conversion specified */
williamr@2
   120
		ENone, 
williamr@2
   121
		/** for use in Full rate (06.10) and half rate (GSM 06.20 Half Rate (HR)) Vocoder */
williamr@2
   122
		EALaw8bit, 
williamr@2
   123
		/** for use in Full rate (06.10) and half rate (GSM 06.20 Half Rate (HR)) Vocoder */
williamr@2
   124
		EULaw8bit,
williamr@2
   125
		/** for use in GSM 06.60 Enhanced Full Rate (EFR) Vocoder.*/
williamr@2
   126
		EAlawPCM
williamr@2
   127
		};
williamr@2
   128
		
williamr@2
   129
	/**
williamr@2
   130
	Set the conversion format using the TMMFGsmConversionFormat enum.
williamr@2
   131
	This conversion must be set before the coder/decoder is started.
williamr@2
   132
williamr@2
   133
	@param aConvFormat - format desired.  For encoding behaviour, format will 
williamr@2
   134
	be the input format and for decoding behaviour format will be the output 
williamr@2
   135
	format.
williamr@2
   136
williamr@2
   137
	@return KErrNone - Format change supported, KErrNotSupported - Format 
williamr@2
   138
	change not supported, KErrInUse - Format change attempted whilst decoding.
williamr@2
   139
	*/	
williamr@2
   140
	virtual TInt SetConversionFormat(TMMFGsmConversionFormat aConvFormat) = 0;
williamr@2
   141
williamr@2
   142
	/** 
williamr@2
   143
	Provides the current conversion format.  Can be called at any time.
williamr@2
   144
williamr@2
   145
	@param aConvFormat - after the call contains the current format.
williamr@2
   146
	For encoding behaviour, format will be the input format and for decoding
williamr@2
   147
	behaviour format will be the output format.
williamr@2
   148
williamr@2
   149
	@return KErrNone if value returned successfully, 
williamr@2
   150
			KErrUnknown if value has not been successfully configured using
williamr@2
   151
			SetConversionFormat() at least once for the current instance of the
williamr@2
   152
			interface and there is no default value.
williamr@2
   153
			KErrGeneral for all other error scenario.
williamr@2
   154
	*/
williamr@2
   155
	virtual TInt ConversionFormat(TMMFGsmConversionFormat& aConvFormat) const = 0;
williamr@2
   156
	};
williamr@2
   157
williamr@2
   158
williamr@2
   159
/*****************************************************************************/
williamr@2
   160
/**
williamr@2
   161
UID associated with the Custom interface MSpeechEncoderConfig
williamr@2
   162
williamr@2
   163
@publishedPartner
williamr@2
   164
@prototype
williamr@2
   165
*/
williamr@2
   166
const TUid KUidSpeechEncoderConfig = {0x102825FB};
williamr@2
   167
williamr@2
   168
/**
williamr@2
   169
This class provides an interface to those CMMFHwDevices providing speech encoding. 
williamr@2
   170
This interface is used for querying and configuring the operational modes of speech 
williamr@2
   171
encoders as supported by those specific encoders. 
williamr@2
   172
If a speech encoder does not support a mode provided by the interface, it will return KErrNotSupported.
williamr@2
   173
williamr@2
   174
@publishedPartner
williamr@2
   175
@prototype
williamr@2
   176
williamr@2
   177
*/
williamr@2
   178
class MSpeechEncoderConfig 
williamr@2
   179
	{
williamr@2
   180
public:
williamr@2
   181
	/**
williamr@2
   182
	Controls voice activity detection (VAD) mode.
williamr@2
   183
	This method can be called at all times - while actively encoding or not.
williamr@2
   184
	It should be noted that a VAD mode change could also instigate a change in the 
williamr@2
   185
	mode of encoding (fixed rate encoding versus variable rate) e.g. in cases where 
williamr@2
   186
	VAD requires variable rate encoding.
williamr@2
   187
	The effects of activating VAD mode behaviour should be documented in the 
williamr@2
   188
	CMMFHwDevice specification implementing it.
williamr@2
   189
williamr@2
   190
	@param aVadModeOn ETrue=On, EFalse=Off
williamr@2
   191
	@return KErrNone if successful. KErrNotSupported if this method is not implemented 
williamr@2
   192
	or not supported by the encoder. 
williamr@2
   193
	*/
williamr@2
   194
	virtual TInt SetVadMode(TBool aVadModeOn) = 0;
williamr@2
   195
williamr@2
   196
	/**
williamr@2
   197
	Gets the current state of the voice activity detection (VAD) mode.
williamr@2
   198
	This method can be called at all times - while actively encoding or not.
williamr@2
   199
williamr@2
   200
	@param aVadModeOn On output ETrue = On, EFalse = Off
williamr@2
   201
	@return KErrNone if successful, KErrNotSupported if this method is not implemented 
williamr@2
   202
	or not supported by the encoder. 
williamr@2
   203
	*/
williamr@2
   204
	virtual TInt GetVadMode(TBool& aVadModeOn) = 0;
williamr@2
   205
	};
williamr@2
   206
williamr@2
   207
/*****************************************************************************/
williamr@2
   208
/**
williamr@2
   209
UID associated with the Custom interface MAacDecoderConfig
williamr@2
   210
williamr@2
   211
@publishedPartner
williamr@2
   212
@prototype
williamr@2
   213
*/
williamr@2
   214
const TUid KUidAacDecoderConfig = {0x102825FD};
williamr@2
   215
williamr@2
   216
/**
williamr@2
   217
This class provides an interface to the AAC decoder CMMFHwDevice in order 
williamr@2
   218
to provide additional configuration information for decoding raw AAC data blocks. 
williamr@2
   219
williamr@2
   220
The sample rate can be configured via the CMMFHwDevice::SetConfig() method. 
williamr@2
   221
An extension mechanism will be provided for further functionality as required.
williamr@2
   222
The CMMFHwDevice does not contain Output channel configuration at time of writing. 
williamr@2
   223
The HWA decoders to date have been hardcoded for 2ch (left / right) output. 
williamr@2
   224
Additional configuration information may be provided by using extension mechanisms. 
williamr@2
   225
williamr@2
   226
@publishedPartner
williamr@2
   227
@prototype
williamr@2
   228
*/
williamr@2
   229
class MAacDecoderConfig 
williamr@2
   230
	{
williamr@2
   231
public: 
williamr@2
   232
williamr@2
   233
	/**
williamr@2
   234
	This is a class containing an enumerated type that defines the audio object types 
williamr@2
   235
	required for configuring the AAC decoder for decoding raw AACDefined within TAudioConfig.
williamr@2
   236
	*/
williamr@2
   237
	class TAudioConfig
williamr@2
   238
		{
williamr@2
   239
	public:
williamr@2
   240
		/**  The audio object type */
williamr@2
   241
	    enum TAudioObjectType
williamr@2
   242
	    	{
williamr@2
   243
			/** Null */
williamr@2
   244
	       	ENull    = 0,
williamr@2
   245
			/** AacMain */
williamr@2
   246
	       	EAacMain = 1,
williamr@2
   247
			/** AacLc */
williamr@2
   248
	       	EAacLc   = 2,
williamr@2
   249
			/** AacSsr */
williamr@2
   250
	       	EAacSsr  = 3,
williamr@2
   251
			/** AacLtp */
williamr@2
   252
	       	EAacLtp  = 4,
williamr@2
   253
			/** Sbr */
williamr@2
   254
	       	ESbr     = 5
williamr@2
   255
	       	};
williamr@2
   256
		TAudioObjectType iAudioObjectType;
williamr@2
   257
		};	
williamr@2
   258
williamr@2
   259
public:
williamr@2
   260
	/**
williamr@2
   261
	Sets additional configuration parameters required for decoding raw AAC. 
williamr@2
   262
williamr@2
   263
	This method can be called when encoding is not active - anytime before the CMMFHwDevice is started. 
williamr@2
   264
	
williamr@2
   265
	For consistent configuration, this method should be called sometime before each 
williamr@2
   266
	start is called on the CMMFHwDevice when decoding raw AAC. That is to say the 
williamr@2
   267
	CMMFHwDevice is not required to retain prior configuration information, detect raw 
williamr@2
   268
	AAC sent to it, and reconfigure the decoder with this saved information after stop 
williamr@2
   269
	is called on the CMMFHwDevice. However, calling pause on the CMMFHwDevice implies 
williamr@2
   270
	that the next start call will be resuming same content. For this condition, this API 
williamr@2
   271
	is not required when restarting the CMMFHwDevice.
williamr@2
   272
	
williamr@2
   273
	@param aAudioConfig The structure containing the additional information required for decoding the raw AAC.
williamr@2
   274
williamr@2
   275
	@return KErrNone if successful or KErrInUse if this method is used when decoding is active. 
williamr@2
   276
	*/
williamr@2
   277
	virtual TInt SetAudioConfig(TAudioConfig& aAudioConfig) = 0;
williamr@2
   278
williamr@2
   279
	/**
williamr@2
   280
	Gets additional configuration parameters supported for decoding raw AAC. 
williamr@2
   281
	
williamr@2
   282
	This method is allowable when encoding is not active - anytime before the CMMFHwDevice is started. 
williamr@2
   283
		
williamr@2
   284
	@param aSupportedAudioConfigs An array of structures containing the additional supported configurations.
williamr@2
   285
williamr@2
   286
	@return KErrNone if successful. 
williamr@2
   287
			KErrInUse if this method is used when decoding is active. 
williamr@2
   288
	*/
williamr@2
   289
	virtual TInt GetSupportedAudioConfigs(RArray<TAudioConfig>& aSupportedAudioConfigs) = 0;
williamr@2
   290
	};
williamr@2
   291
	
williamr@2
   292
/*****************************************************************************/
williamr@2
   293
/**
williamr@2
   294
UID associated with the Custom interface MEAacPlusDecoderIntfc
williamr@2
   295
williamr@2
   296
@publishedPartner
williamr@2
   297
@prototype
williamr@2
   298
*/
williamr@2
   299
const TUid KUidEAacPlusDecoderIntfc = {0x102825FF};
williamr@2
   300
williamr@2
   301
/**
williamr@2
   302
This class provides an interface to the eAAC+ decoder hwdevice in order to provide configuration information.
williamr@2
   303
williamr@2
   304
The Get.. methods can be used to retrieve the last successfully applied configuration parameters.  
williamr@2
   305
A message is not sent to adaptation or the decoder. Instead, a locally saved set of the 
williamr@2
   306
parameters will be updated upon successful use of ApplyConfig(). It is these saved values that 
williamr@2
   307
the proxy maintains that will be returned to the user. For instance, if two interfaces are used 
williamr@2
   308
and one interface is used to modify the settings, the other interface's Get… methods would not 
williamr@2
   309
return those settings.  The Get.. methods will return an error if a successful use of ApplyConfig() 
williamr@2
   310
has not been performed.
williamr@2
   311
williamr@2
   312
The Set.. methods are used to update a configuration structure within the implementation of the 
williamr@2
   313
interface. When the interface is instantiated, the state of SBR and Downsampled modes will be 
williamr@2
   314
disabled. Therefore it is not necessary to configure these parameters before using 
williamr@2
   315
ApplyConfig() the first time. However, once modified using this instance of the interface, they 
williamr@2
   316
remain in that state until Set.. again.  The values of these items are updated in an internal 
williamr@2
   317
structure when each Set.. is called. 
williamr@2
   318
williamr@2
   319
The ApplyConfig() method is used to configure the encoder with the parameters specified by 
williamr@2
   320
the Set.. methods. ApplyConfig will send back an error (KErrUnknown) if not all items are 
williamr@2
   321
Set at least once. This check and the parameter values returned will be implemented in the interface proxy 
williamr@2
   322
and will not query the actual decoder. The exception to this is for configuration parameters with defined 
williamr@2
   323
default values (see next paragraph). 
williamr@2
   324
williamr@2
   325
Calling ApplyConfig() will send these values using a single message to the message handler.
williamr@2
   326
ApplyConfig() should fail if it is used during decoding with a KErrInUse (or, as previously stated, 
williamr@2
   327
KErrUnknown if a value without a default is not set). Since the interface proxy is not aware of decoding state, 
williamr@2
   328
this check would have to be done in the adaptation implementation for this interface.
williamr@2
   329
williamr@2
   330
@publishedPartner
williamr@2
   331
@prototype
williamr@2
   332
*/
williamr@2
   333
class MEAacPlusDecoderIntfc 
williamr@2
   334
	{
williamr@2
   335
public:
williamr@2
   336
	/**
williamr@2
   337
	Defines additional configuration elements required to decode eAAC+.
williamr@2
   338
	*/
williamr@2
   339
	enum TAudioObjectType
williamr@2
   340
        {
williamr@2
   341
        /** Null */
williamr@2
   342
        ENull    = 0,
williamr@2
   343
        /** AacLc */
williamr@2
   344
        EAacLc   = 2,
williamr@2
   345
        /** AacLtp */
williamr@2
   346
        EAacLtp  = 4
williamr@2
   347
        };
williamr@2
   348
williamr@2
   349
	/**
williamr@2
   350
	Sets the value of the sampling frequency of the decoder to be configured by the ApplyConfig() 
williamr@2
   351
	method. This is the sample rate of the core decoder, not the output sampling frequency of the decoder.
williamr@2
   352
	This method can be called at all times but if ApplyConfig() is subsequently called 
williamr@2
   353
	after changing this value whilst decoding, a KErrInUse error will result.
williamr@2
   354
williamr@2
   355
	@param aInputSamplingFrequency  value of the sampling frequency. 
williamr@2
   356
	*/
williamr@2
   357
	virtual void SetInputSamplingFrequency(TUint aInputSamplingFrequency) = 0;
williamr@2
   358
williamr@2
   359
	/**
williamr@2
   360
	Sets the object type of the core decoder to be configured by the ApplyConfig() method.
williamr@2
   361
williamr@2
   362
	This method can be called at all times but if ApplyConfig() is subsequently called after 
williamr@2
   363
	changing this value whilst decoding, a KErrInUse error will result.
williamr@2
   364
williamr@2
   365
	@param  aAudioObjectType TAudioObjectType for core decoder as supported by the decoder.
williamr@2
   366
	*/
williamr@2
   367
	virtual void SetAudioObjectType(TAudioObjectType aAudioObjectType) = 0;
williamr@2
   368
	
williamr@2
   369
	/**
williamr@2
   370
	Sets the number of channels for the output of the decoder to be configured by the ApplyConfig() 
williamr@2
   371
	method. The use of this method is to ensure coordination of output channels rendered by the decoder 
williamr@2
   372
	and channel configuration of the audio system. This method does not imply that stereo to mono downmix 
williamr@2
   373
	is supported by the decoder. The main purpose is for the case considering the presence of PS. A user 
williamr@2
   374
	may not know if the decoder output will be mono or stereo based on header information alone, but may 
williamr@2
   375
	configure the decoder for two channel output to match the audio system configuration. If the user were 
williamr@2
   376
	to set the output to 1 channel and stereo data is present, the decoder may choose only one channel to 
williamr@2
   377
	output or to downmix the stereo to mono. Regarding this interface, it would be more desirable to configure 
williamr@2
   378
	the decoder when it is known to be mono source data and rely on downmix from the audio system instead of 
williamr@2
   379
	from the decoder. The decoder, however, would provide for duplicating mono data into 2 channel data when 
williamr@2
   380
	configured for 2 channels and the source data contains only 1 channel.
williamr@2
   381
	This method is allowable at all times - while actively encoding or not, but using ApplyConfig() 
williamr@2
   382
	if changing this value while encoding will return an error.
williamr@2
   383
		 
williamr@2
   384
	@param aNumOfChannels 1 - output one channel audio  = 0; 2 - output two channel audio.
williamr@2
   385
	 */
williamr@2
   386
	virtual void SetNumOfChannels(TUint aNumOfChannels) = 0;
williamr@2
   387
	
williamr@2
   388
	/**
williamr@2
   389
	Controls the SBR mode of the decoder to be configured by the ApplyConfig() method. 
williamr@2
   390
williamr@2
   391
	If SBR is enabled and no SBR data is present, the audio data will be upsampled, 
williamr@2
   392
	unless Down Sampled mode is enabled.
williamr@2
   393
williamr@2
   394
	This method can be called at all times but if ApplyConfig() is subsequently called 
williamr@2
   395
	after changing this value whilst decoding, a KErrInUse error will result.
williamr@2
   396
williamr@2
   397
	@param aSbrEnabled ETrue - SBR mode enabled, EFalse - SBR mode disabled 
williamr@2
   398
	*/
williamr@2
   399
	virtual void SetSbr(TBool aSbrEnabled) = 0;
williamr@2
   400
williamr@2
   401
	/**
williamr@2
   402
	Controls the downsampled mode of the decoder to be configured by the ApplyConfig() method. This setting is only meaningful if SBR is enabled.
williamr@2
   403
williamr@2
   404
	This method can be called at all times but if ApplyConfig() is subsequently called after 
williamr@2
   405
	changing this value whilst decoding, a KErrInUse error will result.
williamr@2
   406
		 
williamr@2
   407
	@param aDsmEnabled ETrue - downsampled mode enabled, EFalse - downsampled mode disabled.
williamr@2
   408
	*/
williamr@2
   409
	virtual void SetDownSampledMode(TBool aDsmEnabled) = 0;
williamr@2
   410
williamr@2
   411
	/**
williamr@2
   412
	Used to configure the decoder with parameters passed in the Set methods.
williamr@2
   413
williamr@2
   414
	This method can be called all times but will return an KErrInUse if the configuration 
williamr@2
   415
	parameters would change while decoding (as none of the set parameters can be changed 
williamr@2
   416
	during decoding). This checking operational state of the decoder would be done by the 
williamr@2
   417
	adaptation implementation of this interface since the interface proxy is not aware of 
williamr@2
   418
	the decoder state. The adaptation implementation will return an error if incorrect values 
williamr@2
   419
	are used to configure the decoder.
williamr@2
   420
williamr@2
   421
	@return KErrNone if successful, KErrNotSupported if this method is not implemented, 
williamr@2
   422
			KErrInUse if encoding in active and values are changed that are not allowed to be 
williamr@2
   423
			changed during encoding, KErrArgument if one of the configuration items is not appropriate or not set. 
williamr@2
   424
	*/
williamr@2
   425
	virtual TInt ApplyConfig() = 0;
williamr@2
   426
williamr@2
   427
	/**
williamr@2
   428
	Returns the value of the sampling frequency of the decoder that was last successfully 
williamr@2
   429
	configured by the ApplyConfig() method.
williamr@2
   430
	
williamr@2
   431
	This method can be called at all times but must be called after a value has been set via 
williamr@2
   432
	the ApplyConfig
williamr@2
   433
williamr@2
   434
	@param aInputSamplingFrequency last setting successfully applied using ApplyConfig().
williamr@2
   435
williamr@2
   436
	@return KErrNone if value returned successfully, 
williamr@2
   437
			KErrUnknown if value has not been successfully configured using ApplyConfig() at 
williamr@2
   438
			least once for the current instance of the interface or 
williamr@2
   439
			KErrInUse if the encoder is active.
williamr@2
   440
	*/
williamr@2
   441
	virtual TInt GetInputSamplingFrequency(TUint& aInputSamplingFrequency) = 0;
williamr@2
   442
	
williamr@2
   443
	/**
williamr@2
   444
	Returns the object type of the core decoder that was last successfully configured by the 
williamr@2
   445
	ApplyConfig() method.
williamr@2
   446
	
williamr@2
   447
	This method can be called at all times. 
williamr@2
   448
		 
williamr@2
   449
	@param aAudioObjectType last setting successfully applied using ApplyConfig().
williamr@2
   450
williamr@2
   451
	@return KErrNone if value returned successfully, 
williamr@2
   452
			KErrUnknown if value has not been successfully configured using ApplyConfig() 
williamr@2
   453
			at least once for the current instance of the interface.
williamr@2
   454
	*/
williamr@2
   455
	virtual TInt GetAudioObjectType(TAudioObjectType& aAudioObjectType) = 0;
williamr@2
   456
williamr@2
   457
	/**
williamr@2
   458
	Returns the number of channels that was last successfully configured by the 
williamr@2
   459
	ApplyConfig() method.
williamr@2
   460
williamr@2
   461
	This method can be called at all times. It will return an error if used before 
williamr@2
   462
	ApplyConfig() has been used successfully.
williamr@2
   463
williamr@2
   464
	@param aNumOfChannels last setting successfully applied using ApplyConfig().	 
williamr@2
   465
williamr@2
   466
	@return KErrNone if value returned successfully, 
williamr@2
   467
			KErrUnknown if value has not been successfully configured using ApplyConfig() 
williamr@2
   468
			at least once for the current instance of the interface.
williamr@2
   469
	*/
williamr@2
   470
	virtual TInt GetNumOfChannels(TUint& aNumOfChannels) = 0;
williamr@2
   471
williamr@2
   472
	/**
williamr@2
   473
	Returns the SBR mode that was last successfully configured by the ApplyConfig() method.
williamr@2
   474
williamr@2
   475
	This method can be called at all times.  It will return an error if used before 
williamr@2
   476
	ApplyConfig() has been used successfully.
williamr@2
   477
williamr@2
   478
	@param aSbrEnabled last setting successfully applied using ApplyConfig().
williamr@2
   479
williamr@2
   480
	@return KErrNone if value returned successfully, 
williamr@2
   481
			KErrUnknown if value has not been successfully configured using ApplyConfig() 
williamr@2
   482
			at least once for the current instance of the interface.	 
williamr@2
   483
	*/
williamr@2
   484
	virtual TInt GetSbr(TBool& aSbrEnabled) = 0;
williamr@2
   485
	
williamr@2
   486
	/**
williamr@2
   487
	Returns the downsampled mode that was last successfully configured by the ApplyConfig() method.
williamr@2
   488
williamr@2
   489
	This method can be called at all times.  It will return an error if used before 
williamr@2
   490
	ApplyConfig() has been used successfully.
williamr@2
   491
williamr@2
   492
	@param aDsmEnabled last setting successfully applied using ApplyConfig().	 
williamr@2
   493
williamr@2
   494
	@return KErrNone if value returned successfully, 
williamr@2
   495
			KErrUnknown if value has not been successfully configured using ApplyConfig() at least 
williamr@2
   496
			once for the current instance of the interface.
williamr@2
   497
	*/
williamr@2
   498
	virtual TInt GetDownSampledMode(TBool& aDsmEnabled) = 0;
williamr@2
   499
	};
williamr@2
   500
	
williamr@2
   501
/*****************************************************************************/
williamr@2
   502
/**
williamr@2
   503
UID associated with the Custom interface MSbcEncoderIntfc
williamr@2
   504
williamr@2
   505
@publishedPartner
williamr@2
   506
@prototype
williamr@2
   507
*/
williamr@2
   508
const TUid KUidSbcEncoderIntfc = {0x10282600};
williamr@2
   509
williamr@2
   510
/**
williamr@2
   511
This class provides an interface to the SBC encoder hwdevice in order to provide configuration information.
williamr@2
   512
williamr@2
   513
The Get... supported methods can be used to check capabilities of the encoder by retrieving 
williamr@2
   514
the last successfully applied configuration parameters. The purpose of the Get 
williamr@2
   515
functions is to return the last successfully applied configuration of decoder by this 
williamr@2
   516
interface. A message is not sent to adaptation or the decoder. Instead, a locally saved set 
williamr@2
   517
of the parameters will be updated upon successful use of ApplyConfig(). The Get.. methods 
williamr@2
   518
return an error (KErrUnknown ) if a successful use of ApplyConfig() has not been performed 
williamr@2
   519
apart from the following methods, which return the range of properties supported by the 
williamr@2
   520
implementation ( GetSupportedSamplingFrequencies, GetSupportedChannelModes, 
williamr@2
   521
GetSupportedNumOfSubbands, GetSupportedAllocationMethods, GetSupportedNumOfBlocks, 
williamr@2
   522
GetSupportedBitpoolRange).  These methods do not have setter functions as they are not 
williamr@2
   523
configurable and hence will return valid data at all times.
williamr@2
   524
williamr@2
   525
ApplyConfig() will send these values using one message with these values in the internally 
williamr@2
   526
defined structure. The message handler should define this structure in the SBC messages 
williamr@2
   527
header file.   ApplyConfig() should fail (KErrInUse) if it is used during encoding and any 
williamr@2
   528
values are changed other than bitpool value. Since the interface proxy is not aware of 
williamr@2
   529
encoding state, this check would have to be done in the adaptation implementation for 
williamr@2
   530
this interface.  The Bitpool can be updated during encoding to change the bitrate. This would 
williamr@2
   531
require the use of the SetBitpoolSize() and ApplyConfig() methods.  Any other parameters can 
williamr@2
   532
be changed but will result in a KErrInUse when ApplyConfig() is called.
williamr@2
   533
williamr@2
   534
The Set... methods are used update a client-side maintained configuration structure within the 
williamr@2
   535
implementation of the interface.  When the structure is completed, ApplyConfig() should be called 
williamr@2
   536
to send these client side settings to the actual hwdevice implementation.  There are no default 
williamr@2
   537
values for the configuration parameters (hence all values must be set before ApplyConfig() is 
williamr@2
   538
called or an error (KErrArgument) will result).
williamr@2
   539
williamr@2
   540
@note  This constraint is only true for configurations 
williamr@2
   541
where this is supported (e.g. If GetSupportedChannelModes returns KErrNotSupported then SetChannelMode 
williamr@2
   542
does not need to be set before ApplyConfig() is called). This check and the parameter values 
williamr@2
   543
returned will be implemented in the interface proxy and will not query the actual encoder. If 
williamr@2
   544
multiple instances of the interface are created, each would have this requirement.  
williamr@2
   545
williamr@2
   546
@publishedPartner
williamr@2
   547
@prototype
williamr@2
   548
*/
williamr@2
   549
class MSbcEncoderIntfc 
williamr@2
   550
	{
williamr@2
   551
public:
williamr@2
   552
	/**
williamr@2
   553
	Defines the channel modes for the SBC encoder
williamr@2
   554
	*/
williamr@2
   555
	enum TSbcChannelMode
williamr@2
   556
        {
williamr@2
   557
        /** SbcChannelMono */
williamr@2
   558
    	ESbcChannelMono,
williamr@2
   559
        /** SbcChannelDual */
williamr@2
   560
		ESbcChannelDual,
williamr@2
   561
        /** SbcChannelStereo */
williamr@2
   562
   	 	ESbcChannelStereo,
williamr@2
   563
        /** SbcChannelJointStereo */
williamr@2
   564
    	ESbcChannelJointStereo
williamr@2
   565
        };
williamr@2
   566
williamr@2
   567
	/**	
williamr@2
   568
	This type defines the allocation methods for the SBC encoder.
williamr@2
   569
	*/
williamr@2
   570
	enum TSbcAllocationMethod
williamr@2
   571
       	{
williamr@2
   572
        /** SbcAllocationSNR */
williamr@2
   573
    	ESbcAllocationSNR,
williamr@2
   574
        /** SbcAllocationLoudness */
williamr@2
   575
    	ESbcAllocationLoudness
williamr@2
   576
        };
williamr@2
   577
williamr@2
   578
	/**
williamr@2
   579
	Retrieves the sampling frequencies supported by the encoder. See the class comments for details.
williamr@2
   580
	This method can be called at all times.
williamr@2
   581
	
williamr@2
   582
	@param aSamplingFrequencies Reference to the location to store the array of supported 
williamr@2
   583
	sampling frequencies.
williamr@2
   584
	 
williamr@2
   585
	@return KErrNone if successful, KErrNotSupported if this method is not supported.
williamr@2
   586
	*/
williamr@2
   587
	virtual TInt GetSupportedSamplingFrequencies(RArray<TUint>& aSamplingFrequencies) = 0;
williamr@2
   588
	
williamr@2
   589
	/**
williamr@2
   590
	Retrieves the channel encoding supported by the encoder. See the class comments for details.
williamr@2
   591
	
williamr@2
   592
	This method can be called at all times.
williamr@2
   593
williamr@2
   594
	@param aChannelModes Reference to the location to store the array of supported channel encoding modes.
williamr@2
   595
williamr@2
   596
	@return KErrNone if successful, KErrNotSupported if this method is not supported.
williamr@2
   597
	*/
williamr@2
   598
	virtual TInt GetSupportedChannelModes(RArray<TSbcChannelMode>& aChannelModes) = 0;
williamr@2
   599
	
williamr@2
   600
	/**
williamr@2
   601
	Retrieves the number of subbands supported by the encoder. See the class comments for details.
williamr@2
   602
	
williamr@2
   603
	This method can be called at all times.
williamr@2
   604
williamr@2
   605
	@param aNumOfSubbands Reference to the location to store the array of supported number of subbands.
williamr@2
   606
williamr@2
   607
	@return KErrNone if successful, KErrNotSupported if this method is not supported.
williamr@2
   608
	*/
williamr@2
   609
	virtual TInt GetSupportedNumOfSubbands(RArray<TUint>& aNumOfSubbands) = 0; 
williamr@2
   610
williamr@2
   611
	/**
williamr@2
   612
	Retrieves the allocation methods supported by the encoder. See the class comments for details.
williamr@2
   613
	
williamr@2
   614
	This method can be called at all times.
williamr@2
   615
williamr@2
   616
	@param aAllocationMethods Reference to the location to store the array of supported allocation methods.
williamr@2
   617
williamr@2
   618
	@return KErrNone if successful, KErrNotSupported if this method is not supported.
williamr@2
   619
	*/
williamr@2
   620
	virtual TInt GetSupportedAllocationMethods(RArray<TSbcAllocationMethod>& aAllocationMethods) = 0;
williamr@2
   621
	
williamr@2
   622
	/**
williamr@2
   623
	Retrieves the number of blocks supported by the encoder. See the class comments for details.
williamr@2
   624
	
williamr@2
   625
	This method can be called at all times but if ApplyConfig() is subsequently called 
williamr@2
   626
	after changing this value whilst encoding, a KErrInUse error will result.
williamr@2
   627
williamr@2
   628
	@param aNumOfBlocks Reference to the location to store the array of supported number of blocks.
williamr@2
   629
williamr@2
   630
	@return KErrNone if successful, KErrNotSupported if this method is not supported.
williamr@2
   631
	*/
williamr@2
   632
	virtual TInt GetSupportedNumOfBlocks(RArray<TUint>& aNumOfBlocks) = 0;
williamr@2
   633
	
williamr@2
   634
	/**
williamr@2
   635
	Retrieves the min and max bitpool values supported by the encoder. See the class comments for details.
williamr@2
   636
	
williamr@2
   637
	This method can be called at all times but and ApplyConfig() can be called to change the value whilst encoding.
williamr@2
   638
williamr@2
   639
	@param aMinSupportedBitpoolSize minimum bitpool value allowed by the encoder.
williamr@2
   640
	@param aMaxSupportedBitpoolSize maximum bitpool value allowed by the encoder.
williamr@2
   641
williamr@2
   642
	@return KErrNone if successful, KErrNotSupported if this method is not supported.
williamr@2
   643
	*/
williamr@2
   644
	virtual TInt GetSupportedBitpoolRange(TUint& aMinSupportedBitpoolSize, TUint& aMaxSupportedBitpoolSize) = 0;
williamr@2
   645
williamr@2
   646
	/**
williamr@2
   647
	Sets the value of the sampling frequency of the encoder to be configured by the ApplyConfig() method.
williamr@2
   648
williamr@2
   649
	This method can be called at all times but if ApplyConfig() is subsequently called 
williamr@2
   650
	after changing this value whilst encoding, a KErrInUse error will result.
williamr@2
   651
williamr@2
   652
	@param aSamplingFrequency values according to standard and supported by encoder.
williamr@2
   653
 	*/
williamr@2
   654
	virtual void SetSamplingFrequency(TUint aSamplingFrequency) = 0;
williamr@2
   655
williamr@2
   656
	/**
williamr@2
   657
	Sets the channel mode of the encoder to be configured by the ApplyConfig() method. 
williamr@2
   658
	See the class comments for details.
williamr@2
   659
	
williamr@2
   660
	This method can be called at all times but if ApplyConfig() is subsequently called after 
williamr@2
   661
	changing this value whilst encoding, a KErrInUse error will result.
williamr@2
   662
williamr@2
   663
	@param aChannelMode (ESbcChannelMono, ESbcChannelDual, ESbcChannelStereo, 
williamr@2
   664
			ESbcChannelJointStereo) when supported by encoder.	 
williamr@2
   665
williamr@2
   666
	*/
williamr@2
   667
	virtual void SetChannelMode(TSbcChannelMode aChannelMode) = 0;
williamr@2
   668
williamr@2
   669
	/**
williamr@2
   670
	Sets the channel mode of the encoder to be configured by the ApplyConfig() method.  
williamr@2
   671
williamr@2
   672
	This method can be called at all times but if ApplyConfig() is subsequently called after 
williamr@2
   673
	changing this value whilst encoding, a KErrInUse error will result.
williamr@2
   674
williamr@2
   675
	@param aNumOfSubbands values according to standard and supported by encoder.	
williamr@2
   676
williamr@2
   677
	*/
williamr@2
   678
	virtual void SetNumOfSubbands(TUint aNumOfSubbands) = 0;
williamr@2
   679
williamr@2
   680
	/**
williamr@2
   681
	Sets the allocation method of the encoder to be configured by the ApplyConfig() method.
williamr@2
   682
williamr@2
   683
	This method can be called at all times but if ApplyConfig() is subsequently called after 
williamr@2
   684
	changing this value whilst encoding, a KErrInUse error will result.
williamr@2
   685
		 
williamr@2
   686
	@param aAllocationMethod ESbcAllocationSNR, ESbcAllocationLoudness when supported by encoder
williamr@2
   687
williamr@2
   688
	*/
williamr@2
   689
	virtual void SetAllocationMethod(TSbcAllocationMethod aAllocationMethod) = 0;
williamr@2
   690
williamr@2
   691
	/**
williamr@2
   692
	Sets the number of blocks of the encoder to be configured by the ApplyConfig() method.
williamr@2
   693
williamr@2
   694
	This method can be called at all times but if ApplyConfig() is subsequently called after 
williamr@2
   695
	changing this value whilst encoding, a KErrInUse error will result.
williamr@2
   696
		
williamr@2
   697
	@param aNumOfBlocks values according to standard and supported by encoder.	  	 
williamr@2
   698
	*/
williamr@2
   699
	virtual void SetNumOfBlocks(TUint aNumOfBlocks) = 0;
williamr@2
   700
	
williamr@2
   701
	/**
williamr@2
   702
	Sets the size of the bitpool of the encoder to be configured by the ApplyConfig() method.  
williamr@2
   703
williamr@2
   704
	This method is allowable at all times - while actively encoding or not.
williamr@2
   705
williamr@2
   706
	@param aBitpoolSize values according to standard and supported by encoder.
williamr@2
   707
williamr@2
   708
	*/
williamr@2
   709
	virtual void SetBitpoolSize(TUint aBitpoolSize) = 0;
williamr@2
   710
williamr@2
   711
	/**
williamr@2
   712
	Used to configure the encoder with parameters passed in the Set… methods.
williamr@2
   713
	This method can be called at all times - while actively encoding or not. 
williamr@2
   714
	An error (KErrInUse) will be returned if any configuration parameter, other 
williamr@2
   715
	than bitpool size, is changed while encoding. This checking operational 
williamr@2
   716
	state of the encoder would be done by the adaptation implementation of this 
williamr@2
   717
	interface since the interface proxy is not aware of the encoder state. Also, 
williamr@2
   718
	the adaptation implementation will return an error if incorrect values are 
williamr@2
   719
	used to configure the encoder.
williamr@2
   720
	
williamr@2
   721
	@note  Even though some preliminary checking is done in the set methods (to see 
williamr@2
   722
	if it is valid to set the values at all) it is expected that 
williamr@2
   723
williamr@2
   724
	@return KErrNone if successful, 
williamr@2
   725
			KErrNotSupported if this method is not implemented, 
williamr@2
   726
			KErrInUse if encoding in active and values are changed that are not 
williamr@2
   727
			allowed to be changed during encoding, 
williamr@2
   728
			KErrArgument if one of the configuration items is not appropriate or 
williamr@2
   729
			if all the values are not set (unless some of the values are not 
williamr@2
   730
			supported, in which case these values should be ignored).	 
williamr@2
   731
	*/
williamr@2
   732
	virtual TInt ApplyConfig() = 0;
williamr@2
   733
williamr@2
   734
	/**
williamr@2
   735
	Gets the value of the sampling frequency of the encoder that was last successfully 
williamr@2
   736
	configured by the ApplyConfig() method.
williamr@2
   737
williamr@2
   738
	This method can be called at all times - while actively encoding or not, but will 
williamr@2
   739
	return an error if used before ApplyConfig() has been used successfully.
williamr@2
   740
williamr@2
   741
	@param aSamplingFrequency last setting successfully applied using ApplyConfig().
williamr@2
   742
williamr@2
   743
	@return KErrNone if value returned successfully, 
williamr@2
   744
			KErrUnknown if value has not been successfully configured using ApplyConfig() 
williamr@2
   745
			at least once for the current instance of the interface, 
williamr@2
   746
			KErrNotSupported if this method is not implemented (to match its set and 
williamr@2
   747
			getsupported methods).
williamr@2
   748
	*/
williamr@2
   749
	virtual TInt GetSamplingFrequency(TUint& aSamplingFrequency) = 0;
williamr@2
   750
williamr@2
   751
	/**
williamr@2
   752
	Gets the channel mode of the encoder that was last successfully configured by the 
williamr@2
   753
	ApplyConfig() method.
williamr@2
   754
williamr@2
   755
	This method can be called at all times - while actively encoding or not, but will 
williamr@2
   756
	return an error if used before ApplyConfig() has been used successfully.
williamr@2
   757
williamr@2
   758
	@param aChannelMode last setting successfully applied using ApplyConfig(). 
williamr@2
   759
williamr@2
   760
	@return KErrNone if value returned successfully, 
williamr@2
   761
			KErrUnknown if value has not been successfully configured using ApplyConfig() 
williamr@2
   762
			at least once for the current instance of the interface.
williamr@2
   763
	*/
williamr@2
   764
	virtual TInt GetChannelMode(TSbcChannelMode& aChannelMode) = 0;
williamr@2
   765
williamr@2
   766
	/**
williamr@2
   767
	Gets the channel mode of the encoder that was last successfully configured by the 
williamr@2
   768
	ApplyConfig() method.
williamr@2
   769
williamr@2
   770
	This method can be called at all times - while actively encoding or not, 
williamr@2
   771
	but will return an error if used before ApplyConfig() has been used successfully.
williamr@2
   772
		 
williamr@2
   773
	@param aNumOfSubbands last setting successfully applied using ApplyConfig().
williamr@2
   774
	
williamr@2
   775
	@return KErrNone if value returned successfully, 
williamr@2
   776
			KErrUnknown if value has not been successfully configured using ApplyConfig() 
williamr@2
   777
			at least once for the current instance of the interface, 
williamr@2
   778
			KErrNotSupported if this method is not implemented (to match its set and 
williamr@2
   779
			getsupported methods)
williamr@2
   780
	*/
williamr@2
   781
	virtual TInt GetNumOfSubbands(TUint& aNumOfSubbands) = 0;
williamr@2
   782
	
williamr@2
   783
	/**
williamr@2
   784
	Gets the number of blocks of the encoder that was last successfully configured by 
williamr@2
   785
	the ApplyConfig() method.
williamr@2
   786
williamr@2
   787
	This method can be called at all times - while actively encoding or not, but will 
williamr@2
   788
	return an error if used before ApplyConfig() has been used successfully.
williamr@2
   789
williamr@2
   790
	@param aNumOfBlocks last setting successfully applied using ApplyConfig().
williamr@2
   791
williamr@2
   792
	@return KErrNone if value returned successfully, 
williamr@2
   793
			KErrUnknown if value has not been successfully configured using ApplyConfig() 
williamr@2
   794
			at least once for the current instance of the interface, 
williamr@2
   795
			KErrNotSupported if this method is not implemented (to match its set and 
williamr@2
   796
			getsupported methods)
williamr@2
   797
	*/
williamr@2
   798
	virtual TInt GetNumOfBlocks(TUint& aNumOfBlocks) = 0;
williamr@2
   799
williamr@2
   800
	/**
williamr@2
   801
	Gets the allocation method of the encoder that was last successfully configured 
williamr@2
   802
	by the ApplyConfig() method.
williamr@2
   803
williamr@2
   804
	This method can be called at all times - while actively encoding or not, but will 
williamr@2
   805
	return an error if used before ApplyConfig() has been used successfully.
williamr@2
   806
	@param aAllocationMethod last setting successfully applied using ApplyConfig().
williamr@2
   807
williamr@2
   808
	@return KErrNone if value returned successfully, 
williamr@2
   809
			KErrUnknown if value has not been successfully configured using ApplyConfig() 
williamr@2
   810
			at least once for the current instance of the interface, 
williamr@2
   811
			KErrNotSupported if this method is not implemented (to match its set and 
williamr@2
   812
			getsupported methods).
williamr@2
   813
	*/
williamr@2
   814
	virtual TInt GetAllocationMethod(TSbcAllocationMethod& aAllocationMethod) = 0;
williamr@2
   815
williamr@2
   816
	/**
williamr@2
   817
	Gets the size of the bitpool of the encoder that was last successfully 
williamr@2
   818
	configured by the ApplyConfig() method.
williamr@2
   819
williamr@2
   820
	This method can be called at all times - while actively encoding or not, but 
williamr@2
   821
	will return an error if used before ApplyConfig() has been used successfully.
williamr@2
   822
williamr@2
   823
	@param aBitpoolSize last setting successfully applied using ApplyConfig().
williamr@2
   824
williamr@2
   825
	@return KErrNone if value returned successfully, 
williamr@2
   826
			KErrUnknown if value has not been successfully configured using ApplyConfig() 
williamr@2
   827
			at least once for the current instance of the interface, 
williamr@2
   828
			KErrNotSupported if this method is not implemented (to match its set and 
williamr@2
   829
			getsupported methods).
williamr@2
   830
	*/
williamr@2
   831
	virtual TInt GetBitpoolSize(TUint& aBitpoolSize) = 0;
williamr@2
   832
	}; 
williamr@2
   833
williamr@2
   834
/*****************************************************************************/
williamr@2
   835
/**
williamr@2
   836
UID associated with the Custom interface MG711DecoderIntfc
williamr@2
   837
williamr@2
   838
@publishedPartner
williamr@2
   839
@prototype
williamr@2
   840
*/
williamr@2
   841
const TUid KUidG711DecoderIntfc = {0x10282601};
williamr@2
   842
williamr@2
   843
/**
williamr@2
   844
This class provides an interface to the G711 decoder CMMFHwDevice in order to provide 
williamr@2
   845
additional configuration information.
williamr@2
   846
williamr@2
   847
@publishedPartner
williamr@2
   848
@prototype
williamr@2
   849
*/
williamr@2
   850
class MG711DecoderIntfc 
williamr@2
   851
	{
williamr@2
   852
public:
williamr@2
   853
	/** The Decoder mode */
williamr@2
   854
	enum TDecodeMode
williamr@2
   855
        {
williamr@2
   856
        /** DecALaw */
williamr@2
   857
        EDecALaw,
williamr@2
   858
        /** DecULaw */
williamr@2
   859
        EDecULaw
williamr@2
   860
        };
williamr@2
   861
williamr@2
   862
	/**
williamr@2
   863
	Informs the decoder of the encoded data format that will be sent to it.
williamr@2
   864
williamr@2
   865
	This method can be called when decoding is not active - anytime before started 
williamr@2
   866
	or after stopped. 
williamr@2
   867
	@param 	aDecodeMode the decode mode.
williamr@2
   868
williamr@2
   869
	@return KErrNone if successful. 
williamr@2
   870
			KErrInUse if this method is used when encoding is active. 
williamr@2
   871
			KErrNotSupported if this method is not implemented. 
williamr@2
   872
	*/
williamr@2
   873
	virtual TInt SetDecoderMode(TDecodeMode aDecodeMode) = 0;
williamr@2
   874
	
williamr@2
   875
	/**
williamr@2
   876
	Queries the decoder of the encoded data format that has been active.
williamr@2
   877
williamr@2
   878
	This method can be called at all times.
williamr@2
   879
	@param 	aDecodeMode the decode mode.
williamr@2
   880
williamr@2
   881
	@return KErrNone if successful. 
williamr@2
   882
			KErrInUse if this method is used when encoding is active. 
williamr@2
   883
			KErrNotSupported if this method is not implemented. 
williamr@2
   884
	*/
williamr@2
   885
	virtual TInt GetDecoderMode(TDecodeMode& aDecodeMode) = 0;
williamr@2
   886
williamr@2
   887
	/** 	
williamr@2
   888
	Used to enable and disable the comfort noise generation capability.
williamr@2
   889
williamr@2
   890
	This method can be called when decoding is not active - anytime before started 
williamr@2
   891
	or after stopped. 
williamr@2
   892
	
williamr@2
   893
	@param 	aCng ETrue = Comfort Noise Generation enabled; EFalse = Comfort Noise 
williamr@2
   894
	Generation disabled
williamr@2
   895
	
williamr@2
   896
	@return	KErrNone if successful. 
williamr@2
   897
			KErrInUse if this method is used when encoding is active. 
williamr@2
   898
			KErrNotSupported if this method is not implemented. 
williamr@2
   899
	*/
williamr@2
   900
	virtual TInt SetComfortNoiseGeneration(TBool aCng) = 0;
williamr@2
   901
williamr@2
   902
	/** 	
williamr@2
   903
	Used to find out if comfort noise generation is enabled or not.
williamr@2
   904
williamr@2
   905
	This method can be called when decoding is not active - anytime before started 
williamr@2
   906
	or after stopped. 
williamr@2
   907
williamr@2
   908
	@param 	aCng ETrue = Comfort Noise Generation enabled; EFalse = Comfort Noise 
williamr@2
   909
	Generation disabled
williamr@2
   910
williamr@2
   911
	@return	KErrNone if successful. 
williamr@2
   912
			KErrInUse if this method is used when encoding is active. 
williamr@2
   913
			KErrNotSupported if this method is not implemented. 
williamr@2
   914
	*/
williamr@2
   915
	virtual TInt GetComfortNoiseGeneration(TBool& aCng) = 0;
williamr@2
   916
williamr@2
   917
	/**
williamr@2
   918
	Used to enable and disable the packet loss concealment capability.
williamr@2
   919
williamr@2
   920
	This can be called when decoding is not active - anytime before started or after 
williamr@2
   921
	stopped. 
williamr@2
   922
williamr@2
   923
	@param	aPlc ETrue = plc enabled; EFalse = plc disabled
williamr@2
   924
williamr@2
   925
	@return KErrNone if successful. KErrInUse if this method is used when encoding is 
williamr@2
   926
	active. KErrNotSupported if this method is not implemented.
williamr@2
   927
	*/
williamr@2
   928
	virtual TInt SetPacketLossConcealment(TBool aPlc) = 0;
williamr@2
   929
williamr@2
   930
	/** 	
williamr@2
   931
	Used to find out if packet loss concealment capability is enabled or not.
williamr@2
   932
williamr@2
   933
	This method can be called when decoding is not active - anytime before started or 
williamr@2
   934
	after stopped. 
williamr@2
   935
williamr@2
   936
	@param 	aPlc ETrue = packet loss concealment enabled; EFalse = packet loss 
williamr@2
   937
	concealment disabled
williamr@2
   938
williamr@2
   939
	@return	KErrNone if successful. KErrInUse if this method is used when encoding is active. 
williamr@2
   940
			KErrNotSupported if this method is not implemented. 
williamr@2
   941
	*/
williamr@2
   942
	virtual TInt GetPacketLossConcealment(TBool& aPlc) = 0;
williamr@2
   943
williamr@2
   944
	};
williamr@2
   945
	
williamr@2
   946
/*****************************************************************************/
williamr@2
   947
/**
williamr@2
   948
UID associated with the Custom interface MG711EncoderIntfc
williamr@2
   949
williamr@2
   950
@publishedPartner
williamr@2
   951
@prototype
williamr@2
   952
*/
williamr@2
   953
const TUid KUidG711EncoderIntfc = {0x10282602};
williamr@2
   954
williamr@2
   955
/**
williamr@2
   956
This class provides an interface to the G711 encoder CMMFHwDevice in order to provide 
williamr@2
   957
additional configuration information.
williamr@2
   958
williamr@2
   959
@publishedPartner
williamr@2
   960
@prototype
williamr@2
   961
*/
williamr@2
   962
class MG711EncoderIntfc 
williamr@2
   963
	{
williamr@2
   964
public:
williamr@2
   965
	/** The encoder mode */
williamr@2
   966
	enum TEncodeMode
williamr@2
   967
        {
williamr@2
   968
        /** EncALaw */
williamr@2
   969
        EEncALaw,
williamr@2
   970
        /** EncULaw */
williamr@2
   971
        EEncULaw
williamr@2
   972
        };
williamr@2
   973
williamr@2
   974
	/** 	
williamr@2
   975
	Configures the encoder's encoding format.
williamr@2
   976
williamr@2
   977
	This method can be called when decoding is not active - anytime before started or 
williamr@2
   978
	after stopped. 
williamr@2
   979
williamr@2
   980
	@param 	aEncodeMode the encode mode.
williamr@2
   981
williamr@2
   982
	@return	KErrNone if successful. KErrInUse if this method is used when encoding is active. 
williamr@2
   983
			KErrNotSupported if this method is not implemented. 
williamr@2
   984
	*/
williamr@2
   985
	virtual TInt SetEncoderMode(TEncodeMode aEncodeMode) = 0;
williamr@2
   986
williamr@2
   987
	/** 	
williamr@2
   988
	Controls voice activity detection (VAD) mode.
williamr@2
   989
williamr@2
   990
	This method can be called at all times.
williamr@2
   991
williamr@2
   992
	@param 	aVadModeOn ETrue=On, EFalse=Off
williamr@2
   993
williamr@2
   994
	@return	KErrNone if successful, 
williamr@2
   995
			KErrNotSupported if this method is not implemented or not supported by the encoder
williamr@2
   996
	*/
williamr@2
   997
	virtual TInt SetVadMode(TBool aVadModeOn) = 0;
williamr@2
   998
williamr@2
   999
	/** 
williamr@2
  1000
	Gets the current state of the voice activity detection (VAD) mode.
williamr@2
  1001
williamr@2
  1002
	This method can be called at all times - while actively encoding or not.
williamr@2
  1003
williamr@2
  1004
	@param 	aVadModeOn On output ETrue=On, EFalse=Off
williamr@2
  1005
williamr@2
  1006
	@return	KErrNone if successful. 
williamr@2
  1007
			KErrNotSupported if this method is not implemented or VAD is not supported by the encoder. 
williamr@2
  1008
	*/
williamr@2
  1009
	virtual TInt GetVadMode(TBool& aVadModeOn) = 0;
williamr@2
  1010
	};
williamr@2
  1011
williamr@2
  1012
/*****************************************************************************/
williamr@2
  1013
/**
williamr@2
  1014
UID associated with the Custom interface MG729DecoderIntfc
williamr@2
  1015
williamr@2
  1016
@publishedPartner
williamr@2
  1017
@prototype
williamr@2
  1018
*/
williamr@2
  1019
const TUid KUidG729DecoderIntfc = {0x10282603};
williamr@2
  1020
williamr@2
  1021
/**
williamr@2
  1022
This class provides an interface to the G729 decoder CMMFHwDevice in order to provide additional 
williamr@2
  1023
configuration information.
williamr@2
  1024
williamr@2
  1025
@publishedPartner
williamr@2
  1026
@prototype
williamr@2
  1027
*/
williamr@2
  1028
class MG729DecoderIntfc
williamr@2
  1029
	{
williamr@2
  1030
public:
williamr@2
  1031
	/**
williamr@2
  1032
	Informs the decoder that the next buffer sent to it will contain bad LSF data.
williamr@2
  1033
williamr@2
  1034
	This method can be called when decoding is active.
williamr@2
  1035
 
williamr@2
  1036
	This method will be called after a buffer has been received from the CMMFHwDevice, 
williamr@2
  1037
	and before it is returned to the CMMFHwDevice.
williamr@2
  1038
williamr@2
  1039
	@return	KErrNone if successful. 
williamr@2
  1040
			KErrInUse if this method is used out of sequence. 
williamr@2
  1041
			KErrNotSupported if this method is not implemented. 
williamr@2
  1042
	*/
williamr@2
  1043
	virtual	TInt BadLsfNextBuffer() = 0;
williamr@2
  1044
	};
williamr@2
  1045
williamr@2
  1046
/*****************************************************************************/
williamr@2
  1047
/**
williamr@2
  1048
UID associated with the Custom interface MG729EncoderIntfc
williamr@2
  1049
williamr@2
  1050
@publishedPartner
williamr@2
  1051
@prototype
williamr@2
  1052
*/
williamr@2
  1053
const TUid KUidG729EncoderIntfc = {0x10282604};
williamr@2
  1054
williamr@2
  1055
/**
williamr@2
  1056
This class provides an interface to the G729 encoder CMMFHwDevice in order to provide 
williamr@2
  1057
additional configuration information.
williamr@2
  1058
williamr@2
  1059
@publishedPartner
williamr@2
  1060
@prototype
williamr@2
  1061
*/
williamr@2
  1062
class MG729EncoderIntfc
williamr@2
  1063
	{
williamr@2
  1064
public:
williamr@2
  1065
	/** 
williamr@2
  1066
	Controls voice activity detection (VAD) mode.
williamr@2
  1067
williamr@2
  1068
	This method is allowable at all times - while actively encoding or not.
williamr@2
  1069
	@param 	aVadModeOn ETrue=On, EFalse=Off
williamr@2
  1070
williamr@2
  1071
	@return	KErrNone if successful. KErrNotSupported if this method is not implemented 
williamr@2
  1072
	or not supported by the encoder. 
williamr@2
  1073
	*/
williamr@2
  1074
	virtual TInt SetVadMode(TBool aVadModeOn) = 0;
williamr@2
  1075
williamr@2
  1076
	/**
williamr@2
  1077
	Gets the current state of the voice activity detection (VAD) mode.
williamr@2
  1078
williamr@2
  1079
	This method can be called at all times - while actively encoding or not.
williamr@2
  1080
williamr@2
  1081
	@param 	aVadModeOn On output ETrue=On, EFalse=Off
williamr@2
  1082
	@return	KErrNone if successful. KErrNotSupported if this method is not implemented 
williamr@2
  1083
	or VAD is not supported by the encoder. 
williamr@2
  1084
	*/
williamr@2
  1085
	virtual TInt GetVadMode(TBool& aVadModeOn) = 0;
williamr@2
  1086
	};
williamr@2
  1087
williamr@2
  1088
/*****************************************************************************/
williamr@2
  1089
/**
williamr@2
  1090
UID associated with the Custom interface MIlbcDecoderIntfc
williamr@2
  1091
williamr@2
  1092
@publishedPartner
williamr@2
  1093
@prototype
williamr@2
  1094
*/
williamr@2
  1095
const TUid KUidIlbcDecoderIntfc = {0x10282605};
williamr@2
  1096
williamr@2
  1097
/**
williamr@2
  1098
This class provides an interface to the Ilbc decoder CMMFHwDevice in order to provide 
williamr@2
  1099
additional configuration information.
williamr@2
  1100
williamr@2
  1101
@publishedPartner
williamr@2
  1102
@prototype
williamr@2
  1103
*/
williamr@2
  1104
class MIlbcDecoderIntfc
williamr@2
  1105
	{
williamr@2
  1106
public:
williamr@2
  1107
	/** The Ibc decoder mode */
williamr@2
  1108
	enum TDecodeMode
williamr@2
  1109
        {
williamr@2
  1110
        /** 20msFrame */
williamr@2
  1111
        E20msFrame,
williamr@2
  1112
        /** 30msFrame */
williamr@2
  1113
        E30msFrame
williamr@2
  1114
        };
williamr@2
  1115
williamr@2
  1116
	/**
williamr@2
  1117
	Informs the decoder of the encoded data format that will be sent to it.
williamr@2
  1118
williamr@2
  1119
	This method can be called when decoding is not active - anytime before started or 
williamr@2
  1120
	after stopped. 
williamr@2
  1121
williamr@2
  1122
	@param 	aDecodeMode the decode mode.
williamr@2
  1123
williamr@2
  1124
	@return	KErrNone if successful. 
williamr@2
  1125
			KErrInUse if this method is used when decoding is active. 
williamr@2
  1126
			KErrNotSupported if this method is not implemented.
williamr@2
  1127
	*/
williamr@2
  1128
	virtual TInt SetDecoderMode(TDecodeMode aDecodeMode) = 0;
williamr@2
  1129
williamr@2
  1130
	/**
williamr@2
  1131
	Used to enable and disable the comfort noise generation capability.
williamr@2
  1132
williamr@2
  1133
	This method is allowable when decoding is not active - anytime before started or 
williamr@2
  1134
	after stopped. 
williamr@2
  1135
williamr@2
  1136
	@param 	aCng ETrue = comfort noise generation enabled; EFalse = comfort noise 
williamr@2
  1137
	generation disabled
williamr@2
  1138
williamr@2
  1139
	@return	KErrNone if successful. 
williamr@2
  1140
			KErrInUse if this method is used when encoding is active. 
williamr@2
  1141
			KErrNotSupported if this method is not implemented. 
williamr@2
  1142
	*/
williamr@2
  1143
	virtual TInt SetComfortNoiseGeneration(TBool aCng) = 0;
williamr@2
  1144
williamr@2
  1145
	/**
williamr@2
  1146
	Used to find out if comfort noise generation is enabled or not.
williamr@2
  1147
williamr@2
  1148
	This method is allowable when decoding is not active - anytime before started or 
williamr@2
  1149
	after stopped. 
williamr@2
  1150
williamr@2
  1151
	@param 	aCng On output ETrue = comfort noise generation enabled; EFalse = comfort 
williamr@2
  1152
	noise generation disabled
williamr@2
  1153
williamr@2
  1154
	@return	KErrNone if successful. 
williamr@2
  1155
			KErrInUse if this method is used when encoding is active. 
williamr@2
  1156
			KErrNotSupported if this method is not implemented. 
williamr@2
  1157
	*/
williamr@2
  1158
	virtual TInt GetComfortNoiseGeneration(TBool& aCng) = 0;
williamr@2
  1159
	};
williamr@2
  1160
williamr@2
  1161
/*****************************************************************************/
williamr@2
  1162
/**
williamr@2
  1163
UID associated with the Custom interface MIlbcEncoderIntfc
williamr@2
  1164
williamr@2
  1165
@publishedPartner
williamr@2
  1166
@prototype
williamr@2
  1167
*/
williamr@2
  1168
const TUid KUidIlbcEncoderIntfc = {0x10282606};
williamr@2
  1169
williamr@2
  1170
/**
williamr@2
  1171
This class provides an interface to the Ilbc encoder CMMFHwDevice in order to provide 
williamr@2
  1172
additional configuration information.
williamr@2
  1173
williamr@2
  1174
@publishedPartner
williamr@2
  1175
@prototype
williamr@2
  1176
*/
williamr@2
  1177
class MIlbcEncoderIntfc
williamr@2
  1178
	{
williamr@2
  1179
public:
williamr@2
  1180
	/** The Ibc encoder mode*/
williamr@2
  1181
	enum TEncodeMode
williamr@2
  1182
        {
williamr@2
  1183
        /** 20msFrame */
williamr@2
  1184
        E20msFrame,
williamr@2
  1185
        /** 30msFrame */
williamr@2
  1186
        E30msFrame
williamr@2
  1187
        };
williamr@2
  1188
williamr@2
  1189
	/**
williamr@2
  1190
	Configures the encoder's encoding format.
williamr@2
  1191
williamr@2
  1192
	This method is allowable when encoding is not active - anytime before started or 
williamr@2
  1193
	after stopped. 
williamr@2
  1194
williamr@2
  1195
	@param 	aEncodeMode the encode mode.
williamr@2
  1196
williamr@2
  1197
	@return	KErrNone if successful. 
williamr@2
  1198
			KErrInUse if this method is used when encoding is active. 
williamr@2
  1199
			KErrNotSupported if this method is not implemented. 
williamr@2
  1200
	*/
williamr@2
  1201
	virtual TInt SetEncoderMode(TEncodeMode aEncodeMode) = 0;
williamr@2
  1202
williamr@2
  1203
	/**
williamr@2
  1204
	Controls voice activity detection (VAD) mode.
williamr@2
  1205
williamr@2
  1206
	This method is allowable at all times - while actively encoding or not.
williamr@2
  1207
williamr@2
  1208
	@param 	aVadModeOn ETrue=On, EFalse=Off
williamr@2
  1209
williamr@2
  1210
	@return	KErrNone if successful. 
williamr@2
  1211
			KErrNotSupported if this method is not implemented or not supported by the encoder. 
williamr@2
  1212
	*/
williamr@2
  1213
	virtual TInt SetVadMode(TBool aVadModeOn) = 0;
williamr@2
  1214
williamr@2
  1215
	/**
williamr@2
  1216
	Gets the encoder's current encoding format.
williamr@2
  1217
williamr@2
  1218
	This method is allowable when encoding is not active - anytime before started or 
williamr@2
  1219
	after stopped. 
williamr@2
  1220
williamr@2
  1221
	@param 	&aEncodeMode the encode mode.
williamr@2
  1222
williamr@2
  1223
	@return	KErrNone if successful. 
williamr@2
  1224
			KErrInUse if this method is used when encoding is active. 
williamr@2
  1225
			KErrNotSupported if this method is not implemented. 
williamr@2
  1226
	*/
williamr@2
  1227
	virtual TInt GetEncoderMode(TEncodeMode &aEncodeMode) = 0;
williamr@2
  1228
williamr@2
  1229
	/**
williamr@2
  1230
	Gets the current state of the voice activity detection (VAD) mode.
williamr@2
  1231
williamr@2
  1232
	This method is allowable at all times - while actively encoding or not.
williamr@2
  1233
williamr@2
  1234
	@param 	aVadModeOn On output ETrue=On, EFalse=Off
williamr@2
  1235
williamr@2
  1236
	@return	KErrNone if successful. 
williamr@2
  1237
			KErrNotSupported if this method is not implemented or VAD is not supported 
williamr@2
  1238
			by the encoder. 
williamr@2
  1239
	*/
williamr@2
  1240
	virtual TInt GetVadMode(TBool& aVadModeOn) = 0;
williamr@2
  1241
	};
williamr@2
  1242
williamr@2
  1243
/*****************************************************************************/
williamr@2
  1244
/**
williamr@2
  1245
UID associated with the Custom interface MMMFErrorConcealmentIntfc
williamr@2
  1246
williamr@2
  1247
@publishedPartner
williamr@2
  1248
@prototype
williamr@2
  1249
*/
williamr@2
  1250
const TUid KUidErrorConcealmentIntfc = {0x10282607};
williamr@2
  1251
williamr@2
  1252
/**
williamr@2
  1253
This custom interface can be used to indicate that data has been lost. Typical usage 
williamr@2
  1254
would be during streaming. Lost packets of audio data would not get played, but the 
williamr@2
  1255
video data may still be available for playback. If video playback is synchronized to 
williamr@2
  1256
audio then this API can be used to indicate that audio data is lost so that video 
williamr@2
  1257
playback can continue. It could also be used for an audio-only source to maintain 
williamr@2
  1258
synchronization in time if data is lost.
williamr@2
  1259
williamr@2
  1260
@publishedPartner
williamr@2
  1261
@prototype
williamr@2
  1262
*/
williamr@2
  1263
class MMMFErrorConcealmentIntfc
williamr@2
  1264
	{
williamr@2
  1265
public:
williamr@2
  1266
	/**
williamr@2
  1267
	Indicates that next buffer sent to CMMFHwDevice will not contain any valid data, 
williamr@2
  1268
	and that a single frame of data has been lost, and that error concealment should 
williamr@2
  1269
	be provided for that lost frame. This method will be called after a buffer has been 
williamr@2
  1270
	received from the Hardware Device, and before it is returned to the Hardware Device.
williamr@2
  1271
williamr@2
  1272
	@return	KErrNone if successful. 
williamr@2
  1273
			KErrInUse if this method is used out of sequence. 
williamr@2
  1274
			KErrNotSupported if this method is not implemented.
williamr@2
  1275
	*/
williamr@2
  1276
	virtual TInt ConcealErrorForNextBuffer() = 0;
williamr@2
  1277
	/**
williamr@2
  1278
	Puts the CMMFHwDevice into frame-based operation. This may be required in cases where
williamr@2
  1279
	 the decoder only supports error concealment in a frame-based mode of operation. 
williamr@2
  1280
	 Operating in frame-based mode means that the decoder requires that each buffer it 
williamr@2
  1281
	 receives contains only complete data frames. 
williamr@2
  1282
williamr@2
  1283
	Frame mode is limited to a single frame per buffer. The alternative to frame-based mode 
williamr@2
  1284
	is buffer-based mode, the default interface for CMMFHwDevices and decoders. 
williamr@2
  1285
williamr@2
  1286
	In buffer-based mode, complete data frames are not required to be contained within a 
williamr@2
  1287
	single buffer. A data frame may span consecutive data buffers in buffer-based mode. 
williamr@2
  1288
williamr@2
  1289
	As it is less efficient than buffer-based mode, Frame-based mode should be used as a 
williamr@2
  1290
	less-preferred option where errors are present and the CMMFHwDevice implementation would 
williamr@2
  1291
	not be tolerant to buffer-based mode error.  This condition would be indicated by 
williamr@2
  1292
	FrameModeRqrdForEC resulting in its parameter being set to ETrue.
williamr@2
  1293
  
williamr@2
  1294
	This method can be called when decoding is not active - anytime before the CMMFHwDevice 
williamr@2
  1295
	is started, or after it is stopped.
williamr@2
  1296
williamr@2
  1297
	@param	aFrameModeOn ETrue = frame mode on; EFalse = frame mode off.
williamr@2
  1298
	
williamr@2
  1299
	@return KErrNone if successful. 
williamr@2
  1300
			KErrInUse if this method is used out of sequence. 
williamr@2
  1301
			KErrNotSupported if this method is not implemented.	
williamr@2
  1302
	*/
williamr@2
  1303
	virtual TInt SetFrameMode(TBool aFrameModeOn) = 0;
williamr@2
  1304
williamr@2
  1305
	/**
williamr@2
  1306
	Queries the CMMFHwDevice to find out if frame mode is required by the implementing 
williamr@2
  1307
	CMMFHwDevice in order for it to support error concealment.
williamr@2
  1308
	
williamr@2
  1309
	This method is allowable when decoding is not active - anytime before the CMMFHwDevice 
williamr@2
  1310
	is started, or after it is stopped.
williamr@2
  1311
	@param	aFrameModeRqrd ETrue = frame mode required; EFalse = frame mode not required
williamr@2
  1312
	@return	KErrNone if successful. 
williamr@2
  1313
			KErrInUse if this method is used during decoding. 
williamr@2
  1314
			KErrNotSupported if this method is not implemented. 
williamr@2
  1315
	*/
williamr@2
  1316
	virtual TInt FrameModeRqrdForEC(TBool& aFrameModeRqrd) = 0;
williamr@2
  1317
	};
williamr@2
  1318
williamr@2
  1319
/*****************************************************************************/
williamr@2
  1320
/**
williamr@2
  1321
UID associated with the Custom interface MAudioVibraControl
williamr@2
  1322
williamr@2
  1323
@publishedPartner
williamr@2
  1324
@prototype
williamr@2
  1325
*/
williamr@2
  1326
const TUid KUidAudioVibraControl = {0x10282608};
williamr@2
  1327
williamr@2
  1328
/**
williamr@2
  1329
This class provides an interface for controlling vibra. DevSound should interpret the 
williamr@2
  1330
instantiation of this interface as a vibra control request by the user. The default vibra 
williamr@2
  1331
behavior implemented by the DevSound for the associated stream will not be performed while 
williamr@2
  1332
the user has control, In other words whilst this interface is instantiated. DevSound default vibra behavior 
williamr@2
  1333
for the associated stream will return once this interface is deleted. Other instances of 
williamr@2
  1334
DevSound may be instantiated for other audio streams at the same time. When multiple instances 
williamr@2
  1335
of DevSound are instantiated, priority and preference values are used to determine which audio 
williamr@2
  1336
streams are rendered. Prioritization of vibra control is determined by adaptation. Due to 
williamr@2
  1337
resource conflicts, and prioritization by adaptation, it may be possible that an audio stream 
williamr@2
  1338
is played, but not the vibra that accompanies that audio. For instance, if audio is mixed and 
williamr@2
  1339
two audio streams are rendered, vibra playback might not be mixed. Vibra playback may be 
williamr@2
  1340
prioritized by adaptation to a single controller. The behavior in these cases would be based 
williamr@2
  1341
on adaptation implementation. The user is not notified if vibra is not played.
williamr@2
  1342
williamr@2
  1343
@publishedPartner
williamr@2
  1344
@prototype
williamr@2
  1345
*/
williamr@2
  1346
class MAudioVibraControl 
williamr@2
  1347
	{
williamr@2
  1348
public:
williamr@2
  1349
	/** 
williamr@2
  1350
	Turns vibra on.
williamr@2
  1351
williamr@2
  1352
	@return	KErrNone if successful KErrNotSupported if this method is not implemented.	
williamr@2
  1353
	*/
williamr@2
  1354
	virtual TInt StartVibra() = 0;
williamr@2
  1355
	
williamr@2
  1356
	/** 
williamr@2
  1357
	Turns vibra off.
williamr@2
  1358
	
williamr@2
  1359
	@return	KErrNone if successful. KErrNotSupported if this method is not implemented.	
williamr@2
  1360
	*/
williamr@2
  1361
	virtual TInt StopVibra() = 0;
williamr@2
  1362
	};
williamr@2
  1363
williamr@2
  1364
/*****************************************************************************/
williamr@2
  1365
/**
williamr@2
  1366
UID associated with the Custom interface MMMFSampleBuffering
williamr@2
  1367
williamr@2
  1368
@publishedPartner
williamr@2
  1369
@prototype
williamr@2
  1370
*/
williamr@2
  1371
const TUid KUidSampleBuffering = {0x10282609};
williamr@2
  1372
williamr@2
  1373
/**
williamr@2
  1374
Custom interface class to allow DevSound to support buffering of samples before playback begins. 
williamr@2
  1375
This allows playback to be more robust to underflow errors when playback begins at the expense 
williamr@2
  1376
of higher latency before playback starts.
williamr@2
  1377
williamr@2
  1378
@publishedPartner
williamr@2
  1379
@prototype
williamr@2
  1380
*/
williamr@2
  1381
class MMMFSampleBuffering
williamr@2
  1382
	{
williamr@2
  1383
public:
williamr@2
  1384
	/**
williamr@2
  1385
	Enables buffering up of samples before playback begins. This function is only effective before 
williamr@2
  1386
	CMMFDevSound::PlayInit() is called - calling the function after this will have no effect.
williamr@2
  1387
	@return  "This method may return one of the system-wide error codes."
williamr@2
  1388
	*/
williamr@2
  1389
	virtual TInt MmsbEnableSampleBufferingBeforePlayback() = 0;
williamr@2
  1390
	
williamr@2
  1391
	/**
williamr@2
  1392
	Disables buffering up of samples before playback begins. This function is only effective before 
williamr@2
  1393
	CMMFDevSound::PlayInit() is called - calling the function after this will have no effect.
williamr@2
  1394
	@return  "This method may return one of the system-wide error codes."
williamr@2
  1395
	*/
williamr@2
  1396
	virtual TInt MmsbDisableSampleBufferingBeforePlayback() = 0;
williamr@2
  1397
williamr@2
  1398
	/**
williamr@2
  1399
	Asynchronous request that completes when Playback actually starts.
williamr@2
  1400
	@param	"aStatus" "TRequestStatus that will be completed when play actually starts"
williamr@2
  1401
	*/
williamr@2
  1402
	virtual void MmsbNotifyPlayStarted(TRequestStatus& aStatus) = 0;
williamr@2
  1403
williamr@2
  1404
	/**
williamr@2
  1405
	Cancel any outstanding asynchronous NotifyPlayStarted requests.
williamr@2
  1406
	*/
williamr@2
  1407
	virtual void MmsbCancelNotifyPlayStarted() = 0;
williamr@2
  1408
	};
williamr@2
  1409
williamr@2
  1410
/*****************************************************************************/
williamr@2
  1411
/**
williamr@2
  1412
UID associated with the Custom interface MMMFPlaybackStatus.
williamr@2
  1413
williamr@2
  1414
@publishedPartner
williamr@2
  1415
@prototype
williamr@2
  1416
*/
williamr@2
  1417
const TUid KUidPlaybackStatus = {0x10273811};
williamr@2
  1418
williamr@2
  1419
/**
williamr@2
  1420
Custom interface class to enable access to the DevSound implementation to report the number of 
williamr@2
  1421
consumed input bytes, number of successfully decoded samples, samples played, system time and
williamr@2
  1422
total samples played.
williamr@2
  1423
williamr@2
  1424
@publishedPartner
williamr@2
  1425
@prototype
williamr@2
  1426
*/	
williamr@2
  1427
class MMMFPlaybackStatus
williamr@2
  1428
	{
williamr@2
  1429
public:
williamr@2
  1430
	/**  Play back status information */
williamr@2
  1431
	struct TMMFPlaybackStatus
williamr@2
  1432
		{
williamr@2
  1433
		/** Number of consumed input bytes */
williamr@2
  1434
		TInt64	aInputBytes;	
williamr@2
  1435
		/** Number of successfully decoded samples */
williamr@2
  1436
		TInt64	aDecodedSamples;		 
williamr@2
  1437
		/** Number of decoded samples played */
williamr@2
  1438
		TInt64	aDecodedSamplesPlayed;	
williamr@2
  1439
		/** Current system time */
williamr@2
  1440
		TInt64	aSystemTime;
williamr@2
  1441
		/**  Total samples played */
williamr@2
  1442
		TInt64 aTotalSamplesPlayed;
williamr@2
  1443
		};
williamr@2
  1444
	/**
williamr@2
  1445
	A method to query for detailed status information from a playing DevSound.
williamr@2
  1446
	including timestamp information from the DSP.
williamr@2
  1447
	@param  aStatus the current playback status.
williamr@2
  1448
	@return  "This method may return one of the system-wide error codes."
williamr@2
  1449
	*/
williamr@2
  1450
	virtual TInt MmpsGetPlaybackStatusInformation(TMMFPlaybackStatus& aStatus)= 0;
williamr@2
  1451
williamr@2
  1452
	/**
williamr@2
  1453
	Request notification of loss of sync during decode - the notification will be received 
williamr@2
  1454
	in the DevSound client callback SendEventToClient with the	event type set to KMMFEventLossOfDecodeSync. 
williamr@2
  1455
	
williamr@2
  1456
	@return  "This method may return one of the system-wide error codes."
williamr@2
  1457
	*/
williamr@2
  1458
	virtual TInt MmpsRequestLossOfSyncNotification() = 0;
williamr@2
  1459
	
williamr@2
  1460
	/**
williamr@2
  1461
	Cancel the request for notification of loss of sync.
williamr@2
  1462
	
williamr@2
  1463
	@return  "This method may return one of the system-wide error codes."
williamr@2
  1464
	*/
williamr@2
  1465
	virtual TInt MmpsCancelLossOfSyncNotification() = 0;
williamr@2
  1466
	};
williamr@2
  1467
williamr@2
  1468
/*****************************************************************************/
williamr@2
  1469
/**
williamr@2
  1470
UID associated with the Custom interface MMMFDSPControl
williamr@2
  1471
williamr@2
  1472
@publishedPartner
williamr@2
  1473
@prototype
williamr@2
  1474
*/
williamr@2
  1475
const TUid KUidDSPControl = {0x1028260A};
williamr@2
  1476
williamr@2
  1477
/**
williamr@2
  1478
Custom interface class to allow control of DSP behaviour.
williamr@2
  1479
williamr@2
  1480
@publishedPartner
williamr@2
  1481
@prototype
williamr@2
  1482
*/		
williamr@2
  1483
class MMMFDSPControl
williamr@2
  1484
	{
williamr@2
  1485
public:
williamr@2
  1486
	
williamr@2
  1487
	/**
williamr@2
  1488
	Get the timestamp information from the DSP
williamr@2
  1489
	
williamr@2
  1490
	@param aSamplesPlayed - number of audio samples played so far.
williamr@2
  1491
	@param aSystemTime - current system time 
williamr@2
  1492
	@param aB - bytes consumed by the decoder
williamr@2
  1493
	@param aT - bytes successfully decoded by the decoder.
williamr@2
  1494
williamr@2
  1495
	@return  "This method may return one of the system-wide error codes."
williamr@2
  1496
	*/
williamr@2
  1497
	virtual TInt MmdspcGetAudioPlaybackInfo(TInt64& aSamplesPlayed, TInt64& aSystemTime, TUint& aB, TUint& aT) = 0;
williamr@2
  1498
williamr@2
  1499
	/**
williamr@2
  1500
	Place DevSound in a mode where overflow/underflow errors on recording are ignored.
williamr@2
  1501
	@return "This method may return one of the system-wide error codes."
williamr@2
  1502
	*/
williamr@2
  1503
	virtual TInt MmdspcAcceptRecordBuffersInvalidFollowingStop() = 0;
williamr@2
  1504
williamr@2
  1505
	/**
williamr@2
  1506
	Place DevSound in a mode where overflow/underflow errors on playing are ignored.
williamr@2
  1507
	@return "This method may return one of the system-wide error codes."
williamr@2
  1508
	*/
williamr@2
  1509
	virtual TInt MmdspcAcceptPlaybackBuffersInvalidFollowingStop() = 0;
williamr@2
  1510
	};
williamr@2
  1511
	
williamr@2
  1512
/*****************************************************************************/
williamr@2
  1513
/**
williamr@2
  1514
UID associated with the Custom interface MMMFUnderflowAutoStopControl
williamr@2
  1515
williamr@2
  1516
@publishedPartner
williamr@2
  1517
@prototype
williamr@2
  1518
*/
williamr@2
  1519
const TUid KUidUnderflowAutoStopControl = {0x1028260B};
williamr@2
  1520
williamr@2
  1521
/**
williamr@2
  1522
Custom interface class to control underflow behaviour.
williamr@2
  1523
williamr@2
  1524
@publishedPartner
williamr@2
  1525
@prototype
williamr@2
  1526
*/	
williamr@2
  1527
class MMMFUnderflowAutoStopControl
williamr@2
  1528
	{	
williamr@2
  1529
public:
williamr@2
  1530
	/**
williamr@2
  1531
	Turn off the default DevSound behaviour of automatically Stopping when an underflow 
williamr@2
  1532
	occurs. The underflow will be reported but play can continue when the client sends 
williamr@2
  1533
	more data - it is up to the client to call stop even in the case of end of file.
williamr@2
  1534
	
williamr@2
  1535
	@return  "This method may return one of the system-wide error codes."
williamr@2
  1536
	*/
williamr@2
  1537
	virtual TInt MmuascTurnOffUnderflowAutoStop() = 0;
williamr@2
  1538
	};
williamr@2
  1539
williamr@2
  1540
/*****************************************************************************/
williamr@2
  1541
/**
williamr@2
  1542
UID associated with the Custom interface MMMFSetDRMProtected
williamr@2
  1543
williamr@2
  1544
@publishedPartner
williamr@2
  1545
@prototype
williamr@2
  1546
*/
williamr@2
  1547
const TUid KUidSetDRMProtected = {0x1028260C};
williamr@2
  1548
williamr@2
  1549
/**
williamr@2
  1550
This class provides an interface to mark data being played as DRM protected.
williamr@2
  1551
williamr@2
  1552
@publishedPartner
williamr@2
  1553
@prototype
williamr@2
  1554
*/	
williamr@2
  1555
class MMMFSetDRMProtected
williamr@2
  1556
	{
williamr@2
  1557
public:
williamr@2
  1558
	/**
williamr@2
  1559
	Indicate whether the data being played is DRM protected or not
williamr@2
  1560
	 
williamr@2
  1561
	@param  aDRMProtected the required DRM state.
williamr@2
  1562
	@return  "This method may return one of the system-wide error codes."
williamr@2
  1563
	*/
williamr@2
  1564
	virtual TInt MmsdpMarkDataAsDRMProtected(TBool aDRMProtected) = 0;
williamr@2
  1565
	};
williamr@2
  1566
williamr@2
  1567
/*****************************************************************************/
williamr@2
  1568
/**
williamr@2
  1569
UID associated with the Custom interface MMMFBufferFramesConfig.
williamr@2
  1570
williamr@2
  1571
@publishedPartner
williamr@2
  1572
@prototype
williamr@2
  1573
*/
williamr@2
  1574
const TUid KUidBufferFramesConfig = {0x1028260D};
williamr@2
  1575
williamr@2
  1576
/**
williamr@2
  1577
This class provides an interface to configure and retrive the buffer frames.
williamr@2
  1578
williamr@2
  1579
@publishedPartner
williamr@2
  1580
@prototype
williamr@2
  1581
*/		
williamr@2
  1582
class MMMFBufferFramesConfig
williamr@2
  1583
	{
williamr@2
  1584
public:
williamr@2
  1585
	/**
williamr@2
  1586
	For use when encoding to set the number of encoded frames contained in each buffer 
williamr@2
  1587
	sent back to the client. The method should be called after CMMFDevSound::InitilaizeL 
williamr@2
  1588
	but before RecordInitL.
williamr@2
  1589
williamr@2
  1590
	@param aFrameCount - Number of frames per buffer 
williamr@2
  1591
	@param aSamplesPerFrame - numer of samples per frame
williamr@2
  1592
	@return  "This method may return one of the system-wide error codes."
williamr@2
  1593
	*/
williamr@2
  1594
	virtual TInt MmbfcSetNumberOfFramesPerInputBuffer(TInt aFrameCount, TInt aSamplesPerFrame)=0;
williamr@2
  1595
	
williamr@2
  1596
	/**
williamr@2
  1597
	For use when decoding to set the number of encoded frames contained in each buffer sent 
williamr@2
  1598
	down to DevsSund for playback. The method should be called after CMMFDevSound::InitilaizeL 
williamr@2
  1599
	but before PlayInitL.
williamr@2
  1600
williamr@2
  1601
	@param aFrameCount - Number of frames per buffer 
williamr@2
  1602
	@param aSamplesPerFrame - numer of samples per frame
williamr@2
  1603
	
williamr@2
  1604
	@return  "This method may return one of the system-wide error codes."
williamr@2
  1605
	*/
williamr@2
  1606
	virtual TInt MmbfcSetNumberOfFramesPerOutputBuffer(TInt aFrameCount, TInt aSamplesPerFrame)=0;
williamr@2
  1607
	};
williamr@2
  1608
williamr@2
  1609
/*****************************************************************************/
williamr@2
  1610
/**
williamr@2
  1611
UID associated with the Custom interface MMMFGetTimestamps
williamr@2
  1612
williamr@2
  1613
@publishedPartner
williamr@2
  1614
@prototype
williamr@2
  1615
*/
williamr@2
  1616
const TUid KUidGetTimestamps = {0x1028260E};
williamr@2
  1617
williamr@2
  1618
/**
williamr@2
  1619
This class provides an interface to configure and retrive time stamps.
williamr@2
  1620
williamr@2
  1621
@publishedPartner
williamr@2
  1622
@prototype
williamr@2
  1623
*/	
williamr@2
  1624
class MMMFGetTimestamps
williamr@2
  1625
	{
williamr@2
  1626
public:
williamr@2
  1627
	/**
williamr@2
  1628
	Enable or disable support for system timestamps during recording, used for Audio / Video sync. 
williamr@2
  1629
	This method can only be called after recording has been initialised, but before recording 
williamr@2
  1630
	has started. Once recording is underway, the setting cannot be changed.
williamr@2
  1631
williamr@2
  1632
	@param aEnable ETrue to enable recording timestamps, EFalse to disable it.
williamr@2
  1633
williamr@2
  1634
	@return KErrNotReady if DevSound has not yet been initialised, KErrNotSupported if 
williamr@2
  1635
	DevSound is not in recording mode or KErrInUse if recording is already underway.
williamr@2
  1636
	*/
williamr@2
  1637
	virtual TInt MmgtSetRecordSystemTimestampsEnabled(TBool aEnable) = 0;
williamr@2
  1638
williamr@2
  1639
	/**
williamr@2
  1640
	This method returns the system timestamp corresponding to the CMMFDataBuffer with the 
williamr@2
  1641
	given position within the recording stream. This timestamp is the system time at which 
williamr@2
  1642
	the buffers timestamp, as returned by CMMFBuffer::TimeToPlay, was valid.
williamr@2
  1643
	This method can only be used if the recording timestamps were enabled before recording 
williamr@2
  1644
	started using the SetRecordSystemTimestampsEnabled method.
williamr@2
  1645
williamr@2
  1646
	@param aBufferPosition The timestamp from the buffer, as returned by CMMFBuffer::TimeToPlay.
williamr@2
  1647
	@param aTimestamp Returns the corresponding system time, in universal time.
williamr@2
  1648
williamr@2
  1649
	@return A System error code. 
williamr@2
  1650
			KErrNotSupported if recording is not ongoing; 
williamr@2
  1651
			KErrNotReady if DevSound is not initialized, or TimeStamps have not been enabled; 
williamr@2
  1652
			KErrNotFound if the timestamp given does not correspond to a recent record buffer.
williamr@2
  1653
	*/
williamr@2
  1654
	virtual TInt MmgtGetSystemTimestampForBuffer(const TTimeIntervalMicroSeconds& aBufferPosition, 
williamr@2
  1655
	                                                   TTime& aTimestamp) const = 0;
williamr@2
  1656
	};
williamr@2
  1657
williamr@2
  1658
/*****************************************************************************/
williamr@2
  1659
/**
williamr@2
  1660
UID associated with the Custom interface MMMFAdvancedAACEncodeSettings
williamr@2
  1661
williamr@2
  1662
@publishedPartner
williamr@2
  1663
@prototype
williamr@2
  1664
*/
williamr@2
  1665
const TUid KUidAdvancedAACEncoderSettings = {0x102825FE};
williamr@2
  1666
williamr@2
  1667
/**
williamr@2
  1668
Advanced AAC Encode Bit-rate Configuration
williamr@2
  1669
williamr@2
  1670
@publishedPartner
williamr@2
  1671
@prototype
williamr@2
  1672
*/
williamr@2
  1673
class MMMFAdvancedAACEncodeSettings
williamr@2
  1674
	{
williamr@2
  1675
public:
williamr@2
  1676
	/** AAC BItrate mode */
williamr@2
  1677
	enum TAACBitrateMode
williamr@2
  1678
		{
williamr@2
  1679
		/** AACBitrateModeNone */
williamr@2
  1680
		EAACBitrateModeNone,
williamr@2
  1681
		/** AACBitrateModeAbsolute */
williamr@2
  1682
		EAACBitrateModeAbsolute,
williamr@2
  1683
		/** AACBitrateModeVariable */
williamr@2
  1684
		EAACBitrateModeVariable,
williamr@2
  1685
		/** AACBitrateModeFixed */
williamr@2
  1686
		EAACBitrateModeFixed
williamr@2
  1687
		};
williamr@2
  1688
	/**
williamr@2
  1689
	SetAACEncodeBitrateMode
williamr@2
  1690
williamr@2
  1691
	Set the bitrate mode for AAC encoding. This must be called before the encoding starts.
williamr@2
  1692
williamr@2
  1693
	@param aBitrateMode the structure containing the additional information required for decoding the raw AAC.
williamr@2
  1694
	@return KErrNone if successful. KErrInUse if this method is used when decoding is active. 
williamr@2
  1695
	*/
williamr@2
  1696
	virtual TInt SetAACEncodeBitrateMode(TAACBitrateMode aBitrateMode)=0;
williamr@2
  1697
williamr@2
  1698
	/**
williamr@2
  1699
	This interface returns the current AACEncoding bitrate mode.
williamr@2
  1700
williamr@2
  1701
	@param  aBitrateMode the structure containing the additional information.
williamr@2
  1702
	@return  KErrNone if successful. KErrNotSupported if this method is not implemented.
williamr@2
  1703
	*/
williamr@2
  1704
	virtual TInt GetAACEncodeBitrateMode(TAACBitrateMode& aBitrateMode) = 0;
williamr@2
  1705
	};
williamr@2
  1706
	
williamr@2
  1707
/*****************************************************************************/
williamr@2
  1708
williamr@2
  1709
	
williamr@2
  1710
#endif 
williamr@2
  1711