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

Unified Diff: content/renderer/media/audio_device.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_device.h
===================================================================
--- content/renderer/media/audio_device.h (revision 114311)
+++ content/renderer/media/audio_device.h (working copy)
@@ -73,21 +73,13 @@
#include "content/common/content_export.h"
#include "content/renderer/media/audio_message_filter.h"
#include "media/audio/audio_parameters.h"
+#include "media/filters/audio_renderer_sink.h"
class CONTENT_EXPORT AudioDevice
- : public AudioMessageFilter::Delegate,
- public base::DelegateSimpleThread::Delegate,
- public base::RefCountedThreadSafe<AudioDevice> {
+ : public media::AudioRendererSink,
+ public AudioMessageFilter::Delegate,
+ public base::DelegateSimpleThread::Delegate {
public:
- class CONTENT_EXPORT RenderCallback {
- public:
- virtual void Render(const std::vector<float*>& audio_data,
- size_t number_of_frames,
- size_t audio_delay_milliseconds) = 0;
- protected:
- virtual ~RenderCallback() {}
- };
-
// Methods called on main render thread -------------------------------------
// Minimal constructor where Initialize() must be called later.
@@ -99,35 +91,35 @@
RenderCallback* callback);
virtual ~AudioDevice();
- void Initialize(size_t buffer_size,
- int channels,
- double sample_rate,
- AudioParameters::Format latency_format,
- RenderCallback* callback);
- bool IsInitialized();
+ // AudioRendererSink implementation.
+ virtual void Initialize(size_t buffer_size,
+ int channels,
+ double sample_rate,
+ AudioParameters::Format latency_format,
+ RenderCallback* callback) OVERRIDE;
// Starts audio playback.
- void Start();
+ virtual void Start() OVERRIDE;
// Stops audio playback.
- void Stop();
+ virtual void Stop() OVERRIDE;
// Resumes playback if currently paused.
// TODO(crogers): it should be possible to remove the extra complexity
// of Play() and Pause() with additional re-factoring work in
// AudioRendererImpl.
- void Play();
+ virtual void Play() OVERRIDE;
// Pauses playback.
// If |flush| is true then any pending audio that is in the pipeline
// (has not yet reached the hardware) will be discarded. In this case,
// when Play() is later called, no previous pending audio will be
// rendered.
- void Pause(bool flush);
+ virtual void Pause(bool flush) OVERRIDE;
// Sets the playback volume, with range [0.0, 1.0] inclusive.
// Returns |true| on success.
- bool SetVolume(double volume);
+ virtual bool SetVolume(double volume) OVERRIDE;
// Gets the playback volume, with range [0.0, 1.0] inclusive.
void GetVolume(double* volume);
henrika (OOO until Aug 14) 2011/12/20 21:01:01 My proposal was to make this one virtual as well.
Chris Rogers 2011/12/21 01:38:17 Done.

Powered by Google App Engine
This is Rietveld 408576698