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

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

Issue 233823003: Defer input stream start around suspend and resume. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests. Created 6 years, 8 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.cc ('k') | media/audio/mac/audio_input_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/mac/audio_input_mac.h
diff --git a/media/audio/mac/audio_input_mac.h b/media/audio/mac/audio_input_mac.h
index 77eb65b03159626ac54b852ea4ba61fe00bf0bdc..e8f77c706aeaf413cce9a9a535b341b36d65ce38 100644
--- a/media/audio/mac/audio_input_mac.h
+++ b/media/audio/mac/audio_input_mac.h
@@ -8,6 +8,7 @@
#include <AudioToolbox/AudioFormat.h>
#include <AudioToolbox/AudioQueue.h>
+#include "base/cancelable_callback.h"
#include "base/compiler_specific.h"
#include "base/time/time.h"
#include "media/audio/audio_io.h"
@@ -15,14 +16,14 @@
namespace media {
-class AudioManagerBase;
+class AudioManagerMac;
// Implementation of AudioInputStream for Mac OS X using the audio queue service
// present in OS 10.5 and later. Design reflects PCMQueueOutAudioOutputStream.
class PCMQueueInAudioInputStream : public AudioInputStream {
public:
// Parameters as per AudioManager::MakeAudioInputStream.
- PCMQueueInAudioInputStream(AudioManagerBase* manager,
+ PCMQueueInAudioInputStream(AudioManagerMac* manager,
const AudioParameters& params);
virtual ~PCMQueueInAudioInputStream();
@@ -66,7 +67,7 @@ class PCMQueueInAudioInputStream : public AudioInputStream {
static const int kNumberBuffers = 3;
// Manager that owns this stream, used for closing down.
- AudioManagerBase* manager_;
+ AudioManagerMac* manager_;
// We use the callback mostly to periodically supply the recorded audio data.
AudioInputCallback* callback_;
// Structure that holds the stream format details such as bitrate.
@@ -79,6 +80,8 @@ class PCMQueueInAudioInputStream : public AudioInputStream {
bool started_;
// Used to determine if we need to slow down |callback_| calls.
base::TimeTicks last_fill_;
+ // Used to defer Start() to workaround http://crbug.com/160920.
+ base::CancelableClosure deferred_start_cb_;
DISALLOW_COPY_AND_ASSIGN(PCMQueueInAudioInputStream);
};
« no previous file with comments | « media/audio/mac/audio_auhal_mac.cc ('k') | media/audio/mac/audio_input_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698