summaryrefslogtreecommitdiffstats
path: root/core/jni/android_media_AudioSystem.cpp
diff options
context:
space:
mode:
authorDima Zavin <dima@android.com>2011-04-19 22:30:36 -0700
committerDima Zavin <dima@android.com>2011-04-27 13:10:10 -0700
commit24fc2fb1c541e954b83fd31ea9f786a5e9b45501 (patch)
treee85b3ff86b73d56e16ab640919d251c046371c65 /core/jni/android_media_AudioSystem.cpp
parent4dc22e77cfd2a1c3671e5646ee87c5e4c15596a0 (diff)
downloadframeworks_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 'core/jni/android_media_AudioSystem.cpp')
-rw-r--r--core/jni/android_media_AudioSystem.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/core/jni/android_media_AudioSystem.cpp b/core/jni/android_media_AudioSystem.cpp
index 5016bf9..09c0953 100644
--- a/core/jni/android_media_AudioSystem.cpp
+++ b/core/jni/android_media_AudioSystem.cpp
@@ -30,6 +30,9 @@
#include <media/AudioSystem.h>
#include <media/AudioTrack.h>
+#include <hardware/audio.h>
+#include <hardware/audio_policy.h>
+
// ----------------------------------------------------------------------------
using namespace android;
@@ -129,8 +132,8 @@ static int
android_media_AudioSystem_setDeviceConnectionState(JNIEnv *env, jobject thiz, jint device, jint state, jstring device_address)
{
const char *c_address = env->GetStringUTFChars(device_address, NULL);
- int status = check_AudioSystem_Command(AudioSystem::setDeviceConnectionState(static_cast <AudioSystem::audio_devices>(device),
- static_cast <AudioSystem::device_connection_state>(state),
+ int status = check_AudioSystem_Command(AudioSystem::setDeviceConnectionState(static_cast <audio_devices_t>(device),
+ static_cast <audio_policy_dev_state_t>(state),
c_address));
env->ReleaseStringUTFChars(device_address, c_address);
return status;
@@ -140,7 +143,7 @@ static int
android_media_AudioSystem_getDeviceConnectionState(JNIEnv *env, jobject thiz, jint device, jstring device_address)
{
const char *c_address = env->GetStringUTFChars(device_address, NULL);
- int state = static_cast <int>(AudioSystem::getDeviceConnectionState(static_cast <AudioSystem::audio_devices>(device),
+ int state = static_cast <int>(AudioSystem::getDeviceConnectionState(static_cast <audio_devices_t>(device),
c_address));
env->ReleaseStringUTFChars(device_address, c_address);
return state;
@@ -161,20 +164,20 @@ android_media_AudioSystem_setRingerMode(JNIEnv *env, jobject thiz, jint mode, ji
static int
android_media_AudioSystem_setForceUse(JNIEnv *env, jobject thiz, jint usage, jint config)
{
- return check_AudioSystem_Command(AudioSystem::setForceUse(static_cast <AudioSystem::force_use>(usage),
- static_cast <AudioSystem::forced_config>(config)));
+ return check_AudioSystem_Command(AudioSystem::setForceUse(static_cast <audio_policy_force_use_t>(usage),
+ static_cast <audio_policy_forced_cfg_t>(config)));
}
static int
android_media_AudioSystem_getForceUse(JNIEnv *env, jobject thiz, jint usage)
{
- return static_cast <int>(AudioSystem::getForceUse(static_cast <AudioSystem::force_use>(usage)));
+ return static_cast <int>(AudioSystem::getForceUse(static_cast <audio_policy_force_use_t>(usage)));
}
static int
android_media_AudioSystem_initStreamVolume(JNIEnv *env, jobject thiz, jint stream, jint indexMin, jint indexMax)
{
- return check_AudioSystem_Command(AudioSystem::initStreamVolume(static_cast <AudioSystem::stream_type>(stream),
+ return check_AudioSystem_Command(AudioSystem::initStreamVolume(static_cast <audio_stream_type_t>(stream),
indexMin,
indexMax));
}
@@ -182,14 +185,14 @@ android_media_AudioSystem_initStreamVolume(JNIEnv *env, jobject thiz, jint strea
static int
android_media_AudioSystem_setStreamVolumeIndex(JNIEnv *env, jobject thiz, jint stream, jint index)
{
- return check_AudioSystem_Command(AudioSystem::setStreamVolumeIndex(static_cast <AudioSystem::stream_type>(stream), index));
+ return check_AudioSystem_Command(AudioSystem::setStreamVolumeIndex(static_cast <audio_stream_type_t>(stream), index));
}
static int
android_media_AudioSystem_getStreamVolumeIndex(JNIEnv *env, jobject thiz, jint stream)
{
int index;
- if (AudioSystem::getStreamVolumeIndex(static_cast <AudioSystem::stream_type>(stream), &index) != NO_ERROR) {
+ if (AudioSystem::getStreamVolumeIndex(static_cast <audio_stream_type_t>(stream), &index) != NO_ERROR) {
index = -1;
}
return index;
@@ -198,7 +201,7 @@ android_media_AudioSystem_getStreamVolumeIndex(JNIEnv *env, jobject thiz, jint s
static jint
android_media_AudioSystem_getDevicesForStream(JNIEnv *env, jobject thiz, jint stream)
{
- return (jint) AudioSystem::getDevicesForStream(static_cast <AudioSystem::stream_type>(stream));
+ return (jint) AudioSystem::getDevicesForStream(static_cast <audio_stream_type_t>(stream));
}
// ----------------------------------------------------------------------------