| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 AudioManagerAndroid::~AudioManagerAndroid() = default; | 66 AudioManagerAndroid::~AudioManagerAndroid() = default; |
| 67 | 67 |
| 68 void AudioManagerAndroid::InitializeIfNeeded() { | 68 void AudioManagerAndroid::InitializeIfNeeded() { |
| 69 GetTaskRunner()->PostTask( | 69 GetTaskRunner()->PostTask( |
| 70 FROM_HERE, | 70 FROM_HERE, |
| 71 base::Bind(base::IgnoreResult(&AudioManagerAndroid::GetJavaAudioManager), | 71 base::Bind(base::IgnoreResult(&AudioManagerAndroid::GetJavaAudioManager), |
| 72 base::Unretained(this))); | 72 base::Unretained(this))); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void AudioManagerAndroid::ShutdownOnAudioThread() { | 75 void AudioManagerAndroid::ShutdownOnAudioThread(bool immediately) { |
| 76 AudioManagerBase::ShutdownOnAudioThread(); | 76 AudioManagerBase::ShutdownOnAudioThread(immediately); |
| 77 | 77 |
| 78 // Destory java android manager here because it can only be accessed on the | 78 // Destory java android manager here because it can only be accessed on the |
| 79 // audio thread. | 79 // audio thread. |
| 80 if (!j_audio_manager_.is_null()) { | 80 if (!j_audio_manager_.is_null()) { |
| 81 DVLOG(2) << "Destroying Java part of the audio manager"; | 81 DVLOG(2) << "Destroying Java part of the audio manager"; |
| 82 Java_AudioManagerAndroid_close(base::android::AttachCurrentThread(), | 82 Java_AudioManagerAndroid_close(base::android::AttachCurrentThread(), |
| 83 j_audio_manager_); | 83 j_audio_manager_); |
| 84 j_audio_manager_.Reset(); | 84 j_audio_manager_.Reset(); |
| 85 } | 85 } |
| 86 } | 86 } |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 output_volume_override_ = volume; | 430 output_volume_override_ = volume; |
| 431 | 431 |
| 432 DCHECK(GetTaskRunner()->BelongsToCurrentThread()); | 432 DCHECK(GetTaskRunner()->BelongsToCurrentThread()); |
| 433 for (OutputStreams::iterator it = streams_.begin(); | 433 for (OutputStreams::iterator it = streams_.begin(); |
| 434 it != streams_.end(); ++it) { | 434 it != streams_.end(); ++it) { |
| 435 (*it)->SetVolume(volume); | 435 (*it)->SetVolume(volume); |
| 436 } | 436 } |
| 437 } | 437 } |
| 438 | 438 |
| 439 } // namespace media | 439 } // namespace media |
| OLD | NEW |