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).
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.
Public Member Functions | |
---|---|
TInt | ApplyConfig () |
TInt | GetAllocationMethod ( TSbcAllocationMethod &) |
TInt | GetBitpoolSize ( TUint &) |
TInt | GetChannelMode ( TSbcChannelMode &) |
TInt | GetNumOfBlocks ( TUint &) |
TInt | GetNumOfSubbands ( TUint &) |
TInt | GetSamplingFrequency ( TUint &) |
TInt | GetSupportedAllocationMethods ( RArray < TSbcAllocationMethod > &) |
TInt | GetSupportedBitpoolRange ( TUint &, TUint &) |
TInt | GetSupportedChannelModes ( RArray < TSbcChannelMode > &) |
TInt | GetSupportedNumOfBlocks ( RArray < TUint > &) |
TInt | GetSupportedNumOfSubbands ( RArray < TUint > &) |
TInt | GetSupportedSamplingFrequencies ( RArray < TUint > &) |
void | SetAllocationMethod ( TSbcAllocationMethod ) |
void | SetBitpoolSize ( TUint ) |
void | SetChannelMode ( TSbcChannelMode ) |
void | SetNumOfBlocks ( TUint ) |
void | SetNumOfSubbands ( TUint ) |
void | SetSamplingFrequency ( TUint ) |
Public Member Enumerations | |
---|---|
enum | TSbcAllocationMethod { ESbcAllocationSNR , ESbcAllocationLoudness } |
enum | TSbcChannelMode { ESbcChannelMono , ESbcChannelDual , ESbcChannelStereo , ESbcChannelJointStereo } |
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
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.
TSbcAllocationMethod & aAllocationMethod | last setting successfully applied using ApplyConfig(). |
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.
TUint & aBitpoolSize | last setting successfully applied using ApplyConfig(). |
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.
TSbcChannelMode & aChannelMode | last setting successfully applied using ApplyConfig(). |
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.
TUint & aNumOfBlocks | last setting successfully applied using ApplyConfig(). |
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.
TUint & aNumOfSubbands | last setting successfully applied using ApplyConfig(). |
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.
TUint & aSamplingFrequency | last setting successfully applied using ApplyConfig(). |
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.
RArray < TSbcAllocationMethod > & aAllocationMethods | Reference to the location to store the array of supported allocation methods. |
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.
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.
RArray < TSbcChannelMode > & aChannelModes | Reference to the location to store the array of supported channel encoding modes. |
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.
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.
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.
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.
TSbcAllocationMethod 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.
TUint 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.
TSbcChannelMode 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.
TUint 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.
TUint 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.
TUint aSamplingFrequency | values according to standard and supported by encoder. |
This type defines the allocation methods for the SBC encoder.
ESbcAllocationSNR |
SbcAllocationSNR |
ESbcAllocationLoudness |
SbcAllocationLoudness |
Defines the channel modes for the SBC encoder
ESbcChannelMono |
SbcChannelMono |
ESbcChannelDual |
SbcChannelDual |
ESbcChannelStereo |
SbcChannelStereo |
ESbcChannelJointStereo |
SbcChannelJointStereo |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.