Add AudioDeviceVector to MMAP path
This CL adds AudioDeviceVector in the MMAP interface between
AudioFlinger and AAudioService.
Bug: 367816690
Test: OboeTester Test Output
Flag: android.media.audio.routed_device_ids
Change-Id: Ib658a36e91ee9f0336a59855d33cb326497a1bdc
diff --git a/include/media/MmapStreamCallback.h b/include/media/MmapStreamCallback.h
index 76ee6d7..a3876d9 100644
--- a/include/media/MmapStreamCallback.h
+++ b/include/media/MmapStreamCallback.h
@@ -17,6 +17,7 @@
#ifndef ANDROID_AUDIO_MMAP_STREAM_CALLBACK_H
#define ANDROID_AUDIO_MMAP_STREAM_CALLBACK_H
+#include <media/AudioContainers.h>
#include <system/audio.h>
#include <utils/Errors.h>
#include <utils/RefBase.h>
@@ -42,10 +43,10 @@
virtual void onVolumeChanged(float volume) = 0;
/**
- * The device the stream is routed to/from has changed
- * \param[in] onRoutingChanged the unique device ID of the new device.
+ * The devices the stream is routed to/from has changed
+ * \param[in] deviceIds a set of the device IDs of the new devices.
*/
- virtual void onRoutingChanged(audio_port_handle_t deviceId) = 0;
+ virtual void onRoutingChanged(const DeviceIdVector& deviceIds) = 0;
protected:
MmapStreamCallback() {}
diff --git a/include/media/MmapStreamInterface.h b/include/media/MmapStreamInterface.h
index 7725175..3d29335 100644
--- a/include/media/MmapStreamInterface.h
+++ b/include/media/MmapStreamInterface.h
@@ -19,6 +19,7 @@
#include <system/audio.h>
#include <media/AudioClient.h>
+#include <media/AudioContainers.h>
#include <utils/Errors.h>
#include <utils/RefBase.h>
@@ -51,9 +52,10 @@
* Requested parameters as input,
* Actual parameters as output
* \param[in] client a AudioClient struct describing the first client using this stream.
- * \param[in,out] deviceId audio device the stream should preferably be routed to/from
- * Requested as input,
- * Actual as output
+ * \param[in,out] deviceIds audio devices the stream should preferably be routed to/from.
+ * Leave empty if there are no preferred devices.
+ * Requested as input,
+ * Actual as output
* \param[in,out] sessionId audio sessionId for the stream
* Requested as input, may be AUDIO_SESSION_ALLOCATE
* Actual as output
@@ -70,7 +72,7 @@
const audio_attributes_t *attr,
audio_config_base_t *config,
const AudioClient& client,
- audio_port_handle_t *deviceId,
+ DeviceIdVector *deviceIds,
audio_session_t *sessionId,
const sp<MmapStreamCallback>& callback,
sp<MmapStreamInterface>& interface,