MSbcEncoderIntfc Class Reference

#include <mmf/server/devsoundstandardcustominterfaces.h>

Link against: tsu_mdf_omxvorbiscodecs.lib

class MSbcEncoderIntfc

Detailed Description

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).

Note:

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.

Member Enumeration Documentation

Enum TSbcAllocationMethod

This type defines the allocation methods for the SBC encoder.

EnumeratorValueDescription
ESbcAllocationSNR

SbcAllocationSNR

ESbcAllocationLoudness

SbcAllocationLoudness

Enum TSbcChannelMode

Defines the channel modes for the SBC encoder

EnumeratorValueDescription
ESbcChannelMono

SbcChannelMono

ESbcChannelDual

SbcChannelDual

ESbcChannelStereo

SbcChannelStereo

ESbcChannelJointStereo

SbcChannelJointStereo

Member Function Documentation

ApplyConfig ( )

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.

Note:

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).

GetAllocationMethod ( TSbcAllocationMethod & )

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.

ParameterDescription
aAllocationMethodlast 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).

GetBitpoolSize ( TUint & )

TInt GetBitpoolSize(TUint &aBitpoolSize)[pure virtual]

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.

ParameterDescription
aBitpoolSizelast 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).

GetChannelMode ( TSbcChannelMode & )

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.

ParameterDescription
aChannelModelast 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.

GetNumOfBlocks ( TUint & )

TInt GetNumOfBlocks(TUint &aNumOfBlocks)[pure virtual]

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.

ParameterDescription
aNumOfBlockslast 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)

GetNumOfSubbands ( TUint & )

TInt GetNumOfSubbands(TUint &aNumOfSubbands)[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.

ParameterDescription
aNumOfSubbandslast 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)

GetSamplingFrequency ( TUint & )

TInt GetSamplingFrequency(TUint &aSamplingFrequency)[pure virtual]

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.

ParameterDescription
aSamplingFrequencylast 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).

GetSupportedAllocationMethods ( RArray< TSbcAllocationMethod > & )

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.

ParameterDescription
aAllocationMethodsReference to the location to store the array of supported allocation methods.

Returns: KErrNone if successful, KErrNotSupported if this method is not supported.

GetSupportedBitpoolRange ( TUint &, TUint & )

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.

ParameterDescription
aMinSupportedBitpoolSizeminimum bitpool value allowed by the encoder.
aMaxSupportedBitpoolSizemaximum bitpool value allowed by the encoder.

Returns: KErrNone if successful, KErrNotSupported if this method is not supported.

GetSupportedChannelModes ( RArray< TSbcChannelMode > & )

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.

ParameterDescription
aChannelModesReference to the location to store the array of supported channel encoding modes.

Returns: KErrNone if successful, KErrNotSupported if this method is not supported.

GetSupportedNumOfBlocks ( RArray< TUint > & )

TInt GetSupportedNumOfBlocks(RArray< TUint > &aNumOfBlocks)[pure virtual]

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.

ParameterDescription
aNumOfBlocksReference to the location to store the array of supported number of blocks.

Returns: KErrNone if successful, KErrNotSupported if this method is not supported.

GetSupportedNumOfSubbands ( RArray< TUint > & )

TInt GetSupportedNumOfSubbands(RArray< TUint > &aNumOfSubbands)[pure virtual]

Retrieves the number of subbands supported by the encoder. See the class comments for details.

This method can be called at all times.

ParameterDescription
aNumOfSubbandsReference to the location to store the array of supported number of subbands.

Returns: KErrNone if successful, KErrNotSupported if this method is not supported.

GetSupportedSamplingFrequencies ( RArray< TUint > & )

TInt GetSupportedSamplingFrequencies(RArray< TUint > &aSamplingFrequencies)[pure virtual]

Retrieves the sampling frequencies supported by the encoder. See the class comments for details. This method can be called at all times.

ParameterDescription
aSamplingFrequenciesReference to the location to store the array of supported sampling frequencies.

Returns: KErrNone if successful, KErrNotSupported if this method is not supported.

SetAllocationMethod ( TSbcAllocationMethod )

voidSetAllocationMethod(TSbcAllocationMethodaAllocationMethod)[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.

ParameterDescription
aAllocationMethodESbcAllocationSNR, ESbcAllocationLoudness when supported by encoder

SetBitpoolSize ( TUint )

voidSetBitpoolSize(TUintaBitpoolSize)[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.

ParameterDescription
aBitpoolSizevalues according to standard and supported by encoder.

SetChannelMode ( TSbcChannelMode )

voidSetChannelMode(TSbcChannelModeaChannelMode)[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.

ParameterDescription
aChannelMode(ESbcChannelMono, ESbcChannelDual, ESbcChannelStereo, ESbcChannelJointStereo) when supported by encoder.

SetNumOfBlocks ( TUint )

voidSetNumOfBlocks(TUintaNumOfBlocks)[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.

ParameterDescription
aNumOfBlocksvalues according to standard and supported by encoder.

SetNumOfSubbands ( TUint )

voidSetNumOfSubbands(TUintaNumOfSubbands)[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.

ParameterDescription
aNumOfSubbandsvalues according to standard and supported by encoder.

SetSamplingFrequency ( TUint )

voidSetSamplingFrequency(TUintaSamplingFrequency)[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.

ParameterDescription
aSamplingFrequencyvalues according to standard and supported by encoder.