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

Side by Side Diff: media/audio/audio_manager.cc

Issue 3192017: Revert 57254 - Share one thread between all AudioOutputControllers instead of... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 3 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/audio_manager.h ('k') | media/audio/audio_manager_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "media/audio/audio_manager.h"
6
7 #include "base/at_exit.h"
8 #include "base/logging.h"
9
10 namespace {
11
12 AudioManager* g_audio_manager = NULL;
13
14 // NullAudioManager is the audio manager used on the systems that have no
15 // audio support.
16 class NullAudioManager : public AudioManager {
17 public:
18 NullAudioManager() { }
19
20 // Implementation of AudioManager.
21 virtual bool HasAudioOutputDevices() { return false; }
22 virtual bool HasAudioInputDevices() { return false; }
23 virtual AudioOutputStream* MakeAudioOutputStream(Format format, int channels,
24 int sample_rate,
25 char bits_per_sample) {
26 NOTIMPLEMENTED();
27 return NULL;
28 }
29 virtual AudioInputStream* MakeAudioInputStream(Format format, int channels,
30 int sample_rate,
31 char bits_per_sample,
32 uint32 samples_per_packet) {
33 NOTIMPLEMENTED();
34 return NULL;
35 }
36 virtual void MuteAll() { NOTIMPLEMENTED(); }
37 virtual void UnMuteAll() { NOTIMPLEMENTED(); }
38
39 private:
40 DISALLOW_COPY_AND_ASSIGN(NullAudioManager);
41 };
42
43 } // namespace
44
45 // static
46 void AudioManager::Destroy(void* not_used) {
47 delete g_audio_manager;
48 g_audio_manager = NULL;
49 }
50
51 // static
52 AudioManager* AudioManager::GetAudioManager() {
53 if (!g_audio_manager) {
54 g_audio_manager = CreateAudioManager();
55 g_audio_manager->Init();
56 base::AtExitManager::RegisterCallback(&AudioManager::Destroy, NULL);
57 }
58 return g_audio_manager;
59 }
OLDNEW
« no previous file with comments | « media/audio/audio_manager.h ('k') | media/audio/audio_manager_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698