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

Side by Side Diff: media/filters/audio_renderer_sink.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 unified diff | Download patch | Annotate | Revision Log
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 <vector>
9 #include "base/basictypes.h"
10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "media/audio/audio_parameters.h"
13
14 namespace media {
15
16 // AudioRendererSink is an interface representing the end-point for
17 // rendered audio in the renderer process. An implementation is expected to
18 // periodically call Render() on a callback object. The normal implementation
henrika (OOO until Aug 14) 2011/12/19 14:27:05 And a non-normal implementation would do what ;-)
Chris Rogers 2011/12/19 21:40:35 RenderAudioSourceProvider is an example in this CL
henrika (OOO until Aug 14) 2011/12/20 21:01:01 typical instead of normal?
19 // will talk with the browser process to get a rendered audio stream to the
20 // audio hardware.
21
22 class AudioRendererSink
23 : public base::RefCountedThreadSafe<media::AudioRendererSink> {
24 public:
25 class RenderCallback {
26 public:
27 virtual void Render(const std::vector<float*>& audio_data,
28 size_t number_of_frames,
29 size_t audio_delay_milliseconds) = 0;
30
31 virtual void SetAudioRendererSink(media::AudioRendererSink* audio_sink) { }
henrika (OOO until Aug 14) 2011/12/19 14:27:05 What about adding a comment on this method?
Chris Rogers 2011/12/19 21:40:35 Tommi had a similar comment about this method in a
henrika (OOO until Aug 14) 2011/12/20 21:01:01 Seems like you did changes here already. No furthe
32
33 protected:
34 virtual ~RenderCallback() { }
tommi (sloooow) - chröme 2011/12/19 15:26:24 {}
Chris Rogers 2011/12/19 21:40:35 Done.
35 };
36
37 virtual ~AudioRendererSink() { }
tommi (sloooow) - chröme 2011/12/19 15:26:24 {}
Chris Rogers 2011/12/19 21:40:35 Done.
38
39 // Initialize() sets important information about the audio stream format.
henrika (OOO until Aug 14) 2011/12/19 14:27:05 nit, don't think we have to list the function name
Chris Rogers 2011/12/19 21:40:35 Done.
40 // It must be called before any of the other methods.
41 virtual void Initialize(size_t buffer_size,
42 int channels,
43 double sample_rate,
44 AudioParameters::Format latency_format,
45 RenderCallback* callback) = 0;
46
47 // Starts audio playback.
48 virtual void Start() = 0;
49
50 // Stops audio playback.
51 virtual void Stop() = 0;
52
53 // Pauses playback.
54 virtual void Pause(bool flush) = 0;
55
56 // Resumes playback after calling Pause().
57 virtual void Play() = 0;
58
59 // Sets the playback volume, with range [0.0, 1.0] inclusive.
60 // Returns |true| on success.
61 virtual bool SetVolume(double volume) = 0;
62 };
63
64 } // namespace media
65
66 #endif // MEDIA_FILTERS_AUDIO_RENDERER_SINK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698