From 3cdfddf1b27bcb5408ca3a04fcdf206447ba07ba Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Mon, 30 Apr 2012 18:28:24 -0700 Subject: audio policy: improve support for direct outputs Add the capability to query supported parameters for direct outputs after a device is connected. This allows to dynamically update the output profile for devices like HDMI where the capabilities depend on the connected sink. Also added very verbose log mode for volume and mute. Change-Id: I1d4ba8e7dbc3e1af883582857ce93240441e551c --- include/hardware_legacy/AudioPolicyManagerBase.h | 10 +++++++--- include/hardware_legacy/audio_policy_conf.h | 4 ++++ 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/hardware_legacy/AudioPolicyManagerBase.h b/include/hardware_legacy/AudioPolicyManagerBase.h index a918d39..96041c6 100644 --- a/include/hardware_legacy/AudioPolicyManagerBase.h +++ b/include/hardware_legacy/AudioPolicyManagerBase.h @@ -203,6 +203,9 @@ protected: void dump(int fd); + // by convention, "0' in the first entry in mSamplingRates, mChannelMasks or mFormats + // indicates the supported parameters should be read from the output stream + // after it is opened for the first time Vector mSamplingRates; // supported sampling rates Vector mChannelMasks; // supported channel masks Vector mFormats; // supported audio formats @@ -387,8 +390,9 @@ protected: // when a device is disconnected, checks if an output is not used any more and // returns its handle if any. // transfers the audio tracks and effects from one output thread to another accordingly. - audio_io_handle_t checkOutputForDevice(audio_devices_t device, - AudioSystem::device_connection_state state); + status_t checkOutputsForDevice(audio_devices_t device, + AudioSystem::device_connection_state state, + SortedVector& outputs); // close an output and its companion duplicating output. void closeOutput(audio_io_handle_t output); @@ -466,7 +470,7 @@ protected: uint32_t samplingRate, uint32_t format, uint32_t channelMask); - audio_module_handle_t getModuleForDirectoutput(audio_devices_t device, + IOProfile *getProfileForDirectOutput(audio_devices_t device, uint32_t samplingRate, uint32_t format, uint32_t channelMask, diff --git a/include/hardware_legacy/audio_policy_conf.h b/include/hardware_legacy/audio_policy_conf.h index c1fc0c1..fa58c36 100644 --- a/include/hardware_legacy/audio_policy_conf.h +++ b/include/hardware_legacy/audio_policy_conf.h @@ -47,4 +47,8 @@ #define DEVICES_TAG "devices" #define FLAGS_TAG "flags" +#define DYNAMIC_VALUE_TAG "dynamic" // special value for "channel_masks", "sampling_rates" and + // "formats" in outputs descriptors indicating that supported + // values should be queried after opening the output. + #endif // ANDROID_AUDIO_POLICY_CONF_H -- cgit v1.1