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

Side by Side Diff: media/audio/openbsd/audio_manager_openbsd.cc

Issue 3185022: Share one thread between all AudioOutputControllers instead of creating one per stream. (Closed)
Patch Set: - Created 10 years, 4 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/openbsd/audio_manager_openbsd.h ('k') | media/audio/simple_sources_unittest.cc » ('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) 2010 The Chromium Authors. All rights reserved. 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 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/openbsd/audio_manager_openbsd.h" 5 #include "media/audio/openbsd/audio_manager_openbsd.h"
6 6
7 #include "base/at_exit.h"
8 #include "base/logging.h" 7 #include "base/logging.h"
9 8
10 namespace { 9 namespace {
11 AudioManagerOpenBSD* g_audio_manager = NULL; 10 AudioManagerOpenBSD* g_audio_manager = NULL;
12 } // namespace 11 } // namespace
13 12
14 // Implementation of AudioManager. 13 // Implementation of AudioManager.
15 bool AudioManagerOpenBSD::HasAudioOutputDevices() { 14 bool AudioManagerOpenBSD::HasAudioOutputDevices() {
16 NOTIMPLEMENTED(); 15 NOTIMPLEMENTED();
17 return false; 16 return false;
(...skipping 23 matching lines...) Expand all
41 return NULL; 40 return NULL;
42 } 41 }
43 42
44 AudioManagerOpenBSD::AudioManagerOpenBSD() { 43 AudioManagerOpenBSD::AudioManagerOpenBSD() {
45 } 44 }
46 45
47 AudioManagerOpenBSD::~AudioManagerOpenBSD() { 46 AudioManagerOpenBSD::~AudioManagerOpenBSD() {
48 } 47 }
49 48
50 void AudioManagerOpenBSD::Init() { 49 void AudioManagerOpenBSD::Init() {
50 AudioManagerBase::Init();
51 } 51 }
52 52
53 void AudioManagerOpenBSD::MuteAll() { 53 void AudioManagerOpenBSD::MuteAll() {
54 NOTIMPLEMENTED(); 54 NOTIMPLEMENTED();
55 } 55 }
56 56
57 void AudioManagerOpenBSD::UnMuteAll() { 57 void AudioManagerOpenBSD::UnMuteAll() {
58 NOTIMPLEMENTED(); 58 NOTIMPLEMENTED();
59 } 59 }
60 60
61 void DestroyAudioManagerOpenBSD(void* not_used) { 61 void DestroyAudioManagerOpenBSD(void* not_used) {
62 delete g_audio_manager; 62 delete g_audio_manager;
63 g_audio_manager = NULL; 63 g_audio_manager = NULL;
64 } 64 }
65 65
66 AudioManager* AudioManager::GetAudioManager() { 66 AudioManager* AudioManager::GetAudioManager() {
67 if (!g_audio_manager) { 67 if (!g_audio_manager) {
68 g_audio_manager = new AudioManagerOpenBSD(); 68 g_audio_manager = new AudioManagerOpenBSD();
69 g_audio_manager->Init(); 69 g_audio_manager->Init();
70 base::AtExitManager::RegisterCallback(&DestroyAudioManagerOpenBSD, NULL); 70 base::AtExitManager::RegisterCallback(&DestroyAudioManagerOpenBSD, NULL);
71 } 71 }
72 return g_audio_manager; 72 return g_audio_manager;
73 } 73 }
74
75 // static
76 AudioManager* AudioManager::CreateAudioManager() {
77 return new AudioManagerOpenBSD();
78 }
OLDNEW
« no previous file with comments | « media/audio/openbsd/audio_manager_openbsd.h ('k') | media/audio/simple_sources_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698