| 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_RENDERER_WEBAUDIODEVICE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_ | 6 #define CONTENT_RENDERER_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/cancelable_callback.h" | 10 #include "base/cancelable_callback.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/threading/thread_checker.h" | 13 #include "base/threading/thread_checker.h" |
| 14 #include "media/audio/audio_io.h" |
| 14 #include "media/base/audio_parameters.h" | 15 #include "media/base/audio_parameters.h" |
| 15 #include "media/base/audio_renderer_sink.h" | 16 #include "media/base/audio_renderer_sink.h" |
| 16 #include "third_party/WebKit/public/platform/WebAudioDevice.h" | 17 #include "third_party/WebKit/public/platform/WebAudioDevice.h" |
| 17 #include "third_party/WebKit/public/platform/WebVector.h" | 18 #include "third_party/WebKit/public/platform/WebVector.h" |
| 18 #include "url/origin.h" | 19 #include "url/origin.h" |
| 19 | 20 |
| 20 namespace base { | 21 namespace base { |
| 21 class SingleThreadTaskRunner; | 22 class SingleThreadTaskRunner; |
| 22 } | 23 } |
| 23 | 24 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 38 ~RendererWebAudioDeviceImpl() override; | 39 ~RendererWebAudioDeviceImpl() override; |
| 39 | 40 |
| 40 // blink::WebAudioDevice implementation. | 41 // blink::WebAudioDevice implementation. |
| 41 void start() override; | 42 void start() override; |
| 42 void stop() override; | 43 void stop() override; |
| 43 double sampleRate() override; | 44 double sampleRate() override; |
| 44 | 45 |
| 45 // AudioRendererSink::RenderCallback implementation. | 46 // AudioRendererSink::RenderCallback implementation. |
| 46 int Render(media::AudioBus* dest, | 47 int Render(media::AudioBus* dest, |
| 47 uint32_t frames_delayed, | 48 uint32_t frames_delayed, |
| 48 uint32_t frames_skipped) override; | 49 uint32_t frames_skipped, |
| 50 const media::AudioTimestamp& timestamp) override; |
| 49 | 51 |
| 50 void OnRenderError() override; | 52 void OnRenderError() override; |
| 51 | 53 |
| 52 private: | 54 private: |
| 53 const media::AudioParameters params_; | 55 const media::AudioParameters params_; |
| 54 | 56 |
| 55 // Weak reference to the callback into WebKit code. | 57 // Weak reference to the callback into WebKit code. |
| 56 blink::WebAudioDevice::RenderCallback* const client_callback_; | 58 blink::WebAudioDevice::RenderCallback* const client_callback_; |
| 57 | 59 |
| 58 // To avoid the need for locking, ensure the control methods of the | 60 // To avoid the need for locking, ensure the control methods of the |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 93 |
| 92 // Security origin, used to check permissions for |output_device_|. | 94 // Security origin, used to check permissions for |output_device_|. |
| 93 url::Origin security_origin_; | 95 url::Origin security_origin_; |
| 94 | 96 |
| 95 DISALLOW_COPY_AND_ASSIGN(RendererWebAudioDeviceImpl); | 97 DISALLOW_COPY_AND_ASSIGN(RendererWebAudioDeviceImpl); |
| 96 }; | 98 }; |
| 97 | 99 |
| 98 } // namespace content | 100 } // namespace content |
| 99 | 101 |
| 100 #endif // CONTENT_RENDERER_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_ | 102 #endif // CONTENT_RENDERER_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_ |
| OLD | NEW |