diff options
author | Dima Zavin <dima@android.com> | 2011-04-19 22:30:36 -0700 |
---|---|---|
committer | Dima Zavin <dima@android.com> | 2011-04-27 13:10:10 -0700 |
commit | 24fc2fb1c541e954b83fd31ea9f786a5e9b45501 (patch) | |
tree | e85b3ff86b73d56e16ab640919d251c046371c65 /voip | |
parent | 4dc22e77cfd2a1c3671e5646ee87c5e4c15596a0 (diff) | |
download | frameworks_base-24fc2fb1c541e954b83fd31ea9f786a5e9b45501.zip frameworks_base-24fc2fb1c541e954b83fd31ea9f786a5e9b45501.tar.gz frameworks_base-24fc2fb1c541e954b83fd31ea9f786a5e9b45501.tar.bz2 |
audio/media: convert to using the audio HAL and new audio defs
Change-Id: Ibc637918637329e4f2b62f4ac7781102fbc269f5
Signed-off-by: Dima Zavin <dima@android.com>
Diffstat (limited to 'voip')
-rw-r--r-- | voip/jni/rtp/AudioGroup.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/voip/jni/rtp/AudioGroup.cpp b/voip/jni/rtp/AudioGroup.cpp index 41fedce..8b31996 100644 --- a/voip/jni/rtp/AudioGroup.cpp +++ b/voip/jni/rtp/AudioGroup.cpp @@ -41,6 +41,8 @@ #include <media/AudioTrack.h> #include <media/mediarecorder.h> +#include <hardware/audio.h> + #include "jni.h" #include "JNIHelp.h" @@ -767,10 +769,10 @@ bool AudioGroup::DeviceThread::threadLoop() // Find out the frame count for AudioTrack and AudioRecord. int output = 0; int input = 0; - if (AudioTrack::getMinFrameCount(&output, AudioSystem::VOICE_CALL, + if (AudioTrack::getMinFrameCount(&output, AUDIO_STREAM_VOICE_CALL, sampleRate) != NO_ERROR || output <= 0 || AudioRecord::getMinFrameCount(&input, sampleRate, - AudioSystem::PCM_16_BIT, 1) != NO_ERROR || input <= 0) { + AUDIO_FORMAT_PCM_16_BIT, 1) != NO_ERROR || input <= 0) { LOGE("cannot compute frame count"); return false; } @@ -787,10 +789,10 @@ bool AudioGroup::DeviceThread::threadLoop() // Initialize AudioTrack and AudioRecord. AudioTrack track; AudioRecord record; - if (track.set(AudioSystem::VOICE_CALL, sampleRate, AudioSystem::PCM_16_BIT, - AudioSystem::CHANNEL_OUT_MONO, output) != NO_ERROR || record.set( - AUDIO_SOURCE_VOICE_COMMUNICATION, sampleRate, AudioSystem::PCM_16_BIT, - AudioSystem::CHANNEL_IN_MONO, input) != NO_ERROR) { + if (track.set(AUDIO_STREAM_VOICE_CALL, sampleRate, AUDIO_FORMAT_PCM_16_BIT, + AUDIO_CHANNEL_OUT_MONO, output) != NO_ERROR || record.set( + AUDIO_SOURCE_VOICE_COMMUNICATION, sampleRate, AUDIO_FORMAT_PCM_16_BIT, + AUDIO_CHANNEL_IN_MONO, input) != NO_ERROR) { LOGE("cannot initialize audio device"); return false; } |