Loading media/libaudioclient/AudioSystem.cpp +5 −3 Original line number Diff line number Diff line Loading @@ -1972,8 +1972,8 @@ bool AudioSystem::isHapticPlaybackSupported() { return result.value_or(false); } status_t AudioSystem::getHwOffloadEncodingFormatsSupportedForA2DP( std::vector<audio_format_t>* formats) { status_t AudioSystem::getHwOffloadFormatsSupportedForBluetoothMedia( audio_devices_t device, std::vector<audio_format_t>* formats) { if (formats == nullptr) { return BAD_VALUE; } Loading @@ -1983,8 +1983,10 @@ status_t AudioSystem::getHwOffloadEncodingFormatsSupportedForA2DP( if (aps == 0) return PERMISSION_DENIED; std::vector<AudioFormatDescription> formatsAidl; AudioDeviceDescription deviceAidl = VALUE_OR_RETURN_STATUS( legacy2aidl_audio_devices_t_AudioDeviceDescription(device)); RETURN_STATUS_IF_ERROR(statusTFromBinderStatus( aps->getHwOffloadEncodingFormatsSupportedForA2DP(&formatsAidl))); aps->getHwOffloadFormatsSupportedForBluetoothMedia(deviceAidl, &formatsAidl))); *formats = VALUE_OR_RETURN_STATUS( convertContainer<std::vector<audio_format_t>>( formatsAidl, Loading media/libaudioclient/aidl/android/media/IAudioPolicyService.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -295,7 +295,8 @@ interface IAudioPolicyService { void getReportedSurroundFormats(inout Int count, out AudioFormatDescription[] formats); AudioFormatDescription[] getHwOffloadEncodingFormatsSupportedForA2DP(); AudioFormatDescription[] getHwOffloadFormatsSupportedForBluetoothMedia( in AudioDeviceDescription device); void setSurroundFormatEnabled(in AudioFormatDescription audioFormat, boolean enabled); Loading media/libaudioclient/include/media/AudioSystem.h +2 −2 Original line number Diff line number Diff line Loading @@ -424,8 +424,8 @@ public: static status_t getMicrophones(std::vector<media::MicrophoneInfo> *microphones); static status_t getHwOffloadEncodingFormatsSupportedForA2DP( std::vector<audio_format_t> *formats); static status_t getHwOffloadFormatsSupportedForBluetoothMedia( audio_devices_t device, std::vector<audio_format_t> *formats); // numSurroundFormats holds the maximum number of formats and bool value allowed in the array. // When numSurroundFormats is 0, surroundFormats and surroundFormatsEnabled will not be Loading media/libaudiofoundation/AudioContainers.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,13 @@ const DeviceTypeSet& getAudioDeviceInAllUsbSet() { return audioDeviceInAllUsbSet; } const DeviceTypeSet& getAudioDeviceOutAllBleSet() { static const DeviceTypeSet audioDeviceOutAllBleSet = DeviceTypeSet( std::begin(AUDIO_DEVICE_OUT_ALL_BLE_ARRAY), std::end(AUDIO_DEVICE_OUT_ALL_BLE_ARRAY)); return audioDeviceOutAllBleSet; } bool deviceTypesToString(const DeviceTypeSet &deviceTypes, std::string &str) { if (deviceTypes.empty()) { str = "Empty device types"; Loading media/libaudiofoundation/include/media/AudioContainers.h +1 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ const DeviceTypeSet& getAudioDeviceOutAllScoSet(); const DeviceTypeSet& getAudioDeviceOutAllUsbSet(); const DeviceTypeSet& getAudioDeviceInAllSet(); const DeviceTypeSet& getAudioDeviceInAllUsbSet(); const DeviceTypeSet& getAudioDeviceOutAllBleSet(); template<typename T> static std::vector<T> Intersection(const std::set<T>& a, const std::set<T>& b) { Loading Loading
media/libaudioclient/AudioSystem.cpp +5 −3 Original line number Diff line number Diff line Loading @@ -1972,8 +1972,8 @@ bool AudioSystem::isHapticPlaybackSupported() { return result.value_or(false); } status_t AudioSystem::getHwOffloadEncodingFormatsSupportedForA2DP( std::vector<audio_format_t>* formats) { status_t AudioSystem::getHwOffloadFormatsSupportedForBluetoothMedia( audio_devices_t device, std::vector<audio_format_t>* formats) { if (formats == nullptr) { return BAD_VALUE; } Loading @@ -1983,8 +1983,10 @@ status_t AudioSystem::getHwOffloadEncodingFormatsSupportedForA2DP( if (aps == 0) return PERMISSION_DENIED; std::vector<AudioFormatDescription> formatsAidl; AudioDeviceDescription deviceAidl = VALUE_OR_RETURN_STATUS( legacy2aidl_audio_devices_t_AudioDeviceDescription(device)); RETURN_STATUS_IF_ERROR(statusTFromBinderStatus( aps->getHwOffloadEncodingFormatsSupportedForA2DP(&formatsAidl))); aps->getHwOffloadFormatsSupportedForBluetoothMedia(deviceAidl, &formatsAidl))); *formats = VALUE_OR_RETURN_STATUS( convertContainer<std::vector<audio_format_t>>( formatsAidl, Loading
media/libaudioclient/aidl/android/media/IAudioPolicyService.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -295,7 +295,8 @@ interface IAudioPolicyService { void getReportedSurroundFormats(inout Int count, out AudioFormatDescription[] formats); AudioFormatDescription[] getHwOffloadEncodingFormatsSupportedForA2DP(); AudioFormatDescription[] getHwOffloadFormatsSupportedForBluetoothMedia( in AudioDeviceDescription device); void setSurroundFormatEnabled(in AudioFormatDescription audioFormat, boolean enabled); Loading
media/libaudioclient/include/media/AudioSystem.h +2 −2 Original line number Diff line number Diff line Loading @@ -424,8 +424,8 @@ public: static status_t getMicrophones(std::vector<media::MicrophoneInfo> *microphones); static status_t getHwOffloadEncodingFormatsSupportedForA2DP( std::vector<audio_format_t> *formats); static status_t getHwOffloadFormatsSupportedForBluetoothMedia( audio_devices_t device, std::vector<audio_format_t> *formats); // numSurroundFormats holds the maximum number of formats and bool value allowed in the array. // When numSurroundFormats is 0, surroundFormats and surroundFormatsEnabled will not be Loading
media/libaudiofoundation/AudioContainers.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,13 @@ const DeviceTypeSet& getAudioDeviceInAllUsbSet() { return audioDeviceInAllUsbSet; } const DeviceTypeSet& getAudioDeviceOutAllBleSet() { static const DeviceTypeSet audioDeviceOutAllBleSet = DeviceTypeSet( std::begin(AUDIO_DEVICE_OUT_ALL_BLE_ARRAY), std::end(AUDIO_DEVICE_OUT_ALL_BLE_ARRAY)); return audioDeviceOutAllBleSet; } bool deviceTypesToString(const DeviceTypeSet &deviceTypes, std::string &str) { if (deviceTypes.empty()) { str = "Empty device types"; Loading
media/libaudiofoundation/include/media/AudioContainers.h +1 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ const DeviceTypeSet& getAudioDeviceOutAllScoSet(); const DeviceTypeSet& getAudioDeviceOutAllUsbSet(); const DeviceTypeSet& getAudioDeviceInAllSet(); const DeviceTypeSet& getAudioDeviceInAllUsbSet(); const DeviceTypeSet& getAudioDeviceOutAllBleSet(); template<typename T> static std::vector<T> Intersection(const std::set<T>& a, const std::set<T>& b) { Loading