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 "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 public: | 34 public: |
35 explicit WebAudioSourceProviderImpl( | 35 explicit WebAudioSourceProviderImpl( |
36 const scoped_refptr<AudioRendererSink>& sink); | 36 const scoped_refptr<AudioRendererSink>& sink); |
37 | 37 |
38 // blink::WebAudioSourceProvider implementation. | 38 // blink::WebAudioSourceProvider implementation. |
39 virtual void setClient(blink::WebAudioSourceProviderClient* client); | 39 virtual void setClient(blink::WebAudioSourceProviderClient* client); |
40 virtual void provideInput(const blink::WebVector<float*>& audio_data, | 40 virtual void provideInput(const blink::WebVector<float*>& audio_data, |
41 size_t number_of_frames); | 41 size_t number_of_frames); |
42 | 42 |
43 // AudioRendererSink implementation. | 43 // AudioRendererSink implementation. |
44 virtual void Start() OVERRIDE; | 44 virtual void Start() override; |
45 virtual void Stop() OVERRIDE; | 45 virtual void Stop() override; |
46 virtual void Play() OVERRIDE; | 46 virtual void Play() override; |
47 virtual void Pause() OVERRIDE; | 47 virtual void Pause() override; |
48 virtual bool SetVolume(double volume) OVERRIDE; | 48 virtual bool SetVolume(double volume) override; |
49 virtual void Initialize(const AudioParameters& params, | 49 virtual void Initialize(const AudioParameters& params, |
50 RenderCallback* renderer) OVERRIDE; | 50 RenderCallback* renderer) override; |
51 | 51 |
52 protected: | 52 protected: |
53 virtual ~WebAudioSourceProviderImpl(); | 53 virtual ~WebAudioSourceProviderImpl(); |
54 | 54 |
55 private: | 55 private: |
56 // Calls setFormat() on |client_| from the Blink renderer thread. | 56 // Calls setFormat() on |client_| from the Blink renderer thread. |
57 void OnSetFormat(); | 57 void OnSetFormat(); |
58 | 58 |
59 // Closure that posts a task to call OnSetFormat() on the renderer thread. | 59 // Closure that posts a task to call OnSetFormat() on the renderer thread. |
60 base::Closure set_format_cb_; | 60 base::Closure set_format_cb_; |
(...skipping 20 matching lines...) Expand all Loading... |
81 | 81 |
82 // NOTE: Weak pointers must be invalidated before all other member variables. | 82 // NOTE: Weak pointers must be invalidated before all other member variables. |
83 base::WeakPtrFactory<WebAudioSourceProviderImpl> weak_factory_; | 83 base::WeakPtrFactory<WebAudioSourceProviderImpl> weak_factory_; |
84 | 84 |
85 DISALLOW_IMPLICIT_CONSTRUCTORS(WebAudioSourceProviderImpl); | 85 DISALLOW_IMPLICIT_CONSTRUCTORS(WebAudioSourceProviderImpl); |
86 }; | 86 }; |
87 | 87 |
88 } // namespace media | 88 } // namespace media |
89 | 89 |
90 #endif // MEDIA_BLINK_WEBAUDIOSOURCEPROVIDER_IMPL_H_ | 90 #endif // MEDIA_BLINK_WEBAUDIOSOURCEPROVIDER_IMPL_H_ |
OLD | NEW |