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

Unified Diff: media/filters/audio_renderer_sink.h

Issue 7631033: Very early implementation for HTMLMediaElement / Web Audio API integration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 | « content/renderer/render_view.cc ('k') | webkit/glue/webmediaplayer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/audio_renderer_sink.h
===================================================================
--- media/filters/audio_renderer_sink.h (revision 0)
+++ media/filters/audio_renderer_sink.h (revision 0)
@@ -0,0 +1,48 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_FILTERS_AUDIO_RENDERER_SINK_H_
+#define MEDIA_FILTERS_AUDIO_RENDERER_SINK_H_
+
+#include "base/basictypes.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace media {
+
+// AudioRendererSink is an abstract base class representing the end-point for
+// rendered audio in the renderer process. An implementation is expected to
+// periodically call Render() on a callback object. A typical implementation
+// will talk with the browser process to get a rendered audio stream to the
+// audio hardware.
+
+class AudioRendererSink
+ : public base::RefCountedThreadSafe<media::AudioRendererSink> {
+ public:
+ class RenderCallback {
+ public:
+ virtual void Render(const std::vector<float*>& audio_data,
+ size_t number_of_frames,
+ size_t audio_delay_milliseconds) = 0;
+
+ virtual void SetAudioRendererSink(media::AudioRendererSink* audio_sink) { }
+
+ protected:
+ virtual ~RenderCallback() { }
+ };
+
+ // Starts audio playback. Returns |true| on success.
+ virtual bool Start() = 0;
+
+ // Stops audio playback. Returns |true| on success.
+ virtual bool Stop() = 0;
+
+ // Sets the playback volume, with range [0.0, 1.0] inclusive.
+ // Returns |true| on success.
+ virtual bool SetVolume(double volume) = 0;
+};
+
+} // namespace media
+
+#endif // MEDIA_FILTERS_AUDIO_RENDERER_SINK_H_
« no previous file with comments | « content/renderer/render_view.cc ('k') | webkit/glue/webmediaplayer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698