MSbcEncoderIntfc Class Reference

class MSbcEncoderIntfc

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 Functions 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

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.

Parameters

TSbcAllocationMethod & aAllocationMethodlast setting successfully applied using ApplyConfig().

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.

Parameters

TUint & aBitpoolSizelast setting successfully applied using ApplyConfig().

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.

Parameters

TSbcChannelMode & aChannelModelast setting successfully applied using ApplyConfig().

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.

Parameters

TUint & aNumOfBlockslast setting successfully applied using ApplyConfig().

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.

Parameters

TUint & aNumOfSubbandslast setting successfully applied using ApplyConfig().

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.

Parameters

TUint & aSamplingFrequencylast setting successfully applied using ApplyConfig().

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.

Parameters

RArray< TSbcAllocationMethod > & aAllocationMethodsReference to the location to store the array of supported allocation methods.

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.

Parameters

TUint & aMinSupportedBitpoolSizeminimum bitpool value allowed by the encoder.
TUint & aMaxSupportedBitpoolSizemaximum bitpool value allowed by the encoder.

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.

Parameters

RArray< TSbcChannelMode > & aChannelModesReference to the location to store the array of supported channel encoding modes.

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.

Parameters

RArray< TUint > & aNumOfBlocksReference to the location to store the array of supported number of blocks.

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.

Parameters

RArray< TUint > & aNumOfSubbandsReference to the location to store the array of supported number of subbands.

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.

Parameters

RArray< TUint > & aSamplingFrequenciesReference to the location to store the array of supported sampling frequencies.

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.

Parameters

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

Parameters

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

Parameters

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

Parameters

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

Parameters

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

Parameters

TUint aSamplingFrequencyvalues according to standard and supported by encoder.

Member Enumerations Documentation

Enum TSbcAllocationMethod

This type defines the allocation methods for the SBC encoder.

Enumerators

ESbcAllocationSNR

SbcAllocationSNR

ESbcAllocationLoudness

SbcAllocationLoudness

Enum TSbcChannelMode

Defines the channel modes for the SBC encoder

Enumerators

ESbcChannelMono

SbcChannelMono

ESbcChannelDual

SbcChannelDual

ESbcChannelStereo

SbcChannelStereo

ESbcChannelJointStereo

SbcChannelJointStereo