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_AUDIO_DEVICE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ |
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 | 233 |
234 // TODO(xians): Merge this interface with WebRtcAudioRendererSource. | 234 // TODO(xians): Merge this interface with WebRtcAudioRendererSource. |
235 // The reason why we could not do it today is that WebRtcAudioRendererSource | 235 // The reason why we could not do it today is that WebRtcAudioRendererSource |
236 // gets the data by pulling, while the data is pushed into | 236 // gets the data by pulling, while the data is pushed into |
237 // WebRtcPlayoutDataSource::Sink. | 237 // WebRtcPlayoutDataSource::Sink. |
238 class WebRtcPlayoutDataSource { | 238 class WebRtcPlayoutDataSource { |
239 public: | 239 public: |
240 class Sink { | 240 class Sink { |
241 public: | 241 public: |
242 // Callback to get the playout data. | 242 // Callback to get the playout data. |
243 // Called on the render audio thread. | |
244 virtual void OnPlayoutData(media::AudioBus* audio_bus, | 243 virtual void OnPlayoutData(media::AudioBus* audio_bus, |
245 int sample_rate, | 244 int sample_rate, |
246 int audio_delay_milliseconds) = 0; | 245 int audio_delay_milliseconds) = 0; |
247 | |
248 // Callback to notify the sink that the source has changed. | |
249 // Called on the main render thread. | |
250 virtual void OnPlayoutDataSourceChanged() = 0; | |
251 | |
252 protected: | 246 protected: |
253 virtual ~Sink() {} | 247 virtual ~Sink() {} |
254 }; | 248 }; |
255 | 249 |
256 // Adds/Removes the sink of WebRtcAudioRendererSource to the ADM. | 250 // Adds/Removes the sink of WebRtcAudioRendererSource to the ADM. |
257 // These methods are used by the MediaStreamAudioProcesssor to get the | 251 // These methods are used by the MediaStreamAudioProcesssor to get the |
258 // rendered data for AEC. | 252 // rendered data for AEC. |
259 virtual void AddPlayoutSink(Sink* sink) = 0; | 253 virtual void AddPlayoutSink(Sink* sink) = 0; |
260 virtual void RemovePlayoutSink(Sink* sink) = 0; | 254 virtual void RemovePlayoutSink(Sink* sink) = 0; |
261 | 255 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 | 446 |
453 // Used for start the Aec dump on the default capturer. | 447 // Used for start the Aec dump on the default capturer. |
454 base::PlatformFile aec_dump_file_; | 448 base::PlatformFile aec_dump_file_; |
455 | 449 |
456 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioDeviceImpl); | 450 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioDeviceImpl); |
457 }; | 451 }; |
458 | 452 |
459 } // namespace content | 453 } // namespace content |
460 | 454 |
461 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ | 455 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ |
OLD | NEW |