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 10 matching lines...) Expand all Loading... |
21 #include "media/audio/fake_audio_input_stream.h" | 21 #include "media/audio/fake_audio_input_stream.h" |
22 #include "media/base/channel_layout.h" | 22 #include "media/base/channel_layout.h" |
23 | 23 |
24 using base::android::AppendJavaStringArrayToStringVector; | 24 using base::android::AppendJavaStringArrayToStringVector; |
25 using base::android::AttachCurrentThread; | 25 using base::android::AttachCurrentThread; |
26 using base::android::ConvertJavaStringToUTF8; | 26 using base::android::ConvertJavaStringToUTF8; |
27 using base::android::ConvertUTF8ToJavaString; | 27 using base::android::ConvertUTF8ToJavaString; |
28 using base::android::ScopedJavaLocalRef; | 28 using base::android::ScopedJavaLocalRef; |
29 | 29 |
30 namespace media { | 30 namespace media { |
| 31 namespace { |
31 | 32 |
32 static void AddDefaultDevice(AudioDeviceNames* device_names) { | 33 void AddDefaultDevice(AudioDeviceNames* device_names) { |
33 DCHECK(device_names->empty()); | 34 DCHECK(device_names->empty()); |
34 device_names->push_front( | 35 device_names->push_front(AudioDeviceName(AudioManager::GetDefaultDeviceName(), |
35 AudioDeviceName(AudioManagerBase::kDefaultDeviceName, | 36 AudioManagerBase::kDefaultDeviceId)); |
36 AudioManagerBase::kDefaultDeviceId)); | |
37 } | 37 } |
38 | 38 |
39 // Maximum number of output streams that can be open simultaneously. | 39 // Maximum number of output streams that can be open simultaneously. |
40 static const int kMaxOutputStreams = 10; | 40 const int kMaxOutputStreams = 10; |
41 | 41 |
42 static const int kDefaultInputBufferSize = 1024; | 42 const int kDefaultInputBufferSize = 1024; |
43 static const int kDefaultOutputBufferSize = 2048; | 43 const int kDefaultOutputBufferSize = 2048; |
| 44 |
| 45 } // namespace |
44 | 46 |
45 AudioManager* CreateAudioManager(AudioLogFactory* audio_log_factory) { | 47 AudioManager* CreateAudioManager(AudioLogFactory* audio_log_factory) { |
46 return new AudioManagerAndroid(audio_log_factory); | 48 return new AudioManagerAndroid(audio_log_factory); |
47 } | 49 } |
48 | 50 |
49 AudioManagerAndroid::AudioManagerAndroid(AudioLogFactory* audio_log_factory) | 51 AudioManagerAndroid::AudioManagerAndroid(AudioLogFactory* audio_log_factory) |
50 : AudioManagerBase(audio_log_factory), | 52 : AudioManagerBase(audio_log_factory), |
51 communication_mode_is_on_(false), | 53 communication_mode_is_on_(false), |
52 output_volume_override_set_(false), | 54 output_volume_override_set_(false), |
53 output_volume_override_(0) { | 55 output_volume_override_(0) { |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 output_volume_override_ = volume; | 406 output_volume_override_ = volume; |
405 | 407 |
406 DCHECK(GetTaskRunner()->BelongsToCurrentThread()); | 408 DCHECK(GetTaskRunner()->BelongsToCurrentThread()); |
407 for (OutputStreams::iterator it = streams_.begin(); | 409 for (OutputStreams::iterator it = streams_.begin(); |
408 it != streams_.end(); ++it) { | 410 it != streams_.end(); ++it) { |
409 (*it)->SetVolume(volume); | 411 (*it)->SetVolume(volume); |
410 } | 412 } |
411 } | 413 } |
412 | 414 |
413 } // namespace media | 415 } // namespace media |
OLD | NEW |