#include <mmf/server/devsoundstandardcustominterfaces.h>
class MEAacPlusDecoderIntfc |
Public Member Enumerations | |
---|---|
enum | TAudioObjectType { ENull, EAacLc, EAacLtp } |
Public Member Functions | |
---|---|
pure virtual TInt | ApplyConfig() |
pure virtual TInt | GetAudioObjectType(TAudioObjectType &) |
pure virtual TInt | GetDownSampledMode(TBool &) |
pure virtual TInt | GetInputSamplingFrequency(TUint &) |
pure virtual TInt | GetNumOfChannels(TUint &) |
pure virtual TInt | GetSbr(TBool &) |
pure virtual void | SetAudioObjectType(TAudioObjectType) |
pure virtual void | SetDownSampledMode(TBool) |
pure virtual void | SetInputSamplingFrequency(TUint) |
pure virtual void | SetNumOfChannels(TUint) |
pure virtual void | SetSbr(TBool) |
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.
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.
Returns: KErrNone if successful, KErrNotSupported if this method is not implemented, KErrInUse if encoding in active and values are changed that are not allowed to be changed during encoding, KErrArgument if one of the configuration items is not appropriate or not set.
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.
Parameter | Description |
---|---|
aAudioObjectType | last setting successfully applied using ApplyConfig(). |
Returns: KErrNone if value returned successfully, KErrUnknown if value has not been successfully configured using ApplyConfig() at least once for the current instance of the interface.
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.
Parameter | Description |
---|---|
aDsmEnabled | last setting successfully applied using ApplyConfig(). |
Returns: KErrNone if value returned successfully, KErrUnknown if value has not been successfully configured using ApplyConfig() at least once for the current instance of the interface.
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
Parameter | Description |
---|---|
aInputSamplingFrequency | last setting successfully applied using ApplyConfig(). |
Returns: KErrNone if value returned successfully, KErrUnknown if value has not been successfully configured using ApplyConfig() at least once for the current instance of the interface or KErrInUse if the encoder is active.
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.
Parameter | Description |
---|---|
aNumOfChannels | last setting successfully applied using ApplyConfig(). |
Returns: KErrNone if value returned successfully, KErrUnknown if value has not been successfully configured using ApplyConfig() at least once for the current instance of the interface.
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.
Parameter | Description |
---|---|
aSbrEnabled | last setting successfully applied using ApplyConfig(). |
Returns: KErrNone if value returned successfully, KErrUnknown if value has not been successfully configured using ApplyConfig() at least once for the current instance of the interface.
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.
Parameter | Description |
---|---|
aAudioObjectType | TAudioObjectType for core decoder as supported by the decoder. |
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.
Parameter | Description |
---|---|
aDsmEnabled | ETrue - downsampled mode enabled, EFalse - downsampled mode disabled. |
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.
Parameter | Description |
---|---|
aInputSamplingFrequency | value of the sampling frequency. |
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.
Parameter | Description |
---|---|
aNumOfChannels | 1 - output one channel audio = 0; 2 - output two channel audio. |
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.
Parameter | Description |
---|---|
aSbrEnabled | ETrue - SBR mode enabled, EFalse - SBR mode disabled |