Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Side by Side Diff: media/audio/android/audio_manager_android.cc

Issue 1362093002: Re-land: Add localized default audio device names. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Exclude media_resource_provider on iOS. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/audio/android/audio_android_unittest.cc ('k') | media/audio/audio_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/audio/android/audio_android_unittest.cc ('k') | media/audio/audio_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698