MEAacPlusDecoderIntfc Class Reference

class MEAacPlusDecoderIntfc

This class provides an interface to the eAAC+ decoder hwdevice in order to provide configuration information.

The Get.. methods can be used to retrieve the last successfully applied configuration parameters. A message is not sent to adaptation or the decoder. Instead, a locally saved set of the parameters will be updated upon successful use of ApplyConfig() . It is these saved values that the proxy maintains that will be returned to the user. For instance, if two interfaces are used and one interface is used to modify the settings, the other interface's Get methods would not return those settings. The Get.. methods will return an error if a successful use of ApplyConfig() has not been performed.

The Set.. methods are used to update a configuration structure within the implementation of the interface. When the interface is instantiated, the state of SBR and Downsampled modes will be disabled. Therefore it is not necessary to configure these parameters before using ApplyConfig() the first time. However, once modified using this instance of the interface, they remain in that state until Set.. again. The values of these items are updated in an internal structure when each Set.. is called.

The ApplyConfig() method is used to configure the encoder with the parameters specified by the Set.. methods. ApplyConfig will send back an error (KErrUnknown) if not all items are Set at least once. This check and the parameter values returned will be implemented in the interface proxy and will not query the actual decoder. The exception to this is for configuration parameters with defined default values (see next paragraph).

Calling ApplyConfig() will send these values using a single message to the message handler. ApplyConfig() should fail if it is used during decoding with a KErrInUse (or, as previously stated, KErrUnknown if a value without a default is not set). Since the interface proxy is not aware of decoding state, this check would have to be done in the adaptation implementation for this interface.

Member Functions Documentation

ApplyConfig()

TInt ApplyConfig ( ) [pure virtual]

Used to configure the decoder with parameters passed in the Set methods.

This method can be called all times but will return an KErrInUse if the configuration parameters would change while decoding (as none of the set parameters can be changed during decoding). This checking operational state of the decoder would be done by the adaptation implementation of this interface since the interface proxy is not aware of the decoder state. The adaptation implementation will return an error if incorrect values are used to configure the decoder.

GetAudioObjectType(TAudioObjectType &)

TInt GetAudioObjectType ( TAudioObjectType & aAudioObjectType ) [pure virtual]

Returns the object type of the core decoder that was last successfully configured by the ApplyConfig() method.

This method can be called at all times.

Parameters

TAudioObjectType & aAudioObjectType last setting successfully applied using ApplyConfig().

GetDownSampledMode(TBool &)

TInt GetDownSampledMode ( TBool & aDsmEnabled ) [pure virtual]

Returns the downsampled mode that was last successfully configured by the ApplyConfig() method.

This method can be called at all times. It will return an error if used before ApplyConfig() has been used successfully.

Parameters

TBool & aDsmEnabled last setting successfully applied using ApplyConfig().

GetInputSamplingFrequency(TUint &)

TInt GetInputSamplingFrequency ( TUint & aInputSamplingFrequency ) [pure virtual]

Returns the value of the sampling frequency of the decoder that was last successfully configured by the ApplyConfig() method.

This method can be called at all times but must be called after a value has been set via the ApplyConfig

Parameters

TUint & aInputSamplingFrequency last setting successfully applied using ApplyConfig().

GetNumOfChannels(TUint &)

TInt GetNumOfChannels ( TUint & aNumOfChannels ) [pure virtual]

Returns the number of channels that was last successfully configured by the ApplyConfig() method.

This method can be called at all times. It will return an error if used before ApplyConfig() has been used successfully.

Parameters

TUint & aNumOfChannels last setting successfully applied using ApplyConfig().

GetSbr(TBool &)

TInt GetSbr ( TBool & aSbrEnabled ) [pure virtual]

Returns the SBR mode that was last successfully configured by the ApplyConfig() method.

This method can be called at all times. It will return an error if used before ApplyConfig() has been used successfully.

Parameters

TBool & aSbrEnabled last setting successfully applied using ApplyConfig().

SetAudioObjectType(TAudioObjectType)

void SetAudioObjectType ( TAudioObjectType aAudioObjectType ) [pure virtual]

Sets the object type of the core decoder to be configured by the ApplyConfig() method.

This method can be called at all times but if ApplyConfig() is subsequently called after changing this value whilst decoding, a KErrInUse error will result.

Parameters

TAudioObjectType aAudioObjectType TAudioObjectType for core decoder as supported by the decoder.

SetDownSampledMode(TBool)

void SetDownSampledMode ( TBool aDsmEnabled ) [pure virtual]

Controls the downsampled mode of the decoder to be configured by the ApplyConfig() method. This setting is only meaningful if SBR is enabled.

This method can be called at all times but if ApplyConfig() is subsequently called after changing this value whilst decoding, a KErrInUse error will result.

Parameters

TBool aDsmEnabled ETrue - downsampled mode enabled, EFalse - downsampled mode disabled.

SetInputSamplingFrequency(TUint)

void SetInputSamplingFrequency ( TUint aInputSamplingFrequency ) [pure virtual]

Sets the value of the sampling frequency of the decoder to be configured by the ApplyConfig() method. This is the sample rate of the core decoder, not the output sampling frequency of the decoder. This method can be called at all times but if ApplyConfig() is subsequently called after changing this value whilst decoding, a KErrInUse error will result.

Parameters

TUint aInputSamplingFrequency value of the sampling frequency.

SetNumOfChannels(TUint)

void SetNumOfChannels ( TUint aNumOfChannels ) [pure virtual]

Sets the number of channels for the output of the decoder to be configured by the ApplyConfig() method. The use of this method is to ensure coordination of output channels rendered by the decoder and channel configuration of the audio system. This method does not imply that stereo to mono downmix is supported by the decoder. The main purpose is for the case considering the presence of PS. A user may not know if the decoder output will be mono or stereo based on header information alone, but may configure the decoder for two channel output to match the audio system configuration. If the user were to set the output to 1 channel and stereo data is present, the decoder may choose only one channel to output or to downmix the stereo to mono. Regarding this interface, it would be more desirable to configure the decoder when it is known to be mono source data and rely on downmix from the audio system instead of from the decoder. The decoder, however, would provide for duplicating mono data into 2 channel data when configured for 2 channels and the source data contains only 1 channel. This method is allowable at all times - while actively encoding or not, but using ApplyConfig() if changing this value while encoding will return an error.

Parameters

TUint aNumOfChannels 1 - output one channel audio = 0; 2 - output two channel audio.

SetSbr(TBool)

void SetSbr ( TBool aSbrEnabled ) [pure virtual]

Controls the SBR mode of the decoder to be configured by the ApplyConfig() method.

If SBR is enabled and no SBR data is present, the audio data will be upsampled, unless Down Sampled mode is enabled.

This method can be called at all times but if ApplyConfig() is subsequently called after changing this value whilst decoding, a KErrInUse error will result.

Parameters

TBool aSbrEnabled ETrue - SBR mode enabled, EFalse - SBR mode disabled

Member Enumerations Documentation

Enum TAudioObjectType

Defines additional configuration elements required to decode eAAC+.

Enumerators

ENull = 0

Null

EAacLc = 2

AacLc

EAacLtp = 4

AacLtp