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

Side by Side Diff: media/audio/linux/audio_manager_linux.cc

Issue 12310101: Enable pulse as the default IO handling in Chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | media/audio/openbsd/audio_manager_openbsd.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/linux/audio_manager_linux.h" 5 #include "media/audio/linux/audio_manager_linux.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/environment.h" 8 #include "base/environment.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/nix/xdg_util.h" 10 #include "base/nix/xdg_util.h"
11 #include "base/process_util.h" 11 #include "base/process_util.h"
12 #include "base/stl_util.h" 12 #include "base/stl_util.h"
13 #include "media/audio/audio_output_dispatcher.h" 13 #include "media/audio/audio_output_dispatcher.h"
14 #include "media/audio/audio_parameters.h" 14 #include "media/audio/audio_parameters.h"
15 #include "media/audio/audio_util.h" 15 #include "media/audio/audio_util.h"
16 #if defined(USE_CRAS) 16 #if defined(USE_CRAS)
17 #include "media/audio/cras/audio_manager_cras.h" 17 #include "media/audio/cras/audio_manager_cras.h"
18 #endif 18 #endif
19 #include "media/audio/linux/alsa_input.h" 19 #include "media/audio/linux/alsa_input.h"
20 #include "media/audio/linux/alsa_output.h" 20 #include "media/audio/linux/alsa_output.h"
21 #include "media/audio/linux/alsa_wrapper.h" 21 #include "media/audio/linux/alsa_wrapper.h"
22 #if defined(USE_PULSEAUDIO)
23 #include "media/audio/pulse/audio_manager_pulse.h" 22 #include "media/audio/pulse/audio_manager_pulse.h"
24 #endif
25 #include "media/base/channel_layout.h" 23 #include "media/base/channel_layout.h"
26 #include "media/base/limits.h" 24 #include "media/base/limits.h"
27 #include "media/base/media_switches.h" 25 #include "media/base/media_switches.h"
28 26
29 namespace media { 27 namespace media {
30 28
31 // Maximum number of output streams that can be open simultaneously. 29 // Maximum number of output streams that can be open simultaneously.
32 static const int kMaxOutputStreams = 50; 30 static const int kMaxOutputStreams = 50;
33 31
34 // Default sample rate for input and output streams. 32 // Default sample rate for input and output streams.
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 return new AlsaPcmInputStream(this, device_name, params, wrapper_.get()); 316 return new AlsaPcmInputStream(this, device_name, params, wrapper_.get());
319 } 317 }
320 318
321 AudioManager* CreateAudioManager() { 319 AudioManager* CreateAudioManager() {
322 #if defined(USE_CRAS) 320 #if defined(USE_CRAS)
323 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseCras)) { 321 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseCras)) {
324 return new AudioManagerCras(); 322 return new AudioManagerCras();
325 } 323 }
326 #endif 324 #endif
327 325
328 #if defined(USE_PULSEAUDIO) 326 AudioManager* manager = AudioManagerPulse::Create();
DaleCurtis 2013/03/11 22:06:46 fischman had a great suggestion: You should add a
no longer working on chromium 2013/03/12 16:08:29 Done.
329 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUsePulseAudio)) { 327 if (manager)
330 AudioManager* manager = AudioManagerPulse::Create(); 328 return manager;
331 if (manager)
332 return manager;
333 }
334 #endif
335 329
336 return new AudioManagerLinux(); 330 return new AudioManagerLinux();
337 } 331 }
338 332
339 } // namespace media 333 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/audio/openbsd/audio_manager_openbsd.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698