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

Unified Diff: media/audio/audio_output_controller.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_low_latency_input_output_unittest.cc ('k') | media/audio/audio_output_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_output_controller.h
diff --git a/media/audio/audio_output_controller.h b/media/audio/audio_output_controller.h
index 03b095935bd4d521e241b0cef2305f99505252ce..3741c09c3920389e3c8d10a0f20d5879d61197bb 100644
--- a/media/audio/audio_output_controller.h
+++ b/media/audio/audio_output_controller.h
@@ -92,9 +92,9 @@ class MEDIA_EXPORT AudioOutputController
// prepare more data and perform synchronization.
virtual void UpdatePendingBytes(uint32 bytes) = 0;
- // Read certain amount of data into |data|. This method returns if some
- // data is available.
- virtual uint32 Read(void* data, uint32 size) = 0;
+ // Attempt to completely fill |audio_bus|, return the actual number of
+ // frames that could be read.
+ virtual int Read(AudioBus* audio_bus) = 0;
// Close this synchronous reader.
virtual void Close() = 0;
@@ -144,9 +144,8 @@ class MEDIA_EXPORT AudioOutputController
///////////////////////////////////////////////////////////////////////////
// AudioSourceCallback methods.
- virtual uint32 OnMoreData(uint8* dest,
- uint32 max_size,
- AudioBuffersState buffers_state) OVERRIDE;
+ virtual int OnMoreData(AudioBus* audio_bus,
+ AudioBuffersState buffers_state) OVERRIDE;
virtual void OnError(AudioOutputStream* stream, int code) OVERRIDE;
virtual void WaitTillDataReady() OVERRIDE;
@@ -172,10 +171,11 @@ class MEDIA_EXPORT AudioOutputController
static const int kPollPauseInMilliseconds;
AudioOutputController(EventHandler* handler,
- SyncReader* sync_reader);
+ SyncReader* sync_reader,
+ const AudioParameters& params);
// The following methods are executed on the audio manager thread.
- void DoCreate(AudioManager* audio_manager, const AudioParameters& params);
+ void DoCreate(AudioManager* audio_manager);
void DoPlay();
void PollAndStartIfDataReady();
void DoPause();
@@ -217,6 +217,8 @@ class MEDIA_EXPORT AudioOutputController
// Number of times left.
int number_polling_attempts_left_;
+ AudioParameters params_;
+
// Used to post delayed tasks to ourselves that we can cancel.
// We don't want the tasks to hold onto a reference as it will slow down
// shutdown and force it to wait for the most delayed task.
« no previous file with comments | « media/audio/audio_low_latency_input_output_unittest.cc ('k') | media/audio/audio_output_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698