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

Unified Diff: media/audio/mac/audio_manager_mac.h

Issue 135853022: Defer OSX output stream Start() around system supend and resume. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Wait for initialization. Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/mac/audio_auhal_mac_unittest.cc ('k') | media/audio/mac/audio_manager_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/mac/audio_manager_mac.h
diff --git a/media/audio/mac/audio_manager_mac.h b/media/audio/mac/audio_manager_mac.h
index 898c7e9d2edf380786cde31cd00a183f34adc197..641f9d313f29cbde0d172d3283479c0c6cbe0bbc 100644
--- a/media/audio/mac/audio_manager_mac.h
+++ b/media/audio/mac/audio_manager_mac.h
@@ -61,6 +61,17 @@ class MEDIA_EXPORT AudioManagerMac : public AudioManagerBase {
static int HardwareSampleRateForDevice(AudioDeviceID device_id);
static int HardwareSampleRate();
+ // OSX has issues with starting streams as the sytem goes into suspend and
+ // immediately after it wakes up from resume. See http://crbug.com/160920.
+ // As a workaround we delay Start() when it occurs after suspend and for a
+ // small amount of time after resume.
+ //
+ // Output streams should consult ShouldDeferOutputStreamStart() and if true
+ // check the value again after |kStartDelayInSecsForPowerEvents| has elapsed.
+ // If false, the stream may be started immediately.
+ enum { kStartDelayInSecsForPowerEvents = 1 };
+ bool ShouldDeferOutputStreamStart();
+
protected:
virtual ~AudioManagerMac();
@@ -90,6 +101,12 @@ class MEDIA_EXPORT AudioManagerMac : public AudioManagerBase {
AggregateDeviceManager aggregate_device_manager_;
+ // Helper class which monitors power events to determine if output streams
+ // should defer Start() calls. Required to workaround an OSX bug. See
+ // http://crbug.com/160920 for more details.
+ class AudioPowerObserver;
+ scoped_ptr<AudioPowerObserver> power_observer_;
+
DISALLOW_COPY_AND_ASSIGN(AudioManagerMac);
};
« no previous file with comments | « media/audio/mac/audio_auhal_mac_unittest.cc ('k') | media/audio/mac/audio_manager_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698