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

Side by Side Diff: media/audio/mac/audio_manager_mac.h

Issue 2771093002: Use AudioUnit instead of AudioDevice properties to get channel count. (Closed)
Patch Set: Revert deletion of GetDeviceTotalChannelCount. Created 3 years, 9 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/mac/audio_auhal_mac.cc ('k') | media/audio/mac/audio_manager_mac.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) 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 #ifndef MEDIA_AUDIO_MAC_AUDIO_MANAGER_MAC_H_ 5 #ifndef MEDIA_AUDIO_MAC_AUDIO_MANAGER_MAC_H_
6 #define MEDIA_AUDIO_MAC_AUDIO_MANAGER_MAC_H_ 6 #define MEDIA_AUDIO_MAC_AUDIO_MANAGER_MAC_H_
7 7
8 #include <AudioUnit/AudioUnit.h> 8 #include <AudioUnit/AudioUnit.h>
9 #include <CoreAudio/AudioHardware.h> 9 #include <CoreAudio/AudioHardware.h>
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 void ReleaseOutputStream(AudioOutputStream* stream) override; 67 void ReleaseOutputStream(AudioOutputStream* stream) override;
68 void ReleaseInputStream(AudioInputStream* stream) override; 68 void ReleaseInputStream(AudioInputStream* stream) override;
69 69
70 // Called by AUHALStream::Close() before releasing the stream. 70 // Called by AUHALStream::Close() before releasing the stream.
71 // This method is a special contract between the real stream and the audio 71 // This method is a special contract between the real stream and the audio
72 // manager and it ensures that we only try to increase the IO buffer size 72 // manager and it ensures that we only try to increase the IO buffer size
73 // for real streams and not for fake or mocked streams. 73 // for real streams and not for fake or mocked streams.
74 void ReleaseOutputStreamUsingRealDevice(AudioOutputStream* stream, 74 void ReleaseOutputStreamUsingRealDevice(AudioOutputStream* stream,
75 AudioDeviceID device_id); 75 AudioDeviceID device_id);
76 76
77 static bool GetDeviceChannels(AudioDeviceID device,
78 AudioObjectPropertyScope scope,
79 int* channels);
80
81 static int HardwareSampleRateForDevice(AudioDeviceID device_id); 77 static int HardwareSampleRateForDevice(AudioDeviceID device_id);
82 static int HardwareSampleRate(); 78 static int HardwareSampleRate();
83 79
84 // OSX has issues with starting streams as the system goes into suspend and 80 // OSX has issues with starting streams as the system goes into suspend and
85 // immediately after it wakes up from resume. See http://crbug.com/160920. 81 // immediately after it wakes up from resume. See http://crbug.com/160920.
86 // As a workaround we delay Start() when it occurs after suspend and for a 82 // As a workaround we delay Start() when it occurs after suspend and for a
87 // small amount of time after resume. 83 // small amount of time after resume.
88 // 84 //
89 // Streams should consult ShouldDeferStreamStart() and if true check the value 85 // Streams should consult ShouldDeferStreamStart() and if true check the value
90 // again after |kStartDelayInSecsForPowerEvents| has elapsed. If false, the 86 // again after |kStartDelayInSecsForPowerEvents| has elapsed. If false, the
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 // Set to true in the destructor. Ensures that methods that touches native 182 // Set to true in the destructor. Ensures that methods that touches native
187 // Core Audio APIs are not executed during shutdown. 183 // Core Audio APIs are not executed during shutdown.
188 bool in_shutdown_; 184 bool in_shutdown_;
189 185
190 DISALLOW_COPY_AND_ASSIGN(AudioManagerMac); 186 DISALLOW_COPY_AND_ASSIGN(AudioManagerMac);
191 }; 187 };
192 188
193 } // namespace media 189 } // namespace media
194 190
195 #endif // MEDIA_AUDIO_MAC_AUDIO_MANAGER_MAC_H_ 191 #endif // MEDIA_AUDIO_MAC_AUDIO_MANAGER_MAC_H_
OLDNEW
« no previous file with comments | « media/audio/mac/audio_auhal_mac.cc ('k') | media/audio/mac/audio_manager_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698