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

Side by Side Diff: media/audio/mac/audio_manager_mac.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, 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 | Annotate | Revision Log
« no previous file with comments | « media/audio/mac/audio_manager_mac.h ('k') | 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) 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 <CoreAudio/AudioHardware.h> 5 #include <CoreAudio/AudioHardware.h>
6 6
7 #include "base/at_exit.h"
7 #include "media/audio/fake_audio_input_stream.h" 8 #include "media/audio/fake_audio_input_stream.h"
8 #include "media/audio/fake_audio_output_stream.h" 9 #include "media/audio/fake_audio_output_stream.h"
9 #include "media/audio/mac/audio_manager_mac.h" 10 #include "media/audio/mac/audio_manager_mac.h"
10 #include "media/audio/mac/audio_output_mac.h" 11 #include "media/audio/mac/audio_output_mac.h"
11 12
12 bool AudioManagerMac::HasAudioOutputDevices() { 13 bool AudioManagerMac::HasAudioOutputDevices() {
13 AudioDeviceID output_device_id = kAudioObjectUnknown; 14 AudioDeviceID output_device_id = kAudioObjectUnknown;
14 AudioObjectPropertyAddress property_address = { 15 AudioObjectPropertyAddress property_address = {
15 kAudioHardwarePropertyDefaultOutputDevice, // mSelector 16 kAudioHardwarePropertyDefaultOutputDevice, // mSelector
16 kAudioObjectPropertyScopeGlobal, // mScope 17 kAudioObjectPropertyScopeGlobal, // mScope
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 void AudioManagerMac::UnMuteAll() { 68 void AudioManagerMac::UnMuteAll() {
68 // TODO(cpu): implement. 69 // TODO(cpu): implement.
69 } 70 }
70 71
71 // Called by the stream when it has been released by calling Close(). 72 // Called by the stream when it has been released by calling Close().
72 void AudioManagerMac::ReleaseOutputStream( 73 void AudioManagerMac::ReleaseOutputStream(
73 PCMQueueOutAudioOutputStream* stream) { 74 PCMQueueOutAudioOutputStream* stream) {
74 delete stream; 75 delete stream;
75 } 76 }
76 77
77 // static 78 namespace {
78 AudioManager* AudioManager::CreateAudioManager() { 79
79 return new AudioManagerMac(); 80 AudioManagerMac* g_audio_manager = NULL;
81
82 } // namespace.
83
84 void DestroyAudioManagerMac(void* param) {
85 delete g_audio_manager;
86 g_audio_manager = NULL;
80 } 87 }
88
89 // By convention, the AudioManager is not thread safe.
90 AudioManager* AudioManager::GetAudioManager() {
91 if (!g_audio_manager) {
92 g_audio_manager = new AudioManagerMac();
93 base::AtExitManager::RegisterCallback(&DestroyAudioManagerMac, NULL);
94 }
95 return g_audio_manager;
96 }
OLDNEW
« no previous file with comments | « media/audio/mac/audio_manager_mac.h ('k') | media/audio/openbsd/audio_manager_openbsd.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698