#include <mmf/server/devsoundstandardcustominterfaces.h>
class MSbcEncoderIntfc |
Public Member Enumerations | |
---|---|
enum | TSbcAllocationMethod { ESbcAllocationSNR, ESbcAllocationLoudness } |
enum | TSbcChannelMode { ESbcChannelMono, ESbcChannelDual, ESbcChannelStereo, ESbcChannelJointStereo } |
This class provides an interface to the SBC encoder hwdevice in order to provide configuration information.
The Get... supported methods can be used to check capabilities of the encoder by retrieving the last successfully applied configuration parameters. The purpose of the Get functions is to return the last successfully applied configuration of decoder by this interface. 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(). The Get.. methods return an error (KErrUnknown ) if a successful use of ApplyConfig() has not been performed apart from the following methods, which return the range of properties supported by the implementation ( GetSupportedSamplingFrequencies, GetSupportedChannelModes, GetSupportedNumOfSubbands, GetSupportedAllocationMethods, GetSupportedNumOfBlocks, GetSupportedBitpoolRange). These methods do not have setter functions as they are not configurable and hence will return valid data at all times.
ApplyConfig() will send these values using one message with these values in the internally defined structure. The message handler should define this structure in the SBC messages header file. ApplyConfig() should fail (KErrInUse) if it is used during encoding and any values are changed other than bitpool value. Since the interface proxy is not aware of encoding state, this check would have to be done in the adaptation implementation for this interface. The Bitpool can be updated during encoding to change the bitrate. This would require the use of the SetBitpoolSize() and ApplyConfig() methods. Any other parameters can be changed but will result in a KErrInUse when ApplyConfig() is called.
The Set... methods are used update a client-side maintained configuration structure within the implementation of the interface. When the structure is completed, ApplyConfig() should be called to send these client side settings to the actual hwdevice implementation. There are no default values for the configuration parameters (hence all values must be set before ApplyConfig() is called or an error (KErrArgument) will result).
This constraint is only true for configurations where this is supported (e.g. If GetSupportedChannelModes returns KErrNotSupported then SetChannelMode does not need to be set before ApplyConfig() is called). This check and the parameter values returned will be implemented in the interface proxy and will not query the actual encoder. If multiple instances of the interface are created, each would have this requirement.
TInt | ApplyConfig | ( | ) | [pure virtual] |
Used to configure the encoder with parameters passed in the Set methods. This method can be called at all times - while actively encoding or not. An error (KErrInUse) will be returned if any configuration parameter, other than bitpool size, is changed while encoding. This checking operational state of the encoder would be done by the adaptation implementation of this interface since the interface proxy is not aware of the encoder state. Also, the adaptation implementation will return an error if incorrect values are used to configure the encoder.
Even though some preliminary checking is done in the set methods (to see if it is valid to set the values at all) it is expected that
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 if all the values are not set (unless some of the values are not supported, in which case these values should be ignored).
TInt | GetAllocationMethod | ( | TSbcAllocationMethod & | aAllocationMethod | ) | [pure virtual] |
Gets the allocation method of the encoder that was last successfully configured by the ApplyConfig() method.
This method can be called at all times - while actively encoding or not, but will return an error if used before ApplyConfig() has been used successfully.
Parameter | Description |
---|---|
aAllocationMethod | 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, KErrNotSupported if this method is not implemented (to match its set and getsupported methods).
Gets the size of the bitpool of the encoder that was last successfully configured by the ApplyConfig() method.
This method can be called at all times - while actively encoding or not, but will return an error if used before ApplyConfig() has been used successfully.
Parameter | Description |
---|---|
aBitpoolSize | 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, KErrNotSupported if this method is not implemented (to match its set and getsupported methods).
TInt | GetChannelMode | ( | TSbcChannelMode & | aChannelMode | ) | [pure virtual] |
Gets the channel mode of the encoder that was last successfully configured by the ApplyConfig() method.
This method can be called at all times - while actively encoding or not, but will return an error if used before ApplyConfig() has been used successfully.
Parameter | Description |
---|---|
aChannelMode | 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.
Gets the number of blocks of the encoder that was last successfully configured by the ApplyConfig() method.
This method can be called at all times - while actively encoding or not, but will return an error if used before ApplyConfig() has been used successfully.
Parameter | Description |
---|---|
aNumOfBlocks | 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, KErrNotSupported if this method is not implemented (to match its set and getsupported methods)
Gets the channel mode of the encoder that was last successfully configured by the ApplyConfig() method.
This method can be called at all times - while actively encoding or not, but will return an error if used before ApplyConfig() has been used successfully.
Parameter | Description |
---|---|
aNumOfSubbands | 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, KErrNotSupported if this method is not implemented (to match its set and getsupported methods)
Gets the value of the sampling frequency of the encoder that was last successfully configured by the ApplyConfig() method.
This method can be called at all times - while actively encoding or not, but will return an error if used before ApplyConfig() has been used successfully.
Parameter | Description |
---|---|
aSamplingFrequency | 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, KErrNotSupported if this method is not implemented (to match its set and getsupported methods).
TInt | GetSupportedAllocationMethods | ( | RArray< TSbcAllocationMethod > & | aAllocationMethods | ) | [pure virtual] |
Retrieves the allocation methods supported by the encoder. See the class comments for details.
This method can be called at all times.
Parameter | Description |
---|---|
aAllocationMethods | Reference to the location to store the array of supported allocation methods. |
Returns: KErrNone if successful, KErrNotSupported if this method is not supported.
TInt | GetSupportedBitpoolRange | ( | TUint & | aMinSupportedBitpoolSize, |
TUint & | aMaxSupportedBitpoolSize | |||
) | [pure virtual] |
Retrieves the min and max bitpool values supported by the encoder. See the class comments for details.
This method can be called at all times but and ApplyConfig() can be called to change the value whilst encoding.
Parameter | Description |
---|---|
aMinSupportedBitpoolSize | minimum bitpool value allowed by the encoder. |
aMaxSupportedBitpoolSize | maximum bitpool value allowed by the encoder. |
Returns: KErrNone if successful, KErrNotSupported if this method is not supported.
TInt | GetSupportedChannelModes | ( | RArray< TSbcChannelMode > & | aChannelModes | ) | [pure virtual] |
Retrieves the channel encoding supported by the encoder. See the class comments for details.
This method can be called at all times.
Parameter | Description |
---|---|
aChannelModes | Reference to the location to store the array of supported channel encoding modes. |
Returns: KErrNone if successful, KErrNotSupported if this method is not supported.
Retrieves the number of blocks supported by the encoder. See the class comments for details.
This method can be called at all times but if ApplyConfig() is subsequently called after changing this value whilst encoding, a KErrInUse error will result.
Parameter | Description |
---|---|
aNumOfBlocks | Reference to the location to store the array of supported number of blocks. |
Returns: KErrNone if successful, KErrNotSupported if this method is not supported.
Retrieves the number of subbands supported by the encoder. See the class comments for details.
This method can be called at all times.
Parameter | Description |
---|---|
aNumOfSubbands | Reference to the location to store the array of supported number of subbands. |
Returns: KErrNone if successful, KErrNotSupported if this method is not supported.
Retrieves the sampling frequencies supported by the encoder. See the class comments for details. This method can be called at all times.
Parameter | Description |
---|---|
aSamplingFrequencies | Reference to the location to store the array of supported sampling frequencies. |
Returns: KErrNone if successful, KErrNotSupported if this method is not supported.
void | SetAllocationMethod | ( | TSbcAllocationMethod | aAllocationMethod | ) | [pure virtual] |
Sets the allocation method of the encoder 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 encoding, a KErrInUse error will result.
Parameter | Description |
---|---|
aAllocationMethod | ESbcAllocationSNR, ESbcAllocationLoudness when supported by encoder |
void | SetBitpoolSize | ( | TUint | aBitpoolSize | ) | [pure virtual] |
Sets the size of the bitpool of the encoder to be configured by the ApplyConfig() method.
This method is allowable at all times - while actively encoding or not.
Parameter | Description |
---|---|
aBitpoolSize | values according to standard and supported by encoder. |
void | SetChannelMode | ( | TSbcChannelMode | aChannelMode | ) | [pure virtual] |
Sets the channel mode of the encoder to be configured by the ApplyConfig() method. See the class comments for details.
This method can be called at all times but if ApplyConfig() is subsequently called after changing this value whilst encoding, a KErrInUse error will result.
Parameter | Description |
---|---|
aChannelMode | (ESbcChannelMono, ESbcChannelDual, ESbcChannelStereo, ESbcChannelJointStereo) when supported by encoder. |
void | SetNumOfBlocks | ( | TUint | aNumOfBlocks | ) | [pure virtual] |
Sets the number of blocks of the encoder 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 encoding, a KErrInUse error will result.
Parameter | Description |
---|---|
aNumOfBlocks | values according to standard and supported by encoder. |
void | SetNumOfSubbands | ( | TUint | aNumOfSubbands | ) | [pure virtual] |
Sets the channel mode of the encoder 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 encoding, a KErrInUse error will result.
Parameter | Description |
---|---|
aNumOfSubbands | values according to standard and supported by encoder. |
void | SetSamplingFrequency | ( | TUint | aSamplingFrequency | ) | [pure virtual] |
Sets the value of the sampling frequency of the encoder 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 encoding, a KErrInUse error will result.
Parameter | Description |
---|---|
aSamplingFrequency | values according to standard and supported by encoder. |