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

Side by Side Diff: content/renderer/render_audiosourceprovider.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
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 CONTENT_RENDERER_RENDERER_WEBAUDIOSOURCEPROVIDER_IMPL_H_
6 #define CONTENT_RENDERER_RENDERER_WEBAUDIOSOURCEPROVIDER_IMPL_H_
7
8 #include <vector>
9
10 #include "media/filters/audio_renderer_sink.h"
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAudioSourceProvide r.h"
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h"
13
14 // RenderAudioSourceProvider provides a bridge between classes:
15 // WebKit::WebAudioSourceProvider <---> media::AudioRendererSink
16 //
17 // The idea is that some code within WebKit periodically calls provideInput()
18 // to render a certain number of audio sample-frames. provideInput()
19 // uses its callback to get this data, and then massages it into the form
20 // required by provideInput().
21
22 class RenderAudioSourceProvider
23 : public WebKit::WebAudioSourceProvider,
24 public media::AudioRendererSink {
25 public:
26 RenderAudioSourceProvider(media::AudioRendererSink::RenderCallback* callback);
27 virtual ~RenderAudioSourceProvider() { }
28
29 // WebKit::WebAudioSourceProvider implementation.
30 // WebKit calls this to get the rendered audio stream.
31 virtual void provideInput(const WebKit::WebVector<float*>& audio_data,
32 size_t number_of_frames);
33
34 // AudioSink implementation.
35 virtual bool Start();
36 virtual bool Stop();
37 virtual bool SetVolume(double volume);
38
39 private:
40 bool is_running_;
41 double volume_;
42 media::AudioRendererSink::RenderCallback* callback_;
43
44 DISALLOW_COPY_AND_ASSIGN(RenderAudioSourceProvider);
45 };
46
47 #endif // CONTENT_RENDERER_RENDERER_WEBAUDIOSOURCEPROVIDER_IMPL_H_
OLDNEW
« no previous file with comments | « content/renderer/media/audio_renderer_impl.cc ('k') | content/renderer/render_audiosourceprovider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698