@ -26,14 +26,30 @@
namespace android {
DeviceDescriptor : : DeviceDescriptor ( audio_devices_t type , const std : : string & tagName ) :
DeviceDescriptor ( type , FormatVector { } , tagName )
DeviceDescriptor : : DeviceDescriptor ( audio_devices_t type ) :
DeviceDescriptor ( type , " " /*tagName*/ )
{
}
DeviceDescriptor : : DeviceDescriptor ( audio_devices_t type , const FormatVector & encodedFormats ,
const std : : string & tagName ) :
DeviceDescriptorBase ( type ) , mTagName ( tagName ) , mEncodedFormats ( encodedFormats )
DeviceDescriptor : : DeviceDescriptor ( audio_devices_t type ,
const std : : string & tagName ,
const FormatVector & encodedFormats ) :
DeviceDescriptor ( type , tagName , " " /*address*/ , encodedFormats )
{
}
DeviceDescriptor : : DeviceDescriptor ( audio_devices_t type ,
const std : : string & tagName ,
const std : : string & address ,
const FormatVector & encodedFormats ) :
DeviceDescriptor ( AudioDeviceTypeAddr ( type , address ) , tagName , encodedFormats )
{
}
DeviceDescriptor : : DeviceDescriptor ( const AudioDeviceTypeAddr & deviceTypeAddr ,
const std : : string & tagName ,
const FormatVector & encodedFormats ) :
DeviceDescriptorBase ( deviceTypeAddr ) , mTagName ( tagName ) , mEncodedFormats ( encodedFormats )
{
mCurrentEncodedFormat = AUDIO_FORMAT_DEFAULT ;
/* If framework runs against a pre 5.0 Audio HAL, encoded formats are absent from the config.
@ -41,7 +57,7 @@ DeviceDescriptor::DeviceDescriptor(audio_devices_t type, const FormatVector &enc
* For now , the workaround to remove AC3 and IEC61937 support on HDMI is to declare
* something like ' encodedFormats = " AUDIO_FORMAT_PCM_16_BIT " ' on the HDMI devicePort .
*/
if ( t ype = = AUDIO_DEVICE_OUT_HDMI & & mEncodedFormats . empty ( ) ) {
if ( mDeviceTypeAddr. mT ype = = AUDIO_DEVICE_OUT_HDMI & & mEncodedFormats . empty ( ) ) {
mEncodedFormats . push_back ( AUDIO_FORMAT_AC3 ) ;
mEncodedFormats . push_back ( AUDIO_FORMAT_IEC61937 ) ;
}