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

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

Issue 11175066: Replace AudioManager::Init() with InitializeOnAudioThread(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. Created 8 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 | Annotate | Revision Log
« no previous file with comments | « media/audio/linux/audio_manager_linux.h ('k') | media/audio/mock_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/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"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 return HasAnyAlsaAudioDevice(kStreamPlayback); 52 return HasAnyAlsaAudioDevice(kStreamPlayback);
53 } 53 }
54 54
55 bool AudioManagerLinux::HasAudioInputDevices() { 55 bool AudioManagerLinux::HasAudioInputDevices() {
56 if (UseCras()) 56 if (UseCras())
57 return true; 57 return true;
58 58
59 return HasAnyAlsaAudioDevice(kStreamCapture); 59 return HasAnyAlsaAudioDevice(kStreamCapture);
60 } 60 }
61 61
62 AudioManagerLinux::AudioManagerLinux() { 62 AudioManagerLinux::AudioManagerLinux()
63 : wrapper_(new AlsaWrapper()) {
63 SetMaxOutputStreamsAllowed(kMaxOutputStreams); 64 SetMaxOutputStreamsAllowed(kMaxOutputStreams);
64 } 65 }
65 66
66 AudioManagerLinux::~AudioManagerLinux() { 67 AudioManagerLinux::~AudioManagerLinux() {
67 Shutdown(); 68 Shutdown();
68 } 69 }
69 70
70 void AudioManagerLinux::Init() {
71 AudioManagerBase::Init();
72 wrapper_.reset(new AlsaWrapper());
73 }
74
75 bool AudioManagerLinux::CanShowAudioInputSettings() { 71 bool AudioManagerLinux::CanShowAudioInputSettings() {
76 scoped_ptr<base::Environment> env(base::Environment::Create()); 72 scoped_ptr<base::Environment> env(base::Environment::Create());
77 73
78 switch (base::nix::GetDesktopEnvironment(env.get())) { 74 switch (base::nix::GetDesktopEnvironment(env.get())) {
79 case base::nix::DESKTOP_ENVIRONMENT_GNOME: 75 case base::nix::DESKTOP_ENVIRONMENT_GNOME:
80 case base::nix::DESKTOP_ENVIRONMENT_KDE3: 76 case base::nix::DESKTOP_ENVIRONMENT_KDE3:
81 case base::nix::DESKTOP_ENVIRONMENT_KDE4: 77 case base::nix::DESKTOP_ENVIRONMENT_KDE4:
82 return true; 78 return true;
83 case base::nix::DESKTOP_ENVIRONMENT_OTHER: 79 case base::nix::DESKTOP_ENVIRONMENT_OTHER:
84 case base::nix::DESKTOP_ENVIRONMENT_UNITY: 80 case base::nix::DESKTOP_ENVIRONMENT_UNITY:
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 sample_rate = input_params.sample_rate(); 356 sample_rate = input_params.sample_rate();
361 357
362 // TODO(dalecurtis): This should include bits per channel and channel layout 358 // TODO(dalecurtis): This should include bits per channel and channel layout
363 // eventually. 359 // eventually.
364 return AudioParameters( 360 return AudioParameters(
365 AudioParameters::AUDIO_PCM_LOW_LATENCY, input_params.channel_layout(), 361 AudioParameters::AUDIO_PCM_LOW_LATENCY, input_params.channel_layout(),
366 sample_rate, 16, buffer_size); 362 sample_rate, 16, buffer_size);
367 } 363 }
368 364
369 } // namespace media 365 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/linux/audio_manager_linux.h ('k') | media/audio/mock_audio_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698