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