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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 void Initialize(const AudioParameters& params, | 65 void Initialize(const AudioParameters& params, |
66 RenderCallback* renderer) override; | 66 RenderCallback* renderer) override; |
67 void SwitchOutputDevice(const std::string& device_id, | 67 void SwitchOutputDevice(const std::string& device_id, |
68 const url::Origin& security_origin, | 68 const url::Origin& security_origin, |
69 const OutputDeviceStatusCB& callback) override; | 69 const OutputDeviceStatusCB& callback) override; |
70 | 70 |
71 // These methods allow a client to get a copy of the rendered audio. | 71 // These methods allow a client to get a copy of the rendered audio. |
72 void SetCopyAudioCallback(const CopyAudioCB& callback); | 72 void SetCopyAudioCallback(const CopyAudioCB& callback); |
73 void ClearCopyAudioCallback(); | 73 void ClearCopyAudioCallback(); |
74 | 74 |
75 int RenderForTesting(AudioBus* audio_bus); | |
76 | |
77 private: | 75 private: |
78 friend class WebAudioSourceProviderImplTest; | 76 friend class WebAudioSourceProviderImplTest; |
79 ~WebAudioSourceProviderImpl() override; | 77 ~WebAudioSourceProviderImpl() override; |
80 | 78 |
81 // Calls setFormat() on |client_| from the Blink renderer thread. | 79 // Calls setFormat() on |client_| from the Blink renderer thread. |
82 void OnSetFormat(); | 80 void OnSetFormat(); |
83 | 81 |
| 82 int RenderForTesting(AudioBus* audio_bus); |
| 83 |
84 // Used to keep the volume across reconfigurations. | 84 // Used to keep the volume across reconfigurations. |
85 double volume_; | 85 double volume_; |
86 | 86 |
87 // Tracks the current playback state. | 87 // Tracks the current playback state. |
88 enum PlaybackState { kStopped, kStarted, kPlaying }; | 88 enum PlaybackState { kStopped, kStarted, kPlaying }; |
89 PlaybackState state_; | 89 PlaybackState state_; |
90 | 90 |
91 // Closure that calls OnSetFormat() on |client_| on the renderer thread. | 91 // Closure that calls OnSetFormat() on |client_| on the renderer thread. |
92 base::Closure set_format_cb_; | 92 base::Closure set_format_cb_; |
93 // When set via setClient() it overrides |sink_| for consuming audio. | 93 // When set via setClient() it overrides |sink_| for consuming audio. |
(...skipping 10 matching lines...) Expand all 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 |