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

Unified Diff: content/renderer/media/audio_renderer_impl.h

Issue 8980008: Integrate HTMLMediaElement with Web Audio API's MediaElementAudioSourceNode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years 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: content/renderer/media/audio_renderer_impl.h
===================================================================
--- content/renderer/media/audio_renderer_impl.h (revision 114311)
+++ content/renderer/media/audio_renderer_impl.h (working copy)
@@ -26,6 +26,7 @@
#include "media/audio/audio_io.h"
#include "media/audio/audio_parameters.h"
#include "media/filters/audio_renderer_base.h"
+#include "media/filters/audio_renderer_sink.h"
class AudioMessageFilter;
@@ -74,11 +75,15 @@
void DoPause();
void DoSeek();
- // AudioDevice::RenderCallback implementation.
+ // media::AudioRendererSink::RenderCallback implementation.
virtual void Render(const std::vector<float*>& audio_data,
size_t number_of_frames,
size_t audio_delay_milliseconds) OVERRIDE;
+ // Detach from normal playback with AudioDevice and use the given sink.
+ // Passing in NULL means to use the default sink which is the AudioDevice.
+ virtual void SetAudioRendererSink(media::AudioRendererSink* sink) OVERRIDE;
+
// Accessors used by tests.
base::Time earliest_end_time() const {
return earliest_end_time_;
@@ -103,9 +108,18 @@
// A flag that indicates this filter is called to stop.
bool stopped_;
- // audio_device_ is the sink (destination) for rendered audio.
+ // sink_ is the sink (destination) for rendered audio.
+ media::AudioRendererSink* sink_;
+
+ // Protects access to sink_
+ base::Lock sink_lock_;
+
+ // audio_device_ is the default sink.
scoped_refptr<AudioDevice> audio_device_;
+ // Set to true when OnInitialize() is called.
+ bool is_initialized_;
+
// We're supposed to know amount of audio data OS or hardware buffered, but
// that is not always so -- on my Linux box
// AudioBuffersState::hardware_delay_bytes never reaches 0.

Powered by Google App Engine
This is Rietveld 408576698