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

Unified Diff: media/base/audio_renderer_sink.h

Issue 10830268: Allow audio system to handle synchronized low-latency audio I/O (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
Index: media/base/audio_renderer_sink.h
===================================================================
--- media/base/audio_renderer_sink.h (revision 156102)
+++ media/base/audio_renderer_sink.h (working copy)
@@ -23,10 +23,15 @@
public:
class RenderCallback {
public:
- // Attempts to completely fill all channels of |audio_bus|, returns actual
+ // Attempts to completely fill all channels of |dest|, returns actual
// number of frames filled.
- virtual int Render(AudioBus* audio_bus, int audio_delay_milliseconds) = 0;
+ virtual int Render(AudioBus* dest, int audio_delay_milliseconds) = 0;
+ // Synchronized audio I/O - see InitializeIO() below.
+ virtual void RenderIO(AudioBus* source,
henrika (OOO until Aug 14) 2012/09/11 21:44:48 Nit, are we OK with default implementations in int
+ AudioBus* dest,
+ int audio_delay_milliseconds) {}
+
// Signals an error has occurred.
virtual void OnRenderError() = 0;
@@ -39,6 +44,17 @@
virtual void Initialize(const AudioParameters& params,
RenderCallback* callback) = 0;
+ // InitializeIO() may be called instead of Initialize() for clients who wish
+ // to have synchronized input and output. |input_channels| specifies the
+ // number of input channels which will be at the same sample-rate
+ // and buffer-size as the output as specified in |params|.
+ // The callback's RenderIO() method will be called instead of Render(),
+ // providing the synchronized input data at the same time as when new
+ // output data is to be rendered.
+ virtual void InitializeIO(const AudioParameters& params,
henrika (OOO until Aug 14) 2012/09/11 21:44:48 It is not clear to me why we need inputy_channels.
+ int input_channels,
+ RenderCallback* callback) {}
+
// Starts audio playback.
virtual void Start() = 0;

Powered by Google App Engine
This is Rietveld 408576698