libhardware_legacy: Add support for DirectTrack
-Add new APIs to AudioStreamOut class.
-Add audio output flags to openOutputStream.
Change-Id: Idcbca5d8ea3bd3f7ea008e42ae685f3f1b24dc6c
(cherry picked from commit c2238e581c815dbf33625011ad32a97067d1ab52)
(cherry picked from commit 87d4ab5eee4124403012cb3e5440d36eb0df9586)
diff --git a/include/hardware_legacy/AudioHardwareInterface.h b/include/hardware_legacy/AudioHardwareInterface.h
index b466000..25572bf 100644
--- a/include/hardware_legacy/AudioHardwareInterface.h
+++ b/include/hardware_legacy/AudioHardwareInterface.h
@@ -1,5 +1,7 @@
/*
* Copyright (C) 2007 The Android Open Source Project
+ * Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
+ * Not a Contribution.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -115,6 +117,16 @@
* presented
*/
virtual status_t getNextWriteTimestamp(int64_t *timestamp);
+ virtual status_t start() {return INVALID_OPERATION;}
+ virtual status_t pause() {return INVALID_OPERATION;}
+ virtual status_t flush() {return INVALID_OPERATION;}
+ virtual status_t stop() {return INVALID_OPERATION;}
+ virtual int setObserver(void *observer) {return INVALID_OPERATION;}
+ virtual status_t getBufferInfo(buf_info **buf) {return INVALID_OPERATION;}
+ virtual status_t isBufferAvailable(int *isAvail) {
+ *isAvail = true;
+ return NO_ERROR;
+ }
};
diff --git a/include/hardware_legacy/AudioPolicyManagerBase.h b/include/hardware_legacy/AudioPolicyManagerBase.h
index 482ea86..0de4055 100644
--- a/include/hardware_legacy/AudioPolicyManagerBase.h
+++ b/include/hardware_legacy/AudioPolicyManagerBase.h
@@ -1,5 +1,7 @@
/*
* Copyright (C) 2009 The Android Open Source Project
+ * Copyright (c) 2012, The Linux Foundation. All rights reserved.
+ * Not a Contribution.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -356,7 +358,7 @@
// change the route of the specified output. Returns the number of ms we have slept to
// allow new routing to take effect in certain cases.
- uint32_t setOutputDevice(audio_io_handle_t output,
+ virtual uint32_t setOutputDevice(audio_io_handle_t output,
audio_devices_t device,
bool force = false,
int delayMs = 0);
@@ -377,7 +379,7 @@
virtual float computeVolume(int stream, int index, audio_io_handle_t output, audio_devices_t device);
// check that volume change is permitted, compute and send new volume to audio hardware
- status_t checkAndSetVolume(int stream, int index, audio_io_handle_t output, audio_devices_t device, int delayMs = 0, bool force = false);
+ virtual status_t checkAndSetVolume(int stream, int index, audio_io_handle_t output, audio_devices_t device, int delayMs = 0, bool force = false);
// apply all stream volumes to the specified output and device
void applyStreamVolumes(audio_io_handle_t output, audio_devices_t device, int delayMs = 0, bool force = false);
@@ -390,7 +392,7 @@
audio_devices_t device = (audio_devices_t)0);
// Mute or unmute the stream on the specified output
- void setStreamMute(int stream,
+ virtual void setStreamMute(int stream,
bool on,
audio_io_handle_t output,
int delayMs = 0,