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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/render_view.cc ('k') | webkit/glue/webmediaplayer_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_FILTERS_AUDIO_RENDERER_SINK_H_
6 #define MEDIA_FILTERS_AUDIO_RENDERER_SINK_H_
7
8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11
12 namespace media {
13
14 // AudioRendererSink is an abstract base class representing the end-point for
15 // rendered audio in the renderer process. An implementation is expected to
16 // periodically call Render() on a callback object. A typical implementation
17 // will talk with the browser process to get a rendered audio stream to the
18 // audio hardware.
19
20 class AudioRendererSink
21 : public base::RefCountedThreadSafe<media::AudioRendererSink> {
22 public:
23 class RenderCallback {
24 public:
25 virtual void Render(const std::vector<float*>& audio_data,
26 size_t number_of_frames,
27 size_t audio_delay_milliseconds) = 0;
28
29 virtual void SetAudioRendererSink(media::AudioRendererSink* audio_sink) { }
30
31 protected:
32 virtual ~RenderCallback() { }
33 };
34
35 // Starts audio playback. Returns |true| on success.
36 virtual bool Start() = 0;
37
38 // Stops audio playback. Returns |true| on success.
39 virtual bool Stop() = 0;
40
41 // Sets the playback volume, with range [0.0, 1.0] inclusive.
42 // Returns |true| on success.
43 virtual bool SetVolume(double volume) = 0;
44 };
45
46 } // namespace media
47
48 #endif // MEDIA_FILTERS_AUDIO_RENDERER_SINK_H_
OLDNEW
« 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