diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2014-07-22 16:19:14 -0700 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2014-07-27 11:28:39 -0700 |
commit | 0fb47759256ecdaedbc34c880238bc9d102ef160 (patch) | |
tree | 5db1d019fb672abc86ebf1d3a331b429e423eaea /services/audiopolicy/AudioPolicyManager.h | |
parent | 03c556ae1eb409ad088c49037e185946c54e1d25 (diff) | |
download | frameworks_av-0fb47759256ecdaedbc34c880238bc9d102ef160.zip frameworks_av-0fb47759256ecdaedbc34c880238bc9d102ef160.tar.gz frameworks_av-0fb47759256ecdaedbc34c880238bc9d102ef160.tar.bz2 |
AudioPolicyManager: handle outputs for different addresses
Add the notion of device types that cause the device address
to be taken into account, i.e. multiple devices of the
same type but with a different address can be connected/
disconnected.
AUDIO_DEVICE_OUT_REMOTE_SUBMIX is such a device type.
When making those devices available / unavailable, look for
all outputs with a matching address.
Bug 16009464
Change-Id: I260f8248b7794c4932094e876afdf29fdea007a3
Diffstat (limited to 'services/audiopolicy/AudioPolicyManager.h')
-rw-r--r-- | services/audiopolicy/AudioPolicyManager.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.h b/services/audiopolicy/AudioPolicyManager.h index e9ec78e..a420192 100644 --- a/services/audiopolicy/AudioPolicyManager.h +++ b/services/audiopolicy/AudioPolicyManager.h @@ -339,6 +339,8 @@ protected: DeviceVector getDevicesFromType(audio_devices_t types) const; sp<DeviceDescriptor> getDeviceFromId(audio_port_handle_t id) const; sp<DeviceDescriptor> getDeviceFromName(const String8& name) const; + DeviceVector getDevicesFromTypeAddr(audio_devices_t type, String8 address) + const; private: void refreshTypes(); @@ -534,7 +536,8 @@ protected: audio_devices_t device, bool force = false, int delayMs = 0, - audio_patch_handle_t *patchHandle = NULL); + audio_patch_handle_t *patchHandle = NULL, + const char* address = NULL); status_t resetOutputDevice(audio_io_handle_t output, int delayMs = 0, audio_patch_handle_t *patchHandle = NULL); @@ -774,6 +777,15 @@ private: // routing of notifications void handleNotificationRoutingForStream(audio_stream_type_t stream); static bool isVirtualInputDevice(audio_devices_t device); + static bool deviceDistinguishesOnAddress(audio_devices_t device); + // find the outputs on a given output descriptor that have the given address. + // to be called on an AudioOutputDescriptor whose supported devices (as defined + // in mProfile->mSupportedDevices) matches the device whose address is to be matched. + // see deviceDistinguishesOnAddress(audio_devices_t) for whether the device type is one + // where addresses are used to distinguish between one connected device and another. + void findIoHandlesByAddress(sp<AudioOutputDescriptor> desc /*in*/, + const String8 address /*in*/, + SortedVector<audio_io_handle_t>& outputs /*out*/); uint32_t nextUniqueId(); uint32_t nextAudioPortGeneration(); uint32_t curAudioPortGeneration() const { return mAudioPortGeneration; } |