diff options
| author | Eric Laurent <elaurent@google.com> | 2010-07-21 09:52:17 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2010-07-21 09:52:17 -0700 |
| commit | 0119ba5bd3335fe026927eeb65de535a7bd8c838 (patch) | |
| tree | 8199a5f834701fa8cc57108876f74e7f102f8b62 /media/jni/android_media_MediaPlayer.cpp | |
| parent | 921ec6f5542b7f1a459458b7426cb62521f2c8ce (diff) | |
| parent | 34161132030254bac7dd64c9713832e2f961a061 (diff) | |
| download | frameworks_base-0119ba5bd3335fe026927eeb65de535a7bd8c838.zip frameworks_base-0119ba5bd3335fe026927eeb65de535a7bd8c838.tar.gz frameworks_base-0119ba5bd3335fe026927eeb65de535a7bd8c838.tar.bz2 | |
am 34161132: am 7070b365: Added support for auxiliary audio effects to AudioTrack and MediaPlayer.
Merge commit '34161132030254bac7dd64c9713832e2f961a061'
* commit '34161132030254bac7dd64c9713832e2f961a061':
Added support for auxiliary audio effects to AudioTrack and MediaPlayer.
Diffstat (limited to 'media/jni/android_media_MediaPlayer.cpp')
| -rw-r--r-- | media/jni/android_media_MediaPlayer.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/media/jni/android_media_MediaPlayer.cpp b/media/jni/android_media_MediaPlayer.cpp index 5c2ec00..6710db0 100644 --- a/media/jni/android_media_MediaPlayer.cpp +++ b/media/jni/android_media_MediaPlayer.cpp @@ -714,6 +714,28 @@ static jint android_media_MediaPlayer_get_audio_session_id(JNIEnv *env, jobject return mp->getAudioSessionId(); } +static void +android_media_MediaPlayer_setAuxEffectSendLevel(JNIEnv *env, jobject thiz, jfloat level) +{ + LOGV("setAuxEffectSendLevel: level %f", level); + sp<MediaPlayer> mp = getMediaPlayer(env, thiz); + if (mp == NULL ) { + jniThrowException(env, "java/lang/IllegalStateException", NULL); + return; + } + process_media_player_call( env, thiz, mp->setAuxEffectSendLevel(level), NULL, NULL ); +} + +static void android_media_MediaPlayer_attachAuxEffect(JNIEnv *env, jobject thiz, jint effectId) { + LOGV("attachAuxEffect(): %d", sessionId); + sp<MediaPlayer> mp = getMediaPlayer(env, thiz); + if (mp == NULL ) { + jniThrowException(env, "java/lang/IllegalStateException", NULL); + return; + } + process_media_player_call( env, thiz, mp->attachAuxEffect(effectId), NULL, NULL ); +} + // ---------------------------------------------------------------------------- static JNINativeMethod gMethods[] = { @@ -748,6 +770,8 @@ static JNINativeMethod gMethods[] = { {"native_suspend_resume", "(Z)I", (void *)android_media_MediaPlayer_native_suspend_resume}, {"getAudioSessionId", "()I", (void *)android_media_MediaPlayer_get_audio_session_id}, {"setAudioSessionId", "(I)V", (void *)android_media_MediaPlayer_set_audio_session_id}, + {"setAuxEffectSendLevel", "(F)V", (void *)android_media_MediaPlayer_setAuxEffectSendLevel}, + {"attachAuxEffect", "(I)V", (void *)android_media_MediaPlayer_attachAuxEffect}, }; static const char* const kClassPathName = "android/media/MediaPlayer"; |
