| 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 <string> | |
| 9 | |
| 10 #include "base/callback.h" | 8 #include "base/callback.h" |
| 11 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 12 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| 13 #include "media/base/audio_renderer_sink.h" | 11 #include "media/base/audio_renderer_sink.h" |
| 14 #include "media/base/media_export.h" | 12 #include "media/base/media_export.h" |
| 15 #include "third_party/WebKit/public/platform/WebAudioSourceProvider.h" | 13 #include "third_party/WebKit/public/platform/WebAudioSourceProvider.h" |
| 16 #include "third_party/WebKit/public/platform/WebVector.h" | 14 #include "third_party/WebKit/public/platform/WebVector.h" |
| 17 | 15 |
| 18 namespace blink { | 16 namespace blink { |
| 19 class WebAudioSourceProviderClient; | 17 class WebAudioSourceProviderClient; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 41 virtual void setClient(blink::WebAudioSourceProviderClient* client); | 39 virtual void setClient(blink::WebAudioSourceProviderClient* client); |
| 42 virtual void provideInput(const blink::WebVector<float*>& audio_data, | 40 virtual void provideInput(const blink::WebVector<float*>& audio_data, |
| 43 size_t number_of_frames); | 41 size_t number_of_frames); |
| 44 | 42 |
| 45 // AudioRendererSink implementation. | 43 // AudioRendererSink implementation. |
| 46 void Start() override; | 44 void Start() override; |
| 47 void Stop() override; | 45 void Stop() override; |
| 48 void Play() override; | 46 void Play() override; |
| 49 void Pause() override; | 47 void Pause() override; |
| 50 bool SetVolume(double volume) override; | 48 bool SetVolume(double volume) override; |
| 51 void SwitchOutputDevice(const std::string& device_id, | |
| 52 const GURL& security_origin, | |
| 53 const SwitchOutputDeviceCB& callback) override; | |
| 54 void Initialize(const AudioParameters& params, | 49 void Initialize(const AudioParameters& params, |
| 55 RenderCallback* renderer) override; | 50 RenderCallback* renderer) override; |
| 56 | 51 |
| 57 protected: | 52 protected: |
| 58 virtual ~WebAudioSourceProviderImpl(); | 53 virtual ~WebAudioSourceProviderImpl(); |
| 59 | 54 |
| 60 private: | 55 private: |
| 61 // Calls setFormat() on |client_| from the Blink renderer thread. | 56 // Calls setFormat() on |client_| from the Blink renderer thread. |
| 62 void OnSetFormat(); | 57 void OnSetFormat(); |
| 63 | 58 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 86 | 81 |
| 87 // NOTE: Weak pointers must be invalidated before all other member variables. | 82 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 88 base::WeakPtrFactory<WebAudioSourceProviderImpl> weak_factory_; | 83 base::WeakPtrFactory<WebAudioSourceProviderImpl> weak_factory_; |
| 89 | 84 |
| 90 DISALLOW_IMPLICIT_CONSTRUCTORS(WebAudioSourceProviderImpl); | 85 DISALLOW_IMPLICIT_CONSTRUCTORS(WebAudioSourceProviderImpl); |
| 91 }; | 86 }; |
| 92 | 87 |
| 93 } // namespace media | 88 } // namespace media |
| 94 | 89 |
| 95 #endif // MEDIA_BLINK_WEBAUDIOSOURCEPROVIDER_IMPL_H_ | 90 #endif // MEDIA_BLINK_WEBAUDIOSOURCEPROVIDER_IMPL_H_ |
| OLD | NEW |