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

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

Issue 1230023009: Increase OSX post-resume delay for new audio streams. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove dep. Created 5 years, 5 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 | « no previous file | no next file » | 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 <list> 10 #include <list>
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 static int HardwareSampleRate(); 69 static int HardwareSampleRate();
70 70
71 // OSX has issues with starting streams as the sytem goes into suspend and 71 // OSX has issues with starting streams as the sytem goes into suspend and
72 // immediately after it wakes up from resume. See http://crbug.com/160920. 72 // immediately after it wakes up from resume. See http://crbug.com/160920.
73 // As a workaround we delay Start() when it occurs after suspend and for a 73 // As a workaround we delay Start() when it occurs after suspend and for a
74 // small amount of time after resume. 74 // small amount of time after resume.
75 // 75 //
76 // Streams should consult ShouldDeferStreamStart() and if true check the value 76 // Streams should consult ShouldDeferStreamStart() and if true check the value
77 // again after |kStartDelayInSecsForPowerEvents| has elapsed. If false, the 77 // again after |kStartDelayInSecsForPowerEvents| has elapsed. If false, the
78 // stream may be started immediately. 78 // stream may be started immediately.
79 enum { kStartDelayInSecsForPowerEvents = 1 }; 79 enum { kStartDelayInSecsForPowerEvents = 2 };
80 bool ShouldDeferStreamStart(); 80 bool ShouldDeferStreamStart();
81 81
82 // Changes the buffer size for |device_id| if there are no active input or 82 // Changes the buffer size for |device_id| if there are no active input or
83 // output streams on the device or |desired_buffer_size| is lower than the 83 // output streams on the device or |desired_buffer_size| is lower than the
84 // current device buffer size. 84 // current device buffer size.
85 // 85 //
86 // Returns false if an error occurred. There is no indication if the buffer 86 // Returns false if an error occurred. There is no indication if the buffer
87 // size was changed or not. 87 // size was changed or not.
88 // |element| is 0 for output streams and 1 for input streams. 88 // |element| is 0 for output streams and 1 for input streams.
89 // TODO(dalecurtis): we could change the the last parameter to an input/output 89 // TODO(dalecurtis): we could change the the last parameter to an input/output
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 std::list<AudioInputStream*> basic_input_streams_; 129 std::list<AudioInputStream*> basic_input_streams_;
130 std::list<AUAudioInputStream*> low_latency_input_streams_; 130 std::list<AUAudioInputStream*> low_latency_input_streams_;
131 std::list<AUHALStream*> output_streams_; 131 std::list<AUHALStream*> output_streams_;
132 132
133 DISALLOW_COPY_AND_ASSIGN(AudioManagerMac); 133 DISALLOW_COPY_AND_ASSIGN(AudioManagerMac);
134 }; 134 };
135 135
136 } // namespace media 136 } // namespace media
137 137
138 #endif // MEDIA_AUDIO_MAC_AUDIO_MANAGER_MAC_H_ 138 #endif // MEDIA_AUDIO_MAC_AUDIO_MANAGER_MAC_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698