| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 MEDIA_BLINK_WEBAUDIOSOURCEPROVIDER_IMPL_H_ | 5 #ifndef MEDIA_BLINK_WEBAUDIOSOURCEPROVIDER_IMPL_H_ |
| 6 #define MEDIA_BLINK_WEBAUDIOSOURCEPROVIDER_IMPL_H_ | 6 #define MEDIA_BLINK_WEBAUDIOSOURCEPROVIDER_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // the data if a listener is configured. WASPImpl is also a | 37 // the data if a listener is configured. WASPImpl is also a |
| 38 // RestartableAudioRendererSink itself in order to be controlled (Play(), | 38 // RestartableAudioRendererSink itself in order to be controlled (Play(), |
| 39 // Pause() etc). | 39 // Pause() etc). |
| 40 // | 40 // |
| 41 // All calls are protected by a lock. | 41 // All calls are protected by a lock. |
| 42 class MEDIA_BLINK_EXPORT WebAudioSourceProviderImpl | 42 class MEDIA_BLINK_EXPORT WebAudioSourceProviderImpl |
| 43 : NON_EXPORTED_BASE(public blink::WebAudioSourceProvider), | 43 : NON_EXPORTED_BASE(public blink::WebAudioSourceProvider), |
| 44 NON_EXPORTED_BASE(public SwitchableAudioRendererSink) { | 44 NON_EXPORTED_BASE(public SwitchableAudioRendererSink) { |
| 45 public: | 45 public: |
| 46 using CopyAudioCB = base::Callback<void(std::unique_ptr<AudioBus>, | 46 using CopyAudioCB = base::Callback<void(std::unique_ptr<AudioBus>, |
| 47 uint32_t delay_milliseconds, | 47 uint32_t frames_delayed, |
| 48 int sample_rate)>; | 48 int sample_rate)>; |
| 49 | 49 |
| 50 explicit WebAudioSourceProviderImpl( | 50 explicit WebAudioSourceProviderImpl( |
| 51 const scoped_refptr<SwitchableAudioRendererSink>& sink); | 51 const scoped_refptr<SwitchableAudioRendererSink>& sink); |
| 52 | 52 |
| 53 // blink::WebAudioSourceProvider implementation. | 53 // blink::WebAudioSourceProvider implementation. |
| 54 void setClient(blink::WebAudioSourceProviderClient* client) override; | 54 void setClient(blink::WebAudioSourceProviderClient* client) override; |
| 55 void provideInput(const blink::WebVector<float*>& audio_data, | 55 void provideInput(const blink::WebVector<float*>& audio_data, |
| 56 size_t number_of_frames) override; | 56 size_t number_of_frames) override; |
| 57 | 57 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 // NOTE: Weak pointers must be invalidated before all other member variables. | 105 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 106 base::WeakPtrFactory<WebAudioSourceProviderImpl> weak_factory_; | 106 base::WeakPtrFactory<WebAudioSourceProviderImpl> weak_factory_; |
| 107 | 107 |
| 108 DISALLOW_IMPLICIT_CONSTRUCTORS(WebAudioSourceProviderImpl); | 108 DISALLOW_IMPLICIT_CONSTRUCTORS(WebAudioSourceProviderImpl); |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 } // namespace media | 111 } // namespace media |
| 112 | 112 |
| 113 #endif // MEDIA_BLINK_WEBAUDIOSOURCEPROVIDER_IMPL_H_ | 113 #endif // MEDIA_BLINK_WEBAUDIOSOURCEPROVIDER_IMPL_H_ |
| OLD | NEW |