OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 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 WEBKIT_GLUE_WEBAUDIODEVICE_IMPL_H_ |
| 6 #define WEBKIT_GLUE_WEBAUDIODEVICE_IMPL_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "chrome/renderer/audio_device.h" |
| 11 #include "third_party/WebKit/WebKit/chromium/public/WebAudioDevice.h" |
| 12 #include "third_party/WebKit/WebKit/chromium/public/WebVector.h" |
| 13 |
| 14 namespace webkit_glue { |
| 15 |
| 16 class WebAudioDeviceImpl : public WebKit::WebAudioDevice, |
| 17 public AudioDevice::RenderCallback { |
| 18 public: |
| 19 WebAudioDeviceImpl(size_t buffer_size, |
| 20 int channels, |
| 21 double sample_rate, |
| 22 WebKit::WebAudioDevice::RenderCallback* callback); |
| 23 virtual ~WebAudioDeviceImpl(); |
| 24 |
| 25 // WebKit::WebAudioDevice implementation. |
| 26 virtual void start(); |
| 27 virtual void stop(); |
| 28 |
| 29 // AudioDevice::RenderCallback implementation. |
| 30 void Render(const std::vector<float*>& audio_data, size_t number_of_frames); |
| 31 |
| 32 private: |
| 33 AudioDevice audio_device_; |
| 34 |
| 35 // Weak reference to the callback into WebKit code. |
| 36 WebKit::WebAudioDevice::RenderCallback* client_callback_; |
| 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(WebAudioDeviceImpl); |
| 39 }; |
| 40 |
| 41 } // namespace webkit_glue |
| 42 |
| 43 #endif // WEBKIT_GLUE_WEBAUDIODEVICE_IMPL_H_ |
OLD | NEW |