williamr@2: // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // 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: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: #ifndef __DEVSOUNDSTANDARDCUSTOMINTERFACES_H__ williamr@2: #define __DEVSOUNDSTANDARDCUSTOMINTERFACES_H__ williamr@2: williamr@2: #include williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the custom interface MMMFDevSoundCustomInterfaceBitRate. williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: const TUid KUidCustomInterfaceDevSoundBitRate = {0x101F7DD5}; williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: This class provides an interface to set and retrive the DevSound bit rate. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class MMMFDevSoundCustomInterfaceBitRate williamr@2: { williamr@2: public: williamr@2: williamr@2: /** williamr@2: Gets the bit rates that are supported by DevSound in its current configuration. williamr@2: williamr@2: @param aSupportedBitRates williamr@2: The supported bit rates, in bits per second, shall be appended to this array. Note that williamr@2: the array shall be reset by this method. williamr@2: */ williamr@2: virtual void GetSupportedBitRatesL(RArray& aSupportedBitRates) = 0; williamr@2: williamr@2: /** williamr@2: Returns the current bit rate. williamr@2: williamr@2: @return The current bit rate, in bits per second. williamr@2: */ williamr@2: virtual TInt BitRateL() = 0; williamr@2: williamr@2: /** williamr@2: Sets the bit rate to a new value. williamr@2: williamr@2: @param aBitRate williamr@2: The new bit rate, in bits per second. williamr@2: */ williamr@2: virtual void SetBitRateL(TInt aBitRate) = 0; williamr@2: }; williamr@2: williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MMMFDevSoundCustomInterfaceFileBlockLength. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: williamr@2: */ williamr@2: const TUid KUidCustomInterfaceDevSoundFileBlockLength = {0x10273806}; williamr@2: williamr@2: /** williamr@2: Custom interface class for setting the file's block length on the hwdevice. williamr@2: williamr@2: Note also that this interface is just a simple interface to williamr@2: set file's block length. No checking is perfomed on the values sent (hence the williamr@2: Set methods do not return an error code). williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MMMFDevSoundCustomInterfaceFileBlockLength williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Sets the file's block length on the hwdevice williamr@2: @param aBlockAlign williamr@2: The file's block length williamr@2: */ williamr@2: virtual void SetFileBlockLength(TUint aBlockAlign)=0; williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MMMFGsmConfig williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: const TUid KUidGsmConfig = {0x102825FC}; williamr@2: williamr@2: /** williamr@2: This class provides an interface to set and retrive the GSM conversion format. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MMMFGsmConfig williamr@2: { williamr@2: public: williamr@2: /** The GSM conversion format */ williamr@2: enum TMMFGsmConversionFormat williamr@2: { williamr@2: /** no conversion specified */ williamr@2: ENone, williamr@2: /** for use in Full rate (06.10) and half rate (GSM 06.20 Half Rate (HR)) Vocoder */ williamr@2: EALaw8bit, williamr@2: /** for use in Full rate (06.10) and half rate (GSM 06.20 Half Rate (HR)) Vocoder */ williamr@2: EULaw8bit, williamr@2: /** for use in GSM 06.60 Enhanced Full Rate (EFR) Vocoder.*/ williamr@2: EAlawPCM williamr@2: }; williamr@2: williamr@2: /** williamr@2: Set the conversion format using the TMMFGsmConversionFormat enum. williamr@2: This conversion must be set before the coder/decoder is started. williamr@2: williamr@2: @param aConvFormat - format desired. For encoding behaviour, format will williamr@2: be the input format and for decoding behaviour format will be the output williamr@2: format. williamr@2: williamr@2: @return KErrNone - Format change supported, KErrNotSupported - Format williamr@2: change not supported, KErrInUse - Format change attempted whilst decoding. williamr@2: */ williamr@2: virtual TInt SetConversionFormat(TMMFGsmConversionFormat aConvFormat) = 0; williamr@2: williamr@2: /** williamr@2: Provides the current conversion format. Can be called at any time. williamr@2: williamr@2: @param aConvFormat - after the call contains the current format. williamr@2: For encoding behaviour, format will be the input format and for decoding williamr@2: behaviour format will be the output format. williamr@2: williamr@2: @return KErrNone if value returned successfully, williamr@2: KErrUnknown if value has not been successfully configured using williamr@2: SetConversionFormat() at least once for the current instance of the williamr@2: interface and there is no default value. williamr@2: KErrGeneral for all other error scenario. williamr@2: */ williamr@2: virtual TInt ConversionFormat(TMMFGsmConversionFormat& aConvFormat) const = 0; williamr@2: }; williamr@2: williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MSpeechEncoderConfig williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: const TUid KUidSpeechEncoderConfig = {0x102825FB}; williamr@2: williamr@2: /** williamr@2: This class provides an interface to those CMMFHwDevices providing speech encoding. williamr@2: This interface is used for querying and configuring the operational modes of speech williamr@2: encoders as supported by those specific encoders. williamr@2: If a speech encoder does not support a mode provided by the interface, it will return KErrNotSupported. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: williamr@2: */ williamr@2: class MSpeechEncoderConfig williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Controls voice activity detection (VAD) mode. williamr@2: This method can be called at all times - while actively encoding or not. williamr@2: It should be noted that a VAD mode change could also instigate a change in the williamr@2: mode of encoding (fixed rate encoding versus variable rate) e.g. in cases where williamr@2: VAD requires variable rate encoding. williamr@2: The effects of activating VAD mode behaviour should be documented in the williamr@2: CMMFHwDevice specification implementing it. williamr@2: williamr@2: @param aVadModeOn ETrue=On, EFalse=Off williamr@2: @return KErrNone if successful. KErrNotSupported if this method is not implemented williamr@2: or not supported by the encoder. williamr@2: */ williamr@2: virtual TInt SetVadMode(TBool aVadModeOn) = 0; williamr@2: williamr@2: /** williamr@2: Gets the current state of the voice activity detection (VAD) mode. williamr@2: This method can be called at all times - while actively encoding or not. williamr@2: williamr@2: @param aVadModeOn On output ETrue = On, EFalse = Off williamr@2: @return KErrNone if successful, KErrNotSupported if this method is not implemented williamr@2: or not supported by the encoder. williamr@2: */ williamr@2: virtual TInt GetVadMode(TBool& aVadModeOn) = 0; williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MAacDecoderConfig williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: const TUid KUidAacDecoderConfig = {0x102825FD}; williamr@2: williamr@2: /** williamr@2: This class provides an interface to the AAC decoder CMMFHwDevice in order williamr@2: to provide additional configuration information for decoding raw AAC data blocks. williamr@2: williamr@2: The sample rate can be configured via the CMMFHwDevice::SetConfig() method. williamr@2: An extension mechanism will be provided for further functionality as required. williamr@2: The CMMFHwDevice does not contain Output channel configuration at time of writing. williamr@2: The HWA decoders to date have been hardcoded for 2ch (left / right) output. williamr@2: Additional configuration information may be provided by using extension mechanisms. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MAacDecoderConfig williamr@2: { williamr@2: public: williamr@2: williamr@2: /** williamr@2: This is a class containing an enumerated type that defines the audio object types williamr@2: required for configuring the AAC decoder for decoding raw AACDefined within TAudioConfig. williamr@2: */ williamr@2: class TAudioConfig williamr@2: { williamr@2: public: williamr@2: /** The audio object type */ williamr@2: enum TAudioObjectType williamr@2: { williamr@2: /** Null */ williamr@2: ENull = 0, williamr@2: /** AacMain */ williamr@2: EAacMain = 1, williamr@2: /** AacLc */ williamr@2: EAacLc = 2, williamr@2: /** AacSsr */ williamr@2: EAacSsr = 3, williamr@2: /** AacLtp */ williamr@2: EAacLtp = 4, williamr@2: /** Sbr */ williamr@2: ESbr = 5 williamr@2: }; williamr@2: TAudioObjectType iAudioObjectType; williamr@2: }; williamr@2: williamr@2: public: williamr@2: /** williamr@2: Sets additional configuration parameters required for decoding raw AAC. williamr@2: williamr@2: This method can be called when encoding is not active - anytime before the CMMFHwDevice is started. williamr@2: williamr@2: For consistent configuration, this method should be called sometime before each williamr@2: start is called on the CMMFHwDevice when decoding raw AAC. That is to say the williamr@2: CMMFHwDevice is not required to retain prior configuration information, detect raw williamr@2: AAC sent to it, and reconfigure the decoder with this saved information after stop williamr@2: is called on the CMMFHwDevice. However, calling pause on the CMMFHwDevice implies williamr@2: that the next start call will be resuming same content. For this condition, this API williamr@2: is not required when restarting the CMMFHwDevice. williamr@2: williamr@2: @param aAudioConfig The structure containing the additional information required for decoding the raw AAC. williamr@2: williamr@2: @return KErrNone if successful or KErrInUse if this method is used when decoding is active. williamr@2: */ williamr@2: virtual TInt SetAudioConfig(TAudioConfig& aAudioConfig) = 0; williamr@2: williamr@2: /** williamr@2: Gets additional configuration parameters supported for decoding raw AAC. williamr@2: williamr@2: This method is allowable when encoding is not active - anytime before the CMMFHwDevice is started. williamr@2: williamr@2: @param aSupportedAudioConfigs An array of structures containing the additional supported configurations. williamr@2: williamr@2: @return KErrNone if successful. williamr@2: KErrInUse if this method is used when decoding is active. williamr@2: */ williamr@2: virtual TInt GetSupportedAudioConfigs(RArray& aSupportedAudioConfigs) = 0; williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MEAacPlusDecoderIntfc williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: const TUid KUidEAacPlusDecoderIntfc = {0x102825FF}; williamr@2: williamr@2: /** williamr@2: This class provides an interface to the eAAC+ decoder hwdevice in order to provide configuration information. williamr@2: williamr@2: The Get.. methods can be used to retrieve the last successfully applied configuration parameters. williamr@2: A message is not sent to adaptation or the decoder. Instead, a locally saved set of the williamr@2: parameters will be updated upon successful use of ApplyConfig(). It is these saved values that williamr@2: the proxy maintains that will be returned to the user. For instance, if two interfaces are used williamr@2: and one interface is used to modify the settings, the other interface's Get… methods would not williamr@2: return those settings. The Get.. methods will return an error if a successful use of ApplyConfig() williamr@2: has not been performed. williamr@2: williamr@2: The Set.. methods are used to update a configuration structure within the implementation of the williamr@2: interface. When the interface is instantiated, the state of SBR and Downsampled modes will be williamr@2: disabled. Therefore it is not necessary to configure these parameters before using williamr@2: ApplyConfig() the first time. However, once modified using this instance of the interface, they williamr@2: remain in that state until Set.. again. The values of these items are updated in an internal williamr@2: structure when each Set.. is called. williamr@2: williamr@2: The ApplyConfig() method is used to configure the encoder with the parameters specified by williamr@2: the Set.. methods. ApplyConfig will send back an error (KErrUnknown) if not all items are williamr@2: Set at least once. This check and the parameter values returned will be implemented in the interface proxy williamr@2: and will not query the actual decoder. The exception to this is for configuration parameters with defined williamr@2: default values (see next paragraph). williamr@2: williamr@2: Calling ApplyConfig() will send these values using a single message to the message handler. williamr@2: ApplyConfig() should fail if it is used during decoding with a KErrInUse (or, as previously stated, williamr@2: KErrUnknown if a value without a default is not set). Since the interface proxy is not aware of decoding state, williamr@2: this check would have to be done in the adaptation implementation for this interface. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MEAacPlusDecoderIntfc williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Defines additional configuration elements required to decode eAAC+. williamr@2: */ williamr@2: enum TAudioObjectType williamr@2: { williamr@2: /** Null */ williamr@2: ENull = 0, williamr@2: /** AacLc */ williamr@2: EAacLc = 2, williamr@2: /** AacLtp */ williamr@2: EAacLtp = 4 williamr@2: }; williamr@2: williamr@2: /** williamr@2: Sets the value of the sampling frequency of the decoder to be configured by the ApplyConfig() williamr@2: method. This is the sample rate of the core decoder, not the output sampling frequency of the decoder. williamr@2: This method can be called at all times but if ApplyConfig() is subsequently called williamr@2: after changing this value whilst decoding, a KErrInUse error will result. williamr@2: williamr@2: @param aInputSamplingFrequency value of the sampling frequency. williamr@2: */ williamr@2: virtual void SetInputSamplingFrequency(TUint aInputSamplingFrequency) = 0; williamr@2: williamr@2: /** williamr@2: Sets the object type of the core decoder to be configured by the ApplyConfig() method. williamr@2: williamr@2: This method can be called at all times but if ApplyConfig() is subsequently called after williamr@2: changing this value whilst decoding, a KErrInUse error will result. williamr@2: williamr@2: @param aAudioObjectType TAudioObjectType for core decoder as supported by the decoder. williamr@2: */ williamr@2: virtual void SetAudioObjectType(TAudioObjectType aAudioObjectType) = 0; williamr@2: williamr@2: /** williamr@2: Sets the number of channels for the output of the decoder to be configured by the ApplyConfig() williamr@2: method. The use of this method is to ensure coordination of output channels rendered by the decoder williamr@2: and channel configuration of the audio system. This method does not imply that stereo to mono downmix williamr@2: is supported by the decoder. The main purpose is for the case considering the presence of PS. A user williamr@2: may not know if the decoder output will be mono or stereo based on header information alone, but may williamr@2: configure the decoder for two channel output to match the audio system configuration. If the user were williamr@2: to set the output to 1 channel and stereo data is present, the decoder may choose only one channel to williamr@2: output or to downmix the stereo to mono. Regarding this interface, it would be more desirable to configure williamr@2: the decoder when it is known to be mono source data and rely on downmix from the audio system instead of williamr@2: from the decoder. The decoder, however, would provide for duplicating mono data into 2 channel data when williamr@2: configured for 2 channels and the source data contains only 1 channel. williamr@2: This method is allowable at all times - while actively encoding or not, but using ApplyConfig() williamr@2: if changing this value while encoding will return an error. williamr@2: williamr@2: @param aNumOfChannels 1 - output one channel audio = 0; 2 - output two channel audio. williamr@2: */ williamr@2: virtual void SetNumOfChannels(TUint aNumOfChannels) = 0; williamr@2: williamr@2: /** williamr@2: Controls the SBR mode of the decoder to be configured by the ApplyConfig() method. williamr@2: williamr@2: If SBR is enabled and no SBR data is present, the audio data will be upsampled, williamr@2: unless Down Sampled mode is enabled. williamr@2: williamr@2: This method can be called at all times but if ApplyConfig() is subsequently called williamr@2: after changing this value whilst decoding, a KErrInUse error will result. williamr@2: williamr@2: @param aSbrEnabled ETrue - SBR mode enabled, EFalse - SBR mode disabled williamr@2: */ williamr@2: virtual void SetSbr(TBool aSbrEnabled) = 0; williamr@2: williamr@2: /** williamr@2: 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: williamr@2: This method can be called at all times but if ApplyConfig() is subsequently called after williamr@2: changing this value whilst decoding, a KErrInUse error will result. williamr@2: williamr@2: @param aDsmEnabled ETrue - downsampled mode enabled, EFalse - downsampled mode disabled. williamr@2: */ williamr@2: virtual void SetDownSampledMode(TBool aDsmEnabled) = 0; williamr@2: williamr@2: /** williamr@2: Used to configure the decoder with parameters passed in the Set methods. williamr@2: williamr@2: This method can be called all times but will return an KErrInUse if the configuration williamr@2: parameters would change while decoding (as none of the set parameters can be changed williamr@2: during decoding). This checking operational state of the decoder would be done by the williamr@2: adaptation implementation of this interface since the interface proxy is not aware of williamr@2: the decoder state. The adaptation implementation will return an error if incorrect values williamr@2: are used to configure the decoder. williamr@2: williamr@2: @return KErrNone if successful, KErrNotSupported if this method is not implemented, williamr@2: KErrInUse if encoding in active and values are changed that are not allowed to be williamr@2: changed during encoding, KErrArgument if one of the configuration items is not appropriate or not set. williamr@2: */ williamr@2: virtual TInt ApplyConfig() = 0; williamr@2: williamr@2: /** williamr@2: Returns the value of the sampling frequency of the decoder that was last successfully williamr@2: configured by the ApplyConfig() method. williamr@2: williamr@2: This method can be called at all times but must be called after a value has been set via williamr@2: the ApplyConfig williamr@2: williamr@2: @param aInputSamplingFrequency last setting successfully applied using ApplyConfig(). williamr@2: williamr@2: @return KErrNone if value returned successfully, williamr@2: KErrUnknown if value has not been successfully configured using ApplyConfig() at williamr@2: least once for the current instance of the interface or williamr@2: KErrInUse if the encoder is active. williamr@2: */ williamr@2: virtual TInt GetInputSamplingFrequency(TUint& aInputSamplingFrequency) = 0; williamr@2: williamr@2: /** williamr@2: Returns the object type of the core decoder that was last successfully configured by the williamr@2: ApplyConfig() method. williamr@2: williamr@2: This method can be called at all times. williamr@2: williamr@2: @param aAudioObjectType last setting successfully applied using ApplyConfig(). williamr@2: williamr@2: @return KErrNone if value returned successfully, williamr@2: KErrUnknown if value has not been successfully configured using ApplyConfig() williamr@2: at least once for the current instance of the interface. williamr@2: */ williamr@2: virtual TInt GetAudioObjectType(TAudioObjectType& aAudioObjectType) = 0; williamr@2: williamr@2: /** williamr@2: Returns the number of channels that was last successfully configured by the williamr@2: ApplyConfig() method. williamr@2: williamr@2: This method can be called at all times. It will return an error if used before williamr@2: ApplyConfig() has been used successfully. williamr@2: williamr@2: @param aNumOfChannels last setting successfully applied using ApplyConfig(). williamr@2: williamr@2: @return KErrNone if value returned successfully, williamr@2: KErrUnknown if value has not been successfully configured using ApplyConfig() williamr@2: at least once for the current instance of the interface. williamr@2: */ williamr@2: virtual TInt GetNumOfChannels(TUint& aNumOfChannels) = 0; williamr@2: williamr@2: /** williamr@2: Returns the SBR mode that was last successfully configured by the ApplyConfig() method. williamr@2: williamr@2: This method can be called at all times. It will return an error if used before williamr@2: ApplyConfig() has been used successfully. williamr@2: williamr@2: @param aSbrEnabled last setting successfully applied using ApplyConfig(). williamr@2: williamr@2: @return KErrNone if value returned successfully, williamr@2: KErrUnknown if value has not been successfully configured using ApplyConfig() williamr@2: at least once for the current instance of the interface. williamr@2: */ williamr@2: virtual TInt GetSbr(TBool& aSbrEnabled) = 0; williamr@2: williamr@2: /** williamr@2: Returns the downsampled mode that was last successfully configured by the ApplyConfig() method. williamr@2: williamr@2: This method can be called at all times. It will return an error if used before williamr@2: ApplyConfig() has been used successfully. williamr@2: williamr@2: @param aDsmEnabled last setting successfully applied using ApplyConfig(). williamr@2: williamr@2: @return KErrNone if value returned successfully, williamr@2: KErrUnknown if value has not been successfully configured using ApplyConfig() at least williamr@2: once for the current instance of the interface. williamr@2: */ williamr@2: virtual TInt GetDownSampledMode(TBool& aDsmEnabled) = 0; williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MSbcEncoderIntfc williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: const TUid KUidSbcEncoderIntfc = {0x10282600}; williamr@2: williamr@2: /** williamr@2: This class provides an interface to the SBC encoder hwdevice in order to provide configuration information. williamr@2: williamr@2: The Get... supported methods can be used to check capabilities of the encoder by retrieving williamr@2: the last successfully applied configuration parameters. The purpose of the Get williamr@2: functions is to return the last successfully applied configuration of decoder by this williamr@2: interface. A message is not sent to adaptation or the decoder. Instead, a locally saved set williamr@2: of the parameters will be updated upon successful use of ApplyConfig(). The Get.. methods williamr@2: return an error (KErrUnknown ) if a successful use of ApplyConfig() has not been performed williamr@2: apart from the following methods, which return the range of properties supported by the williamr@2: implementation ( GetSupportedSamplingFrequencies, GetSupportedChannelModes, williamr@2: GetSupportedNumOfSubbands, GetSupportedAllocationMethods, GetSupportedNumOfBlocks, williamr@2: GetSupportedBitpoolRange). These methods do not have setter functions as they are not williamr@2: configurable and hence will return valid data at all times. williamr@2: williamr@2: ApplyConfig() will send these values using one message with these values in the internally williamr@2: defined structure. The message handler should define this structure in the SBC messages williamr@2: header file. ApplyConfig() should fail (KErrInUse) if it is used during encoding and any williamr@2: values are changed other than bitpool value. Since the interface proxy is not aware of williamr@2: encoding state, this check would have to be done in the adaptation implementation for williamr@2: this interface. The Bitpool can be updated during encoding to change the bitrate. This would williamr@2: require the use of the SetBitpoolSize() and ApplyConfig() methods. Any other parameters can williamr@2: be changed but will result in a KErrInUse when ApplyConfig() is called. williamr@2: williamr@2: The Set... methods are used update a client-side maintained configuration structure within the williamr@2: implementation of the interface. When the structure is completed, ApplyConfig() should be called williamr@2: to send these client side settings to the actual hwdevice implementation. There are no default williamr@2: values for the configuration parameters (hence all values must be set before ApplyConfig() is williamr@2: called or an error (KErrArgument) will result). williamr@2: williamr@2: @note This constraint is only true for configurations williamr@2: where this is supported (e.g. If GetSupportedChannelModes returns KErrNotSupported then SetChannelMode williamr@2: does not need to be set before ApplyConfig() is called). This check and the parameter values williamr@2: returned will be implemented in the interface proxy and will not query the actual encoder. If williamr@2: multiple instances of the interface are created, each would have this requirement. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MSbcEncoderIntfc williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Defines the channel modes for the SBC encoder williamr@2: */ williamr@2: enum TSbcChannelMode williamr@2: { williamr@2: /** SbcChannelMono */ williamr@2: ESbcChannelMono, williamr@2: /** SbcChannelDual */ williamr@2: ESbcChannelDual, williamr@2: /** SbcChannelStereo */ williamr@2: ESbcChannelStereo, williamr@2: /** SbcChannelJointStereo */ williamr@2: ESbcChannelJointStereo williamr@2: }; williamr@2: williamr@2: /** williamr@2: This type defines the allocation methods for the SBC encoder. williamr@2: */ williamr@2: enum TSbcAllocationMethod williamr@2: { williamr@2: /** SbcAllocationSNR */ williamr@2: ESbcAllocationSNR, williamr@2: /** SbcAllocationLoudness */ williamr@2: ESbcAllocationLoudness williamr@2: }; williamr@2: williamr@2: /** williamr@2: Retrieves the sampling frequencies supported by the encoder. See the class comments for details. williamr@2: This method can be called at all times. williamr@2: williamr@2: @param aSamplingFrequencies Reference to the location to store the array of supported williamr@2: sampling frequencies. williamr@2: williamr@2: @return KErrNone if successful, KErrNotSupported if this method is not supported. williamr@2: */ williamr@2: virtual TInt GetSupportedSamplingFrequencies(RArray& aSamplingFrequencies) = 0; williamr@2: williamr@2: /** williamr@2: Retrieves the channel encoding supported by the encoder. See the class comments for details. williamr@2: williamr@2: This method can be called at all times. williamr@2: williamr@2: @param aChannelModes Reference to the location to store the array of supported channel encoding modes. williamr@2: williamr@2: @return KErrNone if successful, KErrNotSupported if this method is not supported. williamr@2: */ williamr@2: virtual TInt GetSupportedChannelModes(RArray& aChannelModes) = 0; williamr@2: williamr@2: /** williamr@2: Retrieves the number of subbands supported by the encoder. See the class comments for details. williamr@2: williamr@2: This method can be called at all times. williamr@2: williamr@2: @param aNumOfSubbands Reference to the location to store the array of supported number of subbands. williamr@2: williamr@2: @return KErrNone if successful, KErrNotSupported if this method is not supported. williamr@2: */ williamr@2: virtual TInt GetSupportedNumOfSubbands(RArray& aNumOfSubbands) = 0; williamr@2: williamr@2: /** williamr@2: Retrieves the allocation methods supported by the encoder. See the class comments for details. williamr@2: williamr@2: This method can be called at all times. williamr@2: williamr@2: @param aAllocationMethods Reference to the location to store the array of supported allocation methods. williamr@2: williamr@2: @return KErrNone if successful, KErrNotSupported if this method is not supported. williamr@2: */ williamr@2: virtual TInt GetSupportedAllocationMethods(RArray& aAllocationMethods) = 0; williamr@2: williamr@2: /** williamr@2: Retrieves the number of blocks supported by the encoder. See the class comments for details. williamr@2: williamr@2: This method can be called at all times but if ApplyConfig() is subsequently called williamr@2: after changing this value whilst encoding, a KErrInUse error will result. williamr@2: williamr@2: @param aNumOfBlocks Reference to the location to store the array of supported number of blocks. williamr@2: williamr@2: @return KErrNone if successful, KErrNotSupported if this method is not supported. williamr@2: */ williamr@2: virtual TInt GetSupportedNumOfBlocks(RArray& aNumOfBlocks) = 0; williamr@2: williamr@2: /** williamr@2: Retrieves the min and max bitpool values supported by the encoder. See the class comments for details. williamr@2: williamr@2: This method can be called at all times but and ApplyConfig() can be called to change the value whilst encoding. williamr@2: williamr@2: @param aMinSupportedBitpoolSize minimum bitpool value allowed by the encoder. williamr@2: @param aMaxSupportedBitpoolSize maximum bitpool value allowed by the encoder. williamr@2: williamr@2: @return KErrNone if successful, KErrNotSupported if this method is not supported. williamr@2: */ williamr@2: virtual TInt GetSupportedBitpoolRange(TUint& aMinSupportedBitpoolSize, TUint& aMaxSupportedBitpoolSize) = 0; williamr@2: williamr@2: /** williamr@2: Sets the value of the sampling frequency of the encoder to be configured by the ApplyConfig() method. williamr@2: williamr@2: This method can be called at all times but if ApplyConfig() is subsequently called williamr@2: after changing this value whilst encoding, a KErrInUse error will result. williamr@2: williamr@2: @param aSamplingFrequency values according to standard and supported by encoder. williamr@2: */ williamr@2: virtual void SetSamplingFrequency(TUint aSamplingFrequency) = 0; williamr@2: williamr@2: /** williamr@2: Sets the channel mode of the encoder to be configured by the ApplyConfig() method. williamr@2: See the class comments for details. williamr@2: williamr@2: This method can be called at all times but if ApplyConfig() is subsequently called after williamr@2: changing this value whilst encoding, a KErrInUse error will result. williamr@2: williamr@2: @param aChannelMode (ESbcChannelMono, ESbcChannelDual, ESbcChannelStereo, williamr@2: ESbcChannelJointStereo) when supported by encoder. williamr@2: williamr@2: */ williamr@2: virtual void SetChannelMode(TSbcChannelMode aChannelMode) = 0; williamr@2: williamr@2: /** williamr@2: Sets the channel mode of the encoder to be configured by the ApplyConfig() method. williamr@2: williamr@2: This method can be called at all times but if ApplyConfig() is subsequently called after williamr@2: changing this value whilst encoding, a KErrInUse error will result. williamr@2: williamr@2: @param aNumOfSubbands values according to standard and supported by encoder. williamr@2: williamr@2: */ williamr@2: virtual void SetNumOfSubbands(TUint aNumOfSubbands) = 0; williamr@2: williamr@2: /** williamr@2: Sets the allocation method of the encoder to be configured by the ApplyConfig() method. williamr@2: williamr@2: This method can be called at all times but if ApplyConfig() is subsequently called after williamr@2: changing this value whilst encoding, a KErrInUse error will result. williamr@2: williamr@2: @param aAllocationMethod ESbcAllocationSNR, ESbcAllocationLoudness when supported by encoder williamr@2: williamr@2: */ williamr@2: virtual void SetAllocationMethod(TSbcAllocationMethod aAllocationMethod) = 0; williamr@2: williamr@2: /** williamr@2: Sets the number of blocks of the encoder to be configured by the ApplyConfig() method. williamr@2: williamr@2: This method can be called at all times but if ApplyConfig() is subsequently called after williamr@2: changing this value whilst encoding, a KErrInUse error will result. williamr@2: williamr@2: @param aNumOfBlocks values according to standard and supported by encoder. williamr@2: */ williamr@2: virtual void SetNumOfBlocks(TUint aNumOfBlocks) = 0; williamr@2: williamr@2: /** williamr@2: Sets the size of the bitpool of the encoder to be configured by the ApplyConfig() method. williamr@2: williamr@2: This method is allowable at all times - while actively encoding or not. williamr@2: williamr@2: @param aBitpoolSize values according to standard and supported by encoder. williamr@2: williamr@2: */ williamr@2: virtual void SetBitpoolSize(TUint aBitpoolSize) = 0; williamr@2: williamr@2: /** williamr@2: Used to configure the encoder with parameters passed in the Set… methods. williamr@2: This method can be called at all times - while actively encoding or not. williamr@2: An error (KErrInUse) will be returned if any configuration parameter, other williamr@2: than bitpool size, is changed while encoding. This checking operational williamr@2: state of the encoder would be done by the adaptation implementation of this williamr@2: interface since the interface proxy is not aware of the encoder state. Also, williamr@2: the adaptation implementation will return an error if incorrect values are williamr@2: used to configure the encoder. williamr@2: williamr@2: @note Even though some preliminary checking is done in the set methods (to see williamr@2: if it is valid to set the values at all) it is expected that williamr@2: williamr@2: @return KErrNone if successful, williamr@2: KErrNotSupported if this method is not implemented, williamr@2: KErrInUse if encoding in active and values are changed that are not williamr@2: allowed to be changed during encoding, williamr@2: KErrArgument if one of the configuration items is not appropriate or williamr@2: if all the values are not set (unless some of the values are not williamr@2: supported, in which case these values should be ignored). williamr@2: */ williamr@2: virtual TInt ApplyConfig() = 0; williamr@2: williamr@2: /** williamr@2: Gets the value of the sampling frequency of the encoder that was last successfully williamr@2: configured by the ApplyConfig() method. williamr@2: williamr@2: This method can be called at all times - while actively encoding or not, but will williamr@2: return an error if used before ApplyConfig() has been used successfully. williamr@2: williamr@2: @param aSamplingFrequency last setting successfully applied using ApplyConfig(). williamr@2: williamr@2: @return KErrNone if value returned successfully, williamr@2: KErrUnknown if value has not been successfully configured using ApplyConfig() williamr@2: at least once for the current instance of the interface, williamr@2: KErrNotSupported if this method is not implemented (to match its set and williamr@2: getsupported methods). williamr@2: */ williamr@2: virtual TInt GetSamplingFrequency(TUint& aSamplingFrequency) = 0; williamr@2: williamr@2: /** williamr@2: Gets the channel mode of the encoder that was last successfully configured by the williamr@2: ApplyConfig() method. williamr@2: williamr@2: This method can be called at all times - while actively encoding or not, but will williamr@2: return an error if used before ApplyConfig() has been used successfully. williamr@2: williamr@2: @param aChannelMode last setting successfully applied using ApplyConfig(). williamr@2: williamr@2: @return KErrNone if value returned successfully, williamr@2: KErrUnknown if value has not been successfully configured using ApplyConfig() williamr@2: at least once for the current instance of the interface. williamr@2: */ williamr@2: virtual TInt GetChannelMode(TSbcChannelMode& aChannelMode) = 0; williamr@2: williamr@2: /** williamr@2: Gets the channel mode of the encoder that was last successfully configured by the williamr@2: ApplyConfig() method. williamr@2: williamr@2: This method can be called at all times - while actively encoding or not, williamr@2: but will return an error if used before ApplyConfig() has been used successfully. williamr@2: williamr@2: @param aNumOfSubbands last setting successfully applied using ApplyConfig(). williamr@2: williamr@2: @return KErrNone if value returned successfully, williamr@2: KErrUnknown if value has not been successfully configured using ApplyConfig() williamr@2: at least once for the current instance of the interface, williamr@2: KErrNotSupported if this method is not implemented (to match its set and williamr@2: getsupported methods) williamr@2: */ williamr@2: virtual TInt GetNumOfSubbands(TUint& aNumOfSubbands) = 0; williamr@2: williamr@2: /** williamr@2: Gets the number of blocks of the encoder that was last successfully configured by williamr@2: the ApplyConfig() method. williamr@2: williamr@2: This method can be called at all times - while actively encoding or not, but will williamr@2: return an error if used before ApplyConfig() has been used successfully. williamr@2: williamr@2: @param aNumOfBlocks last setting successfully applied using ApplyConfig(). williamr@2: williamr@2: @return KErrNone if value returned successfully, williamr@2: KErrUnknown if value has not been successfully configured using ApplyConfig() williamr@2: at least once for the current instance of the interface, williamr@2: KErrNotSupported if this method is not implemented (to match its set and williamr@2: getsupported methods) williamr@2: */ williamr@2: virtual TInt GetNumOfBlocks(TUint& aNumOfBlocks) = 0; williamr@2: williamr@2: /** williamr@2: Gets the allocation method of the encoder that was last successfully configured williamr@2: by the ApplyConfig() method. williamr@2: williamr@2: This method can be called at all times - while actively encoding or not, but will williamr@2: return an error if used before ApplyConfig() has been used successfully. williamr@2: @param aAllocationMethod last setting successfully applied using ApplyConfig(). williamr@2: williamr@2: @return KErrNone if value returned successfully, williamr@2: KErrUnknown if value has not been successfully configured using ApplyConfig() williamr@2: at least once for the current instance of the interface, williamr@2: KErrNotSupported if this method is not implemented (to match its set and williamr@2: getsupported methods). williamr@2: */ williamr@2: virtual TInt GetAllocationMethod(TSbcAllocationMethod& aAllocationMethod) = 0; williamr@2: williamr@2: /** williamr@2: Gets the size of the bitpool of the encoder that was last successfully williamr@2: configured by the ApplyConfig() method. williamr@2: williamr@2: This method can be called at all times - while actively encoding or not, but williamr@2: will return an error if used before ApplyConfig() has been used successfully. williamr@2: williamr@2: @param aBitpoolSize last setting successfully applied using ApplyConfig(). williamr@2: williamr@2: @return KErrNone if value returned successfully, williamr@2: KErrUnknown if value has not been successfully configured using ApplyConfig() williamr@2: at least once for the current instance of the interface, williamr@2: KErrNotSupported if this method is not implemented (to match its set and williamr@2: getsupported methods). williamr@2: */ williamr@2: virtual TInt GetBitpoolSize(TUint& aBitpoolSize) = 0; williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MG711DecoderIntfc williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: const TUid KUidG711DecoderIntfc = {0x10282601}; williamr@2: williamr@2: /** williamr@2: This class provides an interface to the G711 decoder CMMFHwDevice in order to provide williamr@2: additional configuration information. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MG711DecoderIntfc williamr@2: { williamr@2: public: williamr@2: /** The Decoder mode */ williamr@2: enum TDecodeMode williamr@2: { williamr@2: /** DecALaw */ williamr@2: EDecALaw, williamr@2: /** DecULaw */ williamr@2: EDecULaw williamr@2: }; williamr@2: williamr@2: /** williamr@2: Informs the decoder of the encoded data format that will be sent to it. williamr@2: williamr@2: This method can be called when decoding is not active - anytime before started williamr@2: or after stopped. williamr@2: @param aDecodeMode the decode mode. williamr@2: williamr@2: @return KErrNone if successful. williamr@2: KErrInUse if this method is used when encoding is active. williamr@2: KErrNotSupported if this method is not implemented. williamr@2: */ williamr@2: virtual TInt SetDecoderMode(TDecodeMode aDecodeMode) = 0; williamr@2: williamr@2: /** williamr@2: Queries the decoder of the encoded data format that has been active. williamr@2: williamr@2: This method can be called at all times. williamr@2: @param aDecodeMode the decode mode. williamr@2: williamr@2: @return KErrNone if successful. williamr@2: KErrInUse if this method is used when encoding is active. williamr@2: KErrNotSupported if this method is not implemented. williamr@2: */ williamr@2: virtual TInt GetDecoderMode(TDecodeMode& aDecodeMode) = 0; williamr@2: williamr@2: /** williamr@2: Used to enable and disable the comfort noise generation capability. williamr@2: williamr@2: This method can be called when decoding is not active - anytime before started williamr@2: or after stopped. williamr@2: williamr@2: @param aCng ETrue = Comfort Noise Generation enabled; EFalse = Comfort Noise williamr@2: Generation disabled williamr@2: williamr@2: @return KErrNone if successful. williamr@2: KErrInUse if this method is used when encoding is active. williamr@2: KErrNotSupported if this method is not implemented. williamr@2: */ williamr@2: virtual TInt SetComfortNoiseGeneration(TBool aCng) = 0; williamr@2: williamr@2: /** williamr@2: Used to find out if comfort noise generation is enabled or not. williamr@2: williamr@2: This method can be called when decoding is not active - anytime before started williamr@2: or after stopped. williamr@2: williamr@2: @param aCng ETrue = Comfort Noise Generation enabled; EFalse = Comfort Noise williamr@2: Generation disabled williamr@2: williamr@2: @return KErrNone if successful. williamr@2: KErrInUse if this method is used when encoding is active. williamr@2: KErrNotSupported if this method is not implemented. williamr@2: */ williamr@2: virtual TInt GetComfortNoiseGeneration(TBool& aCng) = 0; williamr@2: williamr@2: /** williamr@2: Used to enable and disable the packet loss concealment capability. williamr@2: williamr@2: This can be called when decoding is not active - anytime before started or after williamr@2: stopped. williamr@2: williamr@2: @param aPlc ETrue = plc enabled; EFalse = plc disabled williamr@2: williamr@2: @return KErrNone if successful. KErrInUse if this method is used when encoding is williamr@2: active. KErrNotSupported if this method is not implemented. williamr@2: */ williamr@2: virtual TInt SetPacketLossConcealment(TBool aPlc) = 0; williamr@2: williamr@2: /** williamr@2: Used to find out if packet loss concealment capability is enabled or not. williamr@2: williamr@2: This method can be called when decoding is not active - anytime before started or williamr@2: after stopped. williamr@2: williamr@2: @param aPlc ETrue = packet loss concealment enabled; EFalse = packet loss williamr@2: concealment disabled williamr@2: williamr@2: @return KErrNone if successful. KErrInUse if this method is used when encoding is active. williamr@2: KErrNotSupported if this method is not implemented. williamr@2: */ williamr@2: virtual TInt GetPacketLossConcealment(TBool& aPlc) = 0; williamr@2: williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MG711EncoderIntfc williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: const TUid KUidG711EncoderIntfc = {0x10282602}; williamr@2: williamr@2: /** williamr@2: This class provides an interface to the G711 encoder CMMFHwDevice in order to provide williamr@2: additional configuration information. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MG711EncoderIntfc williamr@2: { williamr@2: public: williamr@2: /** The encoder mode */ williamr@2: enum TEncodeMode williamr@2: { williamr@2: /** EncALaw */ williamr@2: EEncALaw, williamr@2: /** EncULaw */ williamr@2: EEncULaw williamr@2: }; williamr@2: williamr@2: /** williamr@2: Configures the encoder's encoding format. williamr@2: williamr@2: This method can be called when decoding is not active - anytime before started or williamr@2: after stopped. williamr@2: williamr@2: @param aEncodeMode the encode mode. williamr@2: williamr@2: @return KErrNone if successful. KErrInUse if this method is used when encoding is active. williamr@2: KErrNotSupported if this method is not implemented. williamr@2: */ williamr@2: virtual TInt SetEncoderMode(TEncodeMode aEncodeMode) = 0; williamr@2: williamr@2: /** williamr@2: Controls voice activity detection (VAD) mode. williamr@2: williamr@2: This method can be called at all times. williamr@2: williamr@2: @param aVadModeOn ETrue=On, EFalse=Off williamr@2: williamr@2: @return KErrNone if successful, williamr@2: KErrNotSupported if this method is not implemented or not supported by the encoder williamr@2: */ williamr@2: virtual TInt SetVadMode(TBool aVadModeOn) = 0; williamr@2: williamr@2: /** williamr@2: Gets the current state of the voice activity detection (VAD) mode. williamr@2: williamr@2: This method can be called at all times - while actively encoding or not. williamr@2: williamr@2: @param aVadModeOn On output ETrue=On, EFalse=Off williamr@2: williamr@2: @return KErrNone if successful. williamr@2: KErrNotSupported if this method is not implemented or VAD is not supported by the encoder. williamr@2: */ williamr@2: virtual TInt GetVadMode(TBool& aVadModeOn) = 0; williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MG729DecoderIntfc williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: const TUid KUidG729DecoderIntfc = {0x10282603}; williamr@2: williamr@2: /** williamr@2: This class provides an interface to the G729 decoder CMMFHwDevice in order to provide additional williamr@2: configuration information. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MG729DecoderIntfc williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Informs the decoder that the next buffer sent to it will contain bad LSF data. williamr@2: williamr@2: This method can be called when decoding is active. williamr@2: williamr@2: This method will be called after a buffer has been received from the CMMFHwDevice, williamr@2: and before it is returned to the CMMFHwDevice. williamr@2: williamr@2: @return KErrNone if successful. williamr@2: KErrInUse if this method is used out of sequence. williamr@2: KErrNotSupported if this method is not implemented. williamr@2: */ williamr@2: virtual TInt BadLsfNextBuffer() = 0; williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MG729EncoderIntfc williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: const TUid KUidG729EncoderIntfc = {0x10282604}; williamr@2: williamr@2: /** williamr@2: This class provides an interface to the G729 encoder CMMFHwDevice in order to provide williamr@2: additional configuration information. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MG729EncoderIntfc williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Controls voice activity detection (VAD) mode. williamr@2: williamr@2: This method is allowable at all times - while actively encoding or not. williamr@2: @param aVadModeOn ETrue=On, EFalse=Off williamr@2: williamr@2: @return KErrNone if successful. KErrNotSupported if this method is not implemented williamr@2: or not supported by the encoder. williamr@2: */ williamr@2: virtual TInt SetVadMode(TBool aVadModeOn) = 0; williamr@2: williamr@2: /** williamr@2: Gets the current state of the voice activity detection (VAD) mode. williamr@2: williamr@2: This method can be called at all times - while actively encoding or not. williamr@2: williamr@2: @param aVadModeOn On output ETrue=On, EFalse=Off williamr@2: @return KErrNone if successful. KErrNotSupported if this method is not implemented williamr@2: or VAD is not supported by the encoder. williamr@2: */ williamr@2: virtual TInt GetVadMode(TBool& aVadModeOn) = 0; williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MIlbcDecoderIntfc williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: const TUid KUidIlbcDecoderIntfc = {0x10282605}; williamr@2: williamr@2: /** williamr@2: This class provides an interface to the Ilbc decoder CMMFHwDevice in order to provide williamr@2: additional configuration information. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MIlbcDecoderIntfc williamr@2: { williamr@2: public: williamr@2: /** The Ibc decoder mode */ williamr@2: enum TDecodeMode williamr@2: { williamr@2: /** 20msFrame */ williamr@2: E20msFrame, williamr@2: /** 30msFrame */ williamr@2: E30msFrame williamr@2: }; williamr@2: williamr@2: /** williamr@2: Informs the decoder of the encoded data format that will be sent to it. williamr@2: williamr@2: This method can be called when decoding is not active - anytime before started or williamr@2: after stopped. williamr@2: williamr@2: @param aDecodeMode the decode mode. williamr@2: williamr@2: @return KErrNone if successful. williamr@2: KErrInUse if this method is used when decoding is active. williamr@2: KErrNotSupported if this method is not implemented. williamr@2: */ williamr@2: virtual TInt SetDecoderMode(TDecodeMode aDecodeMode) = 0; williamr@2: williamr@2: /** williamr@2: Used to enable and disable the comfort noise generation capability. williamr@2: williamr@2: This method is allowable when decoding is not active - anytime before started or williamr@2: after stopped. williamr@2: williamr@2: @param aCng ETrue = comfort noise generation enabled; EFalse = comfort noise williamr@2: generation disabled williamr@2: williamr@2: @return KErrNone if successful. williamr@2: KErrInUse if this method is used when encoding is active. williamr@2: KErrNotSupported if this method is not implemented. williamr@2: */ williamr@2: virtual TInt SetComfortNoiseGeneration(TBool aCng) = 0; williamr@2: williamr@2: /** williamr@2: Used to find out if comfort noise generation is enabled or not. williamr@2: williamr@2: This method is allowable when decoding is not active - anytime before started or williamr@2: after stopped. williamr@2: williamr@2: @param aCng On output ETrue = comfort noise generation enabled; EFalse = comfort williamr@2: noise generation disabled williamr@2: williamr@2: @return KErrNone if successful. williamr@2: KErrInUse if this method is used when encoding is active. williamr@2: KErrNotSupported if this method is not implemented. williamr@2: */ williamr@2: virtual TInt GetComfortNoiseGeneration(TBool& aCng) = 0; williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MIlbcEncoderIntfc williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: const TUid KUidIlbcEncoderIntfc = {0x10282606}; williamr@2: williamr@2: /** williamr@2: This class provides an interface to the Ilbc encoder CMMFHwDevice in order to provide williamr@2: additional configuration information. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MIlbcEncoderIntfc williamr@2: { williamr@2: public: williamr@2: /** The Ibc encoder mode*/ williamr@2: enum TEncodeMode williamr@2: { williamr@2: /** 20msFrame */ williamr@2: E20msFrame, williamr@2: /** 30msFrame */ williamr@2: E30msFrame williamr@2: }; williamr@2: williamr@2: /** williamr@2: Configures the encoder's encoding format. williamr@2: williamr@2: This method is allowable when encoding is not active - anytime before started or williamr@2: after stopped. williamr@2: williamr@2: @param aEncodeMode the encode mode. williamr@2: williamr@2: @return KErrNone if successful. williamr@2: KErrInUse if this method is used when encoding is active. williamr@2: KErrNotSupported if this method is not implemented. williamr@2: */ williamr@2: virtual TInt SetEncoderMode(TEncodeMode aEncodeMode) = 0; williamr@2: williamr@2: /** williamr@2: Controls voice activity detection (VAD) mode. williamr@2: williamr@2: This method is allowable at all times - while actively encoding or not. williamr@2: williamr@2: @param aVadModeOn ETrue=On, EFalse=Off williamr@2: williamr@2: @return KErrNone if successful. williamr@2: KErrNotSupported if this method is not implemented or not supported by the encoder. williamr@2: */ williamr@2: virtual TInt SetVadMode(TBool aVadModeOn) = 0; williamr@2: williamr@2: /** williamr@2: Gets the encoder's current encoding format. williamr@2: williamr@2: This method is allowable when encoding is not active - anytime before started or williamr@2: after stopped. williamr@2: williamr@2: @param &aEncodeMode the encode mode. williamr@2: williamr@2: @return KErrNone if successful. williamr@2: KErrInUse if this method is used when encoding is active. williamr@2: KErrNotSupported if this method is not implemented. williamr@2: */ williamr@2: virtual TInt GetEncoderMode(TEncodeMode &aEncodeMode) = 0; williamr@2: williamr@2: /** williamr@2: Gets the current state of the voice activity detection (VAD) mode. williamr@2: williamr@2: This method is allowable at all times - while actively encoding or not. williamr@2: williamr@2: @param aVadModeOn On output ETrue=On, EFalse=Off williamr@2: williamr@2: @return KErrNone if successful. williamr@2: KErrNotSupported if this method is not implemented or VAD is not supported williamr@2: by the encoder. williamr@2: */ williamr@2: virtual TInt GetVadMode(TBool& aVadModeOn) = 0; williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MMMFErrorConcealmentIntfc williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: const TUid KUidErrorConcealmentIntfc = {0x10282607}; williamr@2: williamr@2: /** williamr@2: This custom interface can be used to indicate that data has been lost. Typical usage williamr@2: would be during streaming. Lost packets of audio data would not get played, but the williamr@2: video data may still be available for playback. If video playback is synchronized to williamr@2: audio then this API can be used to indicate that audio data is lost so that video williamr@2: playback can continue. It could also be used for an audio-only source to maintain williamr@2: synchronization in time if data is lost. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MMMFErrorConcealmentIntfc williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Indicates that next buffer sent to CMMFHwDevice will not contain any valid data, williamr@2: and that a single frame of data has been lost, and that error concealment should williamr@2: be provided for that lost frame. This method will be called after a buffer has been williamr@2: received from the Hardware Device, and before it is returned to the Hardware Device. williamr@2: williamr@2: @return KErrNone if successful. williamr@2: KErrInUse if this method is used out of sequence. williamr@2: KErrNotSupported if this method is not implemented. williamr@2: */ williamr@2: virtual TInt ConcealErrorForNextBuffer() = 0; williamr@2: /** williamr@2: Puts the CMMFHwDevice into frame-based operation. This may be required in cases where williamr@2: the decoder only supports error concealment in a frame-based mode of operation. williamr@2: Operating in frame-based mode means that the decoder requires that each buffer it williamr@2: receives contains only complete data frames. williamr@2: williamr@2: Frame mode is limited to a single frame per buffer. The alternative to frame-based mode williamr@2: is buffer-based mode, the default interface for CMMFHwDevices and decoders. williamr@2: williamr@2: In buffer-based mode, complete data frames are not required to be contained within a williamr@2: single buffer. A data frame may span consecutive data buffers in buffer-based mode. williamr@2: williamr@2: As it is less efficient than buffer-based mode, Frame-based mode should be used as a williamr@2: less-preferred option where errors are present and the CMMFHwDevice implementation would williamr@2: not be tolerant to buffer-based mode error. This condition would be indicated by williamr@2: FrameModeRqrdForEC resulting in its parameter being set to ETrue. williamr@2: williamr@2: This method can be called when decoding is not active - anytime before the CMMFHwDevice williamr@2: is started, or after it is stopped. williamr@2: williamr@2: @param aFrameModeOn ETrue = frame mode on; EFalse = frame mode off. williamr@2: williamr@2: @return KErrNone if successful. williamr@2: KErrInUse if this method is used out of sequence. williamr@2: KErrNotSupported if this method is not implemented. williamr@2: */ williamr@2: virtual TInt SetFrameMode(TBool aFrameModeOn) = 0; williamr@2: williamr@2: /** williamr@2: Queries the CMMFHwDevice to find out if frame mode is required by the implementing williamr@2: CMMFHwDevice in order for it to support error concealment. williamr@2: williamr@2: This method is allowable when decoding is not active - anytime before the CMMFHwDevice williamr@2: is started, or after it is stopped. williamr@2: @param aFrameModeRqrd ETrue = frame mode required; EFalse = frame mode not required williamr@2: @return KErrNone if successful. williamr@2: KErrInUse if this method is used during decoding. williamr@2: KErrNotSupported if this method is not implemented. williamr@2: */ williamr@2: virtual TInt FrameModeRqrdForEC(TBool& aFrameModeRqrd) = 0; williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MAudioVibraControl williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: const TUid KUidAudioVibraControl = {0x10282608}; williamr@2: williamr@2: /** williamr@2: This class provides an interface for controlling vibra. DevSound should interpret the williamr@2: instantiation of this interface as a vibra control request by the user. The default vibra williamr@2: behavior implemented by the DevSound for the associated stream will not be performed while williamr@2: the user has control, In other words whilst this interface is instantiated. DevSound default vibra behavior williamr@2: for the associated stream will return once this interface is deleted. Other instances of williamr@2: DevSound may be instantiated for other audio streams at the same time. When multiple instances williamr@2: of DevSound are instantiated, priority and preference values are used to determine which audio williamr@2: streams are rendered. Prioritization of vibra control is determined by adaptation. Due to williamr@2: resource conflicts, and prioritization by adaptation, it may be possible that an audio stream williamr@2: is played, but not the vibra that accompanies that audio. For instance, if audio is mixed and williamr@2: two audio streams are rendered, vibra playback might not be mixed. Vibra playback may be williamr@2: prioritized by adaptation to a single controller. The behavior in these cases would be based williamr@2: on adaptation implementation. The user is not notified if vibra is not played. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MAudioVibraControl williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Turns vibra on. williamr@2: williamr@2: @return KErrNone if successful KErrNotSupported if this method is not implemented. williamr@2: */ williamr@2: virtual TInt StartVibra() = 0; williamr@2: williamr@2: /** williamr@2: Turns vibra off. williamr@2: williamr@2: @return KErrNone if successful. KErrNotSupported if this method is not implemented. williamr@2: */ williamr@2: virtual TInt StopVibra() = 0; williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MMMFSampleBuffering williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: const TUid KUidSampleBuffering = {0x10282609}; williamr@2: williamr@2: /** williamr@2: Custom interface class to allow DevSound to support buffering of samples before playback begins. williamr@2: This allows playback to be more robust to underflow errors when playback begins at the expense williamr@2: of higher latency before playback starts. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MMMFSampleBuffering williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Enables buffering up of samples before playback begins. This function is only effective before williamr@2: CMMFDevSound::PlayInit() is called - calling the function after this will have no effect. williamr@2: @return "This method may return one of the system-wide error codes." williamr@2: */ williamr@2: virtual TInt MmsbEnableSampleBufferingBeforePlayback() = 0; williamr@2: williamr@2: /** williamr@2: Disables buffering up of samples before playback begins. This function is only effective before williamr@2: CMMFDevSound::PlayInit() is called - calling the function after this will have no effect. williamr@2: @return "This method may return one of the system-wide error codes." williamr@2: */ williamr@2: virtual TInt MmsbDisableSampleBufferingBeforePlayback() = 0; williamr@2: williamr@2: /** williamr@2: Asynchronous request that completes when Playback actually starts. williamr@2: @param "aStatus" "TRequestStatus that will be completed when play actually starts" williamr@2: */ williamr@2: virtual void MmsbNotifyPlayStarted(TRequestStatus& aStatus) = 0; williamr@2: williamr@2: /** williamr@2: Cancel any outstanding asynchronous NotifyPlayStarted requests. williamr@2: */ williamr@2: virtual void MmsbCancelNotifyPlayStarted() = 0; williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MMMFPlaybackStatus. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: const TUid KUidPlaybackStatus = {0x10273811}; williamr@2: williamr@2: /** williamr@2: Custom interface class to enable access to the DevSound implementation to report the number of williamr@2: consumed input bytes, number of successfully decoded samples, samples played, system time and williamr@2: total samples played. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MMMFPlaybackStatus williamr@2: { williamr@2: public: williamr@2: /** Play back status information */ williamr@2: struct TMMFPlaybackStatus williamr@2: { williamr@2: /** Number of consumed input bytes */ williamr@2: TInt64 aInputBytes; williamr@2: /** Number of successfully decoded samples */ williamr@2: TInt64 aDecodedSamples; williamr@2: /** Number of decoded samples played */ williamr@2: TInt64 aDecodedSamplesPlayed; williamr@2: /** Current system time */ williamr@2: TInt64 aSystemTime; williamr@2: /** Total samples played */ williamr@2: TInt64 aTotalSamplesPlayed; williamr@2: }; williamr@2: /** williamr@2: A method to query for detailed status information from a playing DevSound. williamr@2: including timestamp information from the DSP. williamr@2: @param aStatus the current playback status. williamr@2: @return "This method may return one of the system-wide error codes." williamr@2: */ williamr@2: virtual TInt MmpsGetPlaybackStatusInformation(TMMFPlaybackStatus& aStatus)= 0; williamr@2: williamr@2: /** williamr@2: Request notification of loss of sync during decode - the notification will be received williamr@2: in the DevSound client callback SendEventToClient with the event type set to KMMFEventLossOfDecodeSync. williamr@2: williamr@2: @return "This method may return one of the system-wide error codes." williamr@2: */ williamr@2: virtual TInt MmpsRequestLossOfSyncNotification() = 0; williamr@2: williamr@2: /** williamr@2: Cancel the request for notification of loss of sync. williamr@2: williamr@2: @return "This method may return one of the system-wide error codes." williamr@2: */ williamr@2: virtual TInt MmpsCancelLossOfSyncNotification() = 0; williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MMMFDSPControl williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: const TUid KUidDSPControl = {0x1028260A}; williamr@2: williamr@2: /** williamr@2: Custom interface class to allow control of DSP behaviour. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MMMFDSPControl williamr@2: { williamr@2: public: williamr@2: williamr@2: /** williamr@2: Get the timestamp information from the DSP williamr@2: williamr@2: @param aSamplesPlayed - number of audio samples played so far. williamr@2: @param aSystemTime - current system time williamr@2: @param aB - bytes consumed by the decoder williamr@2: @param aT - bytes successfully decoded by the decoder. williamr@2: williamr@2: @return "This method may return one of the system-wide error codes." williamr@2: */ williamr@2: virtual TInt MmdspcGetAudioPlaybackInfo(TInt64& aSamplesPlayed, TInt64& aSystemTime, TUint& aB, TUint& aT) = 0; williamr@2: williamr@2: /** williamr@2: Place DevSound in a mode where overflow/underflow errors on recording are ignored. williamr@2: @return "This method may return one of the system-wide error codes." williamr@2: */ williamr@2: virtual TInt MmdspcAcceptRecordBuffersInvalidFollowingStop() = 0; williamr@2: williamr@2: /** williamr@2: Place DevSound in a mode where overflow/underflow errors on playing are ignored. williamr@2: @return "This method may return one of the system-wide error codes." williamr@2: */ williamr@2: virtual TInt MmdspcAcceptPlaybackBuffersInvalidFollowingStop() = 0; williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MMMFUnderflowAutoStopControl williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: const TUid KUidUnderflowAutoStopControl = {0x1028260B}; williamr@2: williamr@2: /** williamr@2: Custom interface class to control underflow behaviour. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MMMFUnderflowAutoStopControl williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Turn off the default DevSound behaviour of automatically Stopping when an underflow williamr@2: occurs. The underflow will be reported but play can continue when the client sends williamr@2: more data - it is up to the client to call stop even in the case of end of file. williamr@2: williamr@2: @return "This method may return one of the system-wide error codes." williamr@2: */ williamr@2: virtual TInt MmuascTurnOffUnderflowAutoStop() = 0; williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MMMFSetDRMProtected williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: const TUid KUidSetDRMProtected = {0x1028260C}; williamr@2: williamr@2: /** williamr@2: This class provides an interface to mark data being played as DRM protected. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MMMFSetDRMProtected williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Indicate whether the data being played is DRM protected or not williamr@2: williamr@2: @param aDRMProtected the required DRM state. williamr@2: @return "This method may return one of the system-wide error codes." williamr@2: */ williamr@2: virtual TInt MmsdpMarkDataAsDRMProtected(TBool aDRMProtected) = 0; williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MMMFBufferFramesConfig. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: const TUid KUidBufferFramesConfig = {0x1028260D}; williamr@2: williamr@2: /** williamr@2: This class provides an interface to configure and retrive the buffer frames. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MMMFBufferFramesConfig williamr@2: { williamr@2: public: williamr@2: /** williamr@2: For use when encoding to set the number of encoded frames contained in each buffer williamr@2: sent back to the client. The method should be called after CMMFDevSound::InitilaizeL williamr@2: but before RecordInitL. williamr@2: williamr@2: @param aFrameCount - Number of frames per buffer williamr@2: @param aSamplesPerFrame - numer of samples per frame williamr@2: @return "This method may return one of the system-wide error codes." williamr@2: */ williamr@2: virtual TInt MmbfcSetNumberOfFramesPerInputBuffer(TInt aFrameCount, TInt aSamplesPerFrame)=0; williamr@2: williamr@2: /** williamr@2: For use when decoding to set the number of encoded frames contained in each buffer sent williamr@2: down to DevsSund for playback. The method should be called after CMMFDevSound::InitilaizeL williamr@2: but before PlayInitL. williamr@2: williamr@2: @param aFrameCount - Number of frames per buffer williamr@2: @param aSamplesPerFrame - numer of samples per frame williamr@2: williamr@2: @return "This method may return one of the system-wide error codes." williamr@2: */ williamr@2: virtual TInt MmbfcSetNumberOfFramesPerOutputBuffer(TInt aFrameCount, TInt aSamplesPerFrame)=0; williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MMMFGetTimestamps williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: const TUid KUidGetTimestamps = {0x1028260E}; williamr@2: williamr@2: /** williamr@2: This class provides an interface to configure and retrive time stamps. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MMMFGetTimestamps williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Enable or disable support for system timestamps during recording, used for Audio / Video sync. williamr@2: This method can only be called after recording has been initialised, but before recording williamr@2: has started. Once recording is underway, the setting cannot be changed. williamr@2: williamr@2: @param aEnable ETrue to enable recording timestamps, EFalse to disable it. williamr@2: williamr@2: @return KErrNotReady if DevSound has not yet been initialised, KErrNotSupported if williamr@2: DevSound is not in recording mode or KErrInUse if recording is already underway. williamr@2: */ williamr@2: virtual TInt MmgtSetRecordSystemTimestampsEnabled(TBool aEnable) = 0; williamr@2: williamr@2: /** williamr@2: This method returns the system timestamp corresponding to the CMMFDataBuffer with the williamr@2: given position within the recording stream. This timestamp is the system time at which williamr@2: the buffers timestamp, as returned by CMMFBuffer::TimeToPlay, was valid. williamr@2: This method can only be used if the recording timestamps were enabled before recording williamr@2: started using the SetRecordSystemTimestampsEnabled method. williamr@2: williamr@2: @param aBufferPosition The timestamp from the buffer, as returned by CMMFBuffer::TimeToPlay. williamr@2: @param aTimestamp Returns the corresponding system time, in universal time. williamr@2: williamr@2: @return A System error code. williamr@2: KErrNotSupported if recording is not ongoing; williamr@2: KErrNotReady if DevSound is not initialized, or TimeStamps have not been enabled; williamr@2: KErrNotFound if the timestamp given does not correspond to a recent record buffer. williamr@2: */ williamr@2: virtual TInt MmgtGetSystemTimestampForBuffer(const TTimeIntervalMicroSeconds& aBufferPosition, williamr@2: TTime& aTimestamp) const = 0; williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MMMFAdvancedAACEncodeSettings williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: const TUid KUidAdvancedAACEncoderSettings = {0x102825FE}; williamr@2: williamr@2: /** williamr@2: Advanced AAC Encode Bit-rate Configuration williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MMMFAdvancedAACEncodeSettings williamr@2: { williamr@2: public: williamr@2: /** AAC BItrate mode */ williamr@2: enum TAACBitrateMode williamr@2: { williamr@2: /** AACBitrateModeNone */ williamr@2: EAACBitrateModeNone, williamr@2: /** AACBitrateModeAbsolute */ williamr@2: EAACBitrateModeAbsolute, williamr@2: /** AACBitrateModeVariable */ williamr@2: EAACBitrateModeVariable, williamr@2: /** AACBitrateModeFixed */ williamr@2: EAACBitrateModeFixed williamr@2: }; williamr@2: /** williamr@2: SetAACEncodeBitrateMode williamr@2: williamr@2: Set the bitrate mode for AAC encoding. This must be called before the encoding starts. williamr@2: williamr@2: @param aBitrateMode the structure containing the additional information required for decoding the raw AAC. williamr@2: @return KErrNone if successful. KErrInUse if this method is used when decoding is active. williamr@2: */ williamr@2: virtual TInt SetAACEncodeBitrateMode(TAACBitrateMode aBitrateMode)=0; williamr@2: williamr@2: /** williamr@2: This interface returns the current AACEncoding bitrate mode. williamr@2: williamr@2: @param aBitrateMode the structure containing the additional information. williamr@2: @return KErrNone if successful. KErrNotSupported if this method is not implemented. williamr@2: */ williamr@2: virtual TInt GetAACEncodeBitrateMode(TAACBitrateMode& aBitrateMode) = 0; williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: williamr@2: williamr@2: #endif williamr@2: