| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/audio/android/audio_manager_android.h" | 5 #include "media/audio/android/audio_manager_android.h" |
| 6 | 6 |
| 7 #include "base/android/build_info.h" | 7 #include "base/android/build_info.h" |
| 8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 j_audio_manager_.obj()); | 287 j_audio_manager_.obj()); |
| 288 } | 288 } |
| 289 | 289 |
| 290 void AudioManagerAndroid::Close() { | 290 void AudioManagerAndroid::Close() { |
| 291 Java_AudioManagerAndroid_close( | 291 Java_AudioManagerAndroid_close( |
| 292 base::android::AttachCurrentThread(), | 292 base::android::AttachCurrentThread(), |
| 293 j_audio_manager_.obj()); | 293 j_audio_manager_.obj()); |
| 294 } | 294 } |
| 295 | 295 |
| 296 void AudioManagerAndroid::SetMute(JNIEnv* env, jobject obj, jboolean muted) { | 296 void AudioManagerAndroid::SetMute(JNIEnv* env, jobject obj, jboolean muted) { |
| 297 GetMessageLoop()->PostTask( | 297 GetTaskRunner()->PostTask( |
| 298 FROM_HERE, | 298 FROM_HERE, |
| 299 base::Bind( | 299 base::Bind( |
| 300 &AudioManagerAndroid::DoSetMuteOnAudioThread, | 300 &AudioManagerAndroid::DoSetMuteOnAudioThread, |
| 301 base::Unretained(this), | 301 base::Unretained(this), |
| 302 muted)); | 302 muted)); |
| 303 } | 303 } |
| 304 | 304 |
| 305 void AudioManagerAndroid::DoSetMuteOnAudioThread(bool muted) { | 305 void AudioManagerAndroid::DoSetMuteOnAudioThread(bool muted) { |
| 306 base::AutoLock lock(streams_lock_); | 306 base::AutoLock lock(streams_lock_); |
| 307 for (OutputStreams::iterator it = streams_.begin(); | 307 for (OutputStreams::iterator it = streams_.begin(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 j_audio_manager_.obj()); | 342 j_audio_manager_.obj()); |
| 343 } | 343 } |
| 344 | 344 |
| 345 int AudioManagerAndroid::GetAudioLowLatencyOutputFrameSize() { | 345 int AudioManagerAndroid::GetAudioLowLatencyOutputFrameSize() { |
| 346 return Java_AudioManagerAndroid_getAudioLowLatencyOutputFrameSize( | 346 return Java_AudioManagerAndroid_getAudioLowLatencyOutputFrameSize( |
| 347 base::android::AttachCurrentThread(), | 347 base::android::AttachCurrentThread(), |
| 348 j_audio_manager_.obj()); | 348 j_audio_manager_.obj()); |
| 349 } | 349 } |
| 350 | 350 |
| 351 } // namespace media | 351 } // namespace media |
| OLD | NEW |