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