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

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

Issue 357004: SetVolume and GetVolume take one volume instead of separate left and right vo... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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/alsa_output.cc ('k') | media/audio/mac/audio_output_mac.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) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "media/audio/fake_audio_output_stream.h" 10 #include "media/audio/fake_audio_output_stream.h"
11 #include "media/audio/linux/alsa_output.h" 11 #include "media/audio/linux/alsa_output.h"
12 #include "media/audio/linux/alsa_wrapper.h" 12 #include "media/audio/linux/alsa_wrapper.h"
13 #include "media/base/media_switches.h" 13 #include "media/base/media_switches.h"
14 14
15 15
16 namespace { 16 namespace {
17
17 AudioManagerLinux* g_audio_manager = NULL; 18 AudioManagerLinux* g_audio_manager = NULL;
18 } // namespace 19 } // namespace
19 20
20 // Implementation of AudioManager. 21 // Implementation of AudioManager.
21 bool AudioManagerLinux::HasAudioDevices() { 22 bool AudioManagerLinux::HasAudioDevices() {
22 // TODO(ajwong): Make this actually query audio devices. 23 // TODO(ajwong): Make this actually query audio devices.
23 return true; 24 return true;
24 } 25 }
25 26
26 AudioOutputStream* AudioManagerLinux::MakeAudioStream(Format format, 27 AudioOutputStream* AudioManagerLinux::MakeAudioStream(Format format,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 69
69 void AudioManagerLinux::MuteAll() { 70 void AudioManagerLinux::MuteAll() {
70 NOTIMPLEMENTED(); 71 NOTIMPLEMENTED();
71 } 72 }
72 73
73 void AudioManagerLinux::UnMuteAll() { 74 void AudioManagerLinux::UnMuteAll() {
74 NOTIMPLEMENTED(); 75 NOTIMPLEMENTED();
75 } 76 }
76 77
77 void AudioManagerLinux::ReleaseStream(AlsaPcmOutputStream* stream) { 78 void AudioManagerLinux::ReleaseStream(AlsaPcmOutputStream* stream) {
78 AutoLock l(lock_); 79 if (stream) {
79 active_streams_.erase(stream); 80 AutoLock l(lock_);
81 active_streams_.erase(stream);
82 }
80 } 83 }
81 84
82 // TODO(ajwong): Collapse this with the windows version. 85 // TODO(ajwong): Collapse this with the windows version.
83 void DestroyAudioManagerLinux(void* not_used) { 86 void DestroyAudioManagerLinux(void* not_used) {
84 delete g_audio_manager; 87 delete g_audio_manager;
85 g_audio_manager = NULL; 88 g_audio_manager = NULL;
86 } 89 }
87 90
88 AudioManager* AudioManager::GetAudioManager() { 91 AudioManager* AudioManager::GetAudioManager() {
89 if (!g_audio_manager) { 92 if (!g_audio_manager) {
90 g_audio_manager = new AudioManagerLinux(); 93 g_audio_manager = new AudioManagerLinux();
91 g_audio_manager->Init(); 94 g_audio_manager->Init();
92 base::AtExitManager::RegisterCallback(&DestroyAudioManagerLinux, NULL); 95 base::AtExitManager::RegisterCallback(&DestroyAudioManagerLinux, NULL);
93 } 96 }
94 return g_audio_manager; 97 return g_audio_manager;
95 } 98 }
OLDNEW
« no previous file with comments | « media/audio/linux/alsa_output.cc ('k') | media/audio/mac/audio_output_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698