summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRichard Fitzgerald <rf@opensource.wolfsonmicro.com>2013-03-25 16:18:26 +0000
committerEric Laurent <elaurent@google.com>2013-06-27 17:16:25 -0700
commitb4d07b97d23cfaffe22c7859ad7c45e168a7df0e (patch)
tree1f36a97d335c3d7b597a43f89434e8e4691267ad /include
parent324157de1a8dd109bcc2fb2e8163939dfbf1e860 (diff)
downloadhardware_libhardware_legacy-b4d07b97d23cfaffe22c7859ad7c45e168a7df0e.zip
hardware_libhardware_legacy-b4d07b97d23cfaffe22c7859ad7c45e168a7df0e.tar.gz
hardware_libhardware_legacy-b4d07b97d23cfaffe22c7859ad7c45e168a7df0e.tar.bz2
Add audio policy API changes for audio offload
Changes to the API of audio policy for audio offload support: - Add isOffloadSupported() function - Add OUTPUT_FLAG_OFFLOAD - Extend AudioOutputDescriptor to include a sharing count for direct outputs - Pass audio_offload_info_t when opening output streams Change-Id: I5ad26418fdb286eb7ae299d586dd1fd525d48ab9 Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Eric Laurent <elaurent@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/hardware_legacy/AudioPolicyInterface.h9
-rw-r--r--include/hardware_legacy/AudioPolicyManagerBase.h6
2 files changed, 12 insertions, 3 deletions
diff --git a/include/hardware_legacy/AudioPolicyInterface.h b/include/hardware_legacy/AudioPolicyInterface.h
index d2dd430..3e447c4 100644
--- a/include/hardware_legacy/AudioPolicyInterface.h
+++ b/include/hardware_legacy/AudioPolicyInterface.h
@@ -92,7 +92,9 @@ public:
uint32_t samplingRate = 0,
uint32_t format = AudioSystem::FORMAT_DEFAULT,
uint32_t channels = 0,
- AudioSystem::output_flags flags = AudioSystem::OUTPUT_FLAG_INDIRECT) = 0;
+ AudioSystem::output_flags flags =
+ AudioSystem::OUTPUT_FLAG_INDIRECT,
+ const audio_offload_info_t *offloadInfo = NULL) = 0;
// indicates to the audio policy manager that the output starts being used by corresponding stream.
virtual status_t startOutput(audio_io_handle_t output,
AudioSystem::stream_type stream,
@@ -162,6 +164,8 @@ public:
//dump state
virtual status_t dump(int fd) = 0;
+
+ virtual bool isOffloadSupported(const audio_offload_info_t& offloadInfo) = 0;
};
@@ -192,7 +196,8 @@ public:
audio_format_t *pFormat,
audio_channel_mask_t *pChannelMask,
uint32_t *pLatencyMs,
- audio_output_flags_t flags) = 0;
+ audio_output_flags_t flags,
+ const audio_offload_info_t *offloadInfo = NULL) = 0;
// creates a special output that is duplicated to the two outputs passed as arguments. The duplication is performed by
// a special mixer thread in the AudioFlinger.
virtual audio_io_handle_t openDuplicateOutput(audio_io_handle_t output1, audio_io_handle_t output2) = 0;
diff --git a/include/hardware_legacy/AudioPolicyManagerBase.h b/include/hardware_legacy/AudioPolicyManagerBase.h
index 7ba71e7..cb2a7fa 100644
--- a/include/hardware_legacy/AudioPolicyManagerBase.h
+++ b/include/hardware_legacy/AudioPolicyManagerBase.h
@@ -87,7 +87,8 @@ public:
uint32_t format = AudioSystem::FORMAT_DEFAULT,
uint32_t channels = 0,
AudioSystem::output_flags flags =
- AudioSystem::OUTPUT_FLAG_INDIRECT);
+ AudioSystem::OUTPUT_FLAG_INDIRECT,
+ const audio_offload_info_t *offloadInfo = NULL);
virtual status_t startOutput(audio_io_handle_t output,
AudioSystem::stream_type stream,
int session = 0);
@@ -141,6 +142,8 @@ public:
virtual status_t dump(int fd);
+ virtual bool isOffloadSupported(const audio_offload_info_t& offloadInfo);
+
protected:
enum routing_strategy {
@@ -247,6 +250,7 @@ protected:
audio_devices_t device() const;
void changeRefCount(AudioSystem::stream_type stream, int delta);
+
bool isDuplicated() const { return (mOutput1 != NULL && mOutput2 != NULL); }
audio_devices_t supportedDevices();
uint32_t latency();