summaryrefslogtreecommitdiffstats
path: root/include/hardware_legacy/AudioPolicyManagerBase.h
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2012-06-21 09:55:49 -0700
committerEric Laurent <elaurent@google.com>2012-06-21 15:10:31 -0700
commitc952527e6f89d5427881462823514be9d79f13e6 (patch)
tree093f8acf07fd60650b8d56754fe4c2b8a2d23fc8 /include/hardware_legacy/AudioPolicyManagerBase.h
parent20eade73390ac941b9ebbe19177393e70531db8b (diff)
downloadhardware_libhardware_legacy-c952527e6f89d5427881462823514be9d79f13e6.zip
hardware_libhardware_legacy-c952527e6f89d5427881462823514be9d79f13e6.tar.gz
hardware_libhardware_legacy-c952527e6f89d5427881462823514be9d79f13e6.tar.bz2
audio policy: fix HDMI hot plug
When an HDMI sink is connected it is possible that a direct output is made available for multichannel audio. In this case, the list of outputs available to reach the HDMI device after the connection is different from before. checkOutputForStrategy() must take this into account in order to invalidate tracks so that they can be re connected to the multi channel output if necessary. Change-Id: Id0baeb51688eba8017fe96bf92aaac52eb8e0f59
Diffstat (limited to 'include/hardware_legacy/AudioPolicyManagerBase.h')
-rw-r--r--include/hardware_legacy/AudioPolicyManagerBase.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/include/hardware_legacy/AudioPolicyManagerBase.h b/include/hardware_legacy/AudioPolicyManagerBase.h
index 96041c6..1ab9431 100644
--- a/include/hardware_legacy/AudioPolicyManagerBase.h
+++ b/include/hardware_legacy/AudioPolicyManagerBase.h
@@ -330,7 +330,7 @@ protected:
// 2 access to either current device selection (fromCache == true) or
// "future" device selection (fromCache == false) when called from a context
// where conditions are changing (setDeviceConnectionState(), setPhoneState()...) AND
- // before updateDeviceForStrategy() is called.
+ // before updateDevicesAndOutputs() is called.
virtual audio_devices_t getDeviceForStrategy(routing_strategy strategy,
bool fromCache);
@@ -400,7 +400,7 @@ protected:
// checks and if necessary changes outputs used for all strategies.
// must be called every time a condition that affects the output choice for a given strategy
// changes: connected device, phone state, force use...
- // Must be called before updateDeviceForStrategy()
+ // Must be called before updateDevicesAndOutputs()
void checkOutputForStrategy(routing_strategy strategy);
// Same as checkOutputForStrategy() but for a all strategies in order of priority
@@ -424,7 +424,7 @@ protected:
// cached values are used by getDeviceForStrategy() if parameter fromCache is true.
// Must be called after checkOutputForAllStrategies()
- void updateDeviceForStrategy();
+ void updateDevicesAndOutputs();
// true if current platform requires a specific output to be opened for this particular
// set of parameters. This function is called by getOutput() and is implemented by platform
@@ -452,7 +452,8 @@ protected:
// extract one device relevant for volume control from multiple device selection
static audio_devices_t getDeviceForVolume(audio_devices_t device);
- SortedVector<audio_io_handle_t> getOutputsForDevice(audio_devices_t device);
+ SortedVector<audio_io_handle_t> getOutputsForDevice(audio_devices_t device,
+ DefaultKeyedVector<audio_io_handle_t, AudioOutputDescriptor *> openOutputs);
bool vectorsEqual(SortedVector<audio_io_handle_t>& outputs1,
SortedVector<audio_io_handle_t>& outputs2);
@@ -498,7 +499,11 @@ protected:
AudioPolicyClientInterface *mpClientInterface; // audio policy client interface
audio_io_handle_t mPrimaryOutput; // primary output handle
- DefaultKeyedVector<audio_io_handle_t, AudioOutputDescriptor *> mOutputs; // list of output descriptors
+ // list of descriptors for outputs currently opened
+ DefaultKeyedVector<audio_io_handle_t, AudioOutputDescriptor *> mOutputs;
+ // copy of mOutputs before setDeviceConnectionState() opens new outputs
+ // reset to mOutputs when updateDevicesAndOutputs() is called.
+ DefaultKeyedVector<audio_io_handle_t, AudioOutputDescriptor *> mPreviousOutputs;
DefaultKeyedVector<audio_io_handle_t, AudioInputDescriptor *> mInputs; // list of input descriptors
audio_devices_t mAvailableOutputDevices; // bit field of all available output devices
audio_devices_t mAvailableInputDevices; // bit field of all available input devices