OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_ |
6 #define CONTENT_RENDERER_MEDIA_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "media/base/audio_renderer_sink.h" | 9 #include "media/base/audio_renderer_sink.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebAudioDevi
ce.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebAudioDevi
ce.h" |
11 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" |
12 | 12 |
13 class RendererWebAudioDeviceImpl | 13 class RendererWebAudioDeviceImpl |
14 : public WebKit::WebAudioDevice, | 14 : public WebKit::WebAudioDevice, |
15 public media::AudioRendererSink::RenderCallback { | 15 public media::AudioRendererSink::RenderCallback { |
16 public: | 16 public: |
17 RendererWebAudioDeviceImpl(const media::AudioParameters& params, | 17 RendererWebAudioDeviceImpl(const media::AudioParameters& params, |
18 WebKit::WebAudioDevice::RenderCallback* callback); | 18 WebKit::WebAudioDevice::RenderCallback* callback); |
19 virtual ~RendererWebAudioDeviceImpl(); | 19 virtual ~RendererWebAudioDeviceImpl(); |
20 | 20 |
21 // WebKit::WebAudioDevice implementation. | 21 // WebKit::WebAudioDevice implementation. |
22 virtual void start(); | 22 virtual void start(); |
23 virtual void stop(); | 23 virtual void stop(); |
24 virtual double sampleRate(); | 24 virtual double sampleRate(); |
25 | 25 |
26 // AudioRendererSink::RenderCallback implementation. | 26 // AudioRendererSink::RenderCallback implementation. |
27 virtual int Render(media::AudioBus* audio_bus, | 27 virtual int Render(media::AudioBus* dest, |
28 int audio_delay_milliseconds) OVERRIDE; | 28 int audio_delay_milliseconds) OVERRIDE; |
| 29 |
| 30 virtual void RenderIO(media::AudioBus* source, |
| 31 media::AudioBus* dest, |
| 32 int audio_delay_milliseconds) OVERRIDE; |
| 33 |
29 virtual void OnRenderError() OVERRIDE; | 34 virtual void OnRenderError() OVERRIDE; |
30 | 35 |
31 private: | 36 private: |
32 scoped_refptr<media::AudioRendererSink> audio_device_; | 37 scoped_refptr<media::AudioRendererSink> audio_device_; |
33 bool is_running_; | 38 bool is_running_; |
34 | 39 |
35 // Weak reference to the callback into WebKit code. | 40 // Weak reference to the callback into WebKit code. |
36 WebKit::WebAudioDevice::RenderCallback* client_callback_; | 41 WebKit::WebAudioDevice::RenderCallback* client_callback_; |
37 | 42 |
38 DISALLOW_COPY_AND_ASSIGN(RendererWebAudioDeviceImpl); | 43 DISALLOW_COPY_AND_ASSIGN(RendererWebAudioDeviceImpl); |
39 }; | 44 }; |
40 | 45 |
41 #endif // CONTENT_RENDERER_MEDIA_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_ | 46 #endif // CONTENT_RENDERER_MEDIA_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_ |
OLD | NEW |