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 CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_SOURCE_PROVIDER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_SOURCE_PROVIDER_H_ |
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_SOURCE_PROVIDER_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_SOURCE_PROVIDER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 16 matching lines...) Expand all Loading... |
27 class AudioFifo; | 27 class AudioFifo; |
28 class AudioParameters; | 28 class AudioParameters; |
29 } | 29 } |
30 | 30 |
31 namespace blink { | 31 namespace blink { |
32 class WebAudioSourceProviderClient; | 32 class WebAudioSourceProviderClient; |
33 } | 33 } |
34 | 34 |
35 namespace content { | 35 namespace content { |
36 | 36 |
37 // TODO(miu): This implementation should be renamed to WebAudioMediaStreamSink, | 37 // WebRtcLocalAudioSourceProvider provides a bridge between classes: |
38 // as it should work as a provider for WebAudio from ANY MediaStreamAudioTrack. | 38 // WebRtcLocalAudioTrack ---> blink::WebAudioSourceProvider |
39 // http://crbug.com/577874 | |
40 // | 39 // |
41 // WebRtcLocalAudioSourceProvider provides a bridge between classes: | 40 // WebRtcLocalAudioSourceProvider works as a sink to the WebRtcLocalAudioTrack |
42 // MediaStreamAudioTrack ---> blink::WebAudioSourceProvider | 41 // and store the capture data to a FIFO. When the media stream is connected to |
43 // | |
44 // WebRtcLocalAudioSourceProvider works as a sink to the MediaStreamAudioTrack | |
45 // and stores the capture data to a FIFO. When the media stream is connected to | |
46 // WebAudio MediaStreamAudioSourceNode as a source provider, | 42 // WebAudio MediaStreamAudioSourceNode as a source provider, |
47 // MediaStreamAudioSourceNode will periodically call provideInput() to get the | 43 // MediaStreamAudioSourceNode will periodically call provideInput() to get the |
48 // data from the FIFO. | 44 // data from the FIFO. |
49 // | 45 // |
50 // All calls are protected by a lock. | 46 // All calls are protected by a lock. |
51 class CONTENT_EXPORT WebRtcLocalAudioSourceProvider | 47 class CONTENT_EXPORT WebRtcLocalAudioSourceProvider |
52 : NON_EXPORTED_BASE(public blink::WebAudioSourceProvider), | 48 : NON_EXPORTED_BASE(public blink::WebAudioSourceProvider), |
53 NON_EXPORTED_BASE(public media::AudioConverter::InputCallback), | 49 NON_EXPORTED_BASE(public media::AudioConverter::InputCallback), |
54 NON_EXPORTED_BASE(public MediaStreamAudioSink) { | 50 NON_EXPORTED_BASE(public MediaStreamAudioSink) { |
55 public: | 51 public: |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 104 |
109 // Flag to tell if the track has been stopped or not. | 105 // Flag to tell if the track has been stopped or not. |
110 bool track_stopped_; | 106 bool track_stopped_; |
111 | 107 |
112 DISALLOW_COPY_AND_ASSIGN(WebRtcLocalAudioSourceProvider); | 108 DISALLOW_COPY_AND_ASSIGN(WebRtcLocalAudioSourceProvider); |
113 }; | 109 }; |
114 | 110 |
115 } // namespace content | 111 } // namespace content |
116 | 112 |
117 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_SOURCE_PROVIDER_H_ | 113 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_SOURCE_PROVIDER_H_ |
OLD | NEW |