diff options
author | Ricardo Cerqueira <github@cerqueira.org> | 2011-11-16 18:40:30 +0000 |
---|---|---|
committer | Ricardo Cerqueira <github@cerqueira.org> | 2011-12-12 22:32:43 +0000 |
commit | f091f60752b0f1078ffc7711ad4fd025180e53ad (patch) | |
tree | 241191d36e1e01612e67953c4d8224793d2d453e /media/libmedia/AudioSystem.cpp | |
parent | 67a59617d493ed8a7ff1ec236a9300efcbc19abb (diff) | |
download | frameworks_base-f091f60752b0f1078ffc7711ad4fd025180e53ad.zip frameworks_base-f091f60752b0f1078ffc7711ad4fd025180e53ad.tar.gz frameworks_base-f091f60752b0f1078ffc7711ad4fd025180e53ad.tar.bz2 |
audio: Add compatibility bits to use legacy libaudio implementations
Enable with BOARD_USES_AUDIO_LEGACY, requires the use of the generic
legacy audio shim
Diffstat (limited to 'media/libmedia/AudioSystem.cpp')
-rw-r--r-- | media/libmedia/AudioSystem.cpp | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp index 7b14c18..7d28b6f 100644 --- a/media/libmedia/AudioSystem.cpp +++ b/media/libmedia/AudioSystem.cpp @@ -750,5 +750,65 @@ void AudioSystem::AudioPolicyServiceClient::binderDied(const wp<IBinder>& who) { LOGW("AudioPolicyService server died!"); } +#ifdef USES_AUDIO_LEGACY +extern "C" uint32_t _ZN7android11AudioSystem8popCountEj(uint32_t u) +{ + return popcount(u); +} + +extern "C" bool _ZN7android11AudioSystem12isA2dpDeviceENS0_13audio_devicesE(uint32_t device) +{ + return audio_is_a2dp_device((audio_devices_t)device); +} + +extern "C" bool _ZN7android11AudioSystem13isInputDeviceENS0_13audio_devicesE(uint32_t device) +{ + return audio_is_input_device((audio_devices_t)device); +} + +extern "C" bool _ZN7android11AudioSystem14isOutputDeviceENS0_13audio_devicesE(uint32_t device) +{ + return audio_is_output_device((audio_devices_t)device); +} + +extern "C" bool _ZN7android11AudioSystem20isBluetoothScoDeviceENS0_13audio_devicesE(uint32_t device) +{ + return audio_is_bluetooth_sco_device((audio_devices_t)device); +} + +extern "C" status_t _ZN7android11AudioSystem24setDeviceConnectionStateENS0_13audio_devicesENS0_23device_connection_stateEPKc(audio_devices_t device, + audio_policy_dev_state_t state, + const char *device_address) +{ + return AudioSystem::setDeviceConnectionState(device, state, device_address); +} + +extern "C" audio_io_handle_t _ZN7android11AudioSystem9getOutputENS0_11stream_typeEjjjNS0_12output_flagsE(audio_stream_type_t stream, + uint32_t samplingRate, + uint32_t format, + uint32_t channels, + audio_policy_output_flags_t flags) +{ + return AudioSystem::getOutput(stream,samplingRate,format,channels>>2,flags); +} + +extern "C" bool _ZN7android11AudioSystem11isLinearPCMEj(uint32_t format) +{ + return audio_is_linear_pcm(format); +} + +extern "C" bool _ZN7android11AudioSystem15isLowVisibilityENS0_11stream_typeE(audio_stream_type_t stream) +{ + if (stream == AUDIO_STREAM_SYSTEM || + stream == AUDIO_STREAM_NOTIFICATION || + stream == AUDIO_STREAM_RING) { + return true; + } else { + return false; + } +} + +#endif // AUDIO_LEGACY + }; // namespace android |