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

Unified Diff: media/audio/audio_io.h

Issue 10832285: Switch OnMoreData() to use AudioBus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Comments. Created 8 years, 3 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/audio_input_device.cc ('k') | media/audio/audio_low_latency_input_output_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_io.h
diff --git a/media/audio/audio_io.h b/media/audio/audio_io.h
index 50be7cd8025c58ae28fc63d97141b7b777d61022..c1d7fbb621653db2723a36a87618a951d3b7d20a 100644
--- a/media/audio/audio_io.h
+++ b/media/audio/audio_io.h
@@ -7,6 +7,7 @@
#include "base/basictypes.h"
#include "media/audio/audio_buffers_state.h"
+#include "media/base/audio_bus.h"
// Low-level audio output support. To make sound there are 3 objects involved:
// - AudioSource : produces audio samples on a pull model. Implements
@@ -41,7 +42,7 @@
// Because we support more audio streams than physically available channels
// a given AudioOutputStream might or might not talk directly to hardware.
// An audio stream allocates several buffers for audio data and calls
-// AudioSourceCallback::OnModeData() periodically to fill these buffers,
+// AudioSourceCallback::OnMoreData() periodically to fill these buffers,
// as the data is written to the audio device. Size of each packet is determined
// by |samples_per_packet| specified in AudioParameters when the stream is
// created.
@@ -56,16 +57,11 @@ class MEDIA_EXPORT AudioOutputStream {
// itself such as creating Windows or initializing COM.
class MEDIA_EXPORT AudioSourceCallback {
public:
- // Provide more data by filling |dest| up to |max_size| bytes. The provided
- // buffer size is determined by the |samples_per_packet| specified in
- // AudioParameters when the stream is created. The source will return
- // the number of bytes it filled. The expected structure of |dest| is
- // platform and format specific.
- // |buffers_state| contains current state of the buffers, and can be used
- // by the source to calculate delay.
- virtual uint32 OnMoreData(uint8* dest,
- uint32 max_size,
- AudioBuffersState buffers_state) = 0;
+ // Provide more data by fully filling |audio_bus|. The source will return
+ // the number of frames it filled. |buffers_state| contains current state
+ // of the buffers, and can be used by the source to calculate delay.
+ virtual int OnMoreData(AudioBus* audio_bus,
+ AudioBuffersState buffers_state) = 0;
// There was an error while playing a buffer. Audio source cannot be
// destroyed yet. No direct action needed by the AudioStream, but it is
« no previous file with comments | « media/audio/audio_input_device.cc ('k') | media/audio/audio_low_latency_input_output_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698