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 <vector> | 10 #include <vector> |
(...skipping 17 matching lines...) Expand all Loading... |
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 // WebRtcLocalAudioSourceProvider provides a bridge between classes: | 37 // WebRtcLocalAudioSourceProvider provides a bridge between classes: |
38 // WebRtcLocalAudioTrack ---> blink::WebAudioSourceProvider | 38 // MediaStreamAudioTrack ---> blink::WebAudioSourceProvider |
39 // | 39 // |
40 // WebRtcLocalAudioSourceProvider works as a sink to the WebRtcLocalAudioTrack | 40 // WebRtcLocalAudioSourceProvider works as a sink to the MediaStreamAudioTrack |
41 // and store the capture data to a FIFO. When the media stream is connected to | 41 // and stores the capture data to a FIFO. When the media stream is connected to |
42 // WebAudio MediaStreamAudioSourceNode as a source provider, | 42 // WebAudio MediaStreamAudioSourceNode as a source provider, |
43 // MediaStreamAudioSourceNode will periodically call provideInput() to get the | 43 // MediaStreamAudioSourceNode will periodically call provideInput() to get the |
44 // data from the FIFO. | 44 // data from the FIFO. |
45 // | 45 // |
46 // All calls are protected by a lock. | 46 // All calls are protected by a lock. |
| 47 // |
| 48 // TODO(miu): This class should be renamed to WebAudioMediaStreamSink since it |
| 49 // works with all media stream tracks and there is nothing specific to WebRTC |
| 50 // here. |
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: |
52 static const size_t kWebAudioRenderBufferSize; | 56 static const size_t kWebAudioRenderBufferSize; |
53 | 57 |
54 explicit WebRtcLocalAudioSourceProvider( | 58 explicit WebRtcLocalAudioSourceProvider( |
55 const blink::WebMediaStreamTrack& track); | 59 const blink::WebMediaStreamTrack& track); |
56 ~WebRtcLocalAudioSourceProvider() override; | 60 ~WebRtcLocalAudioSourceProvider() override; |
(...skipping 47 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 |