Index: content/renderer/media/media_stream_audio_processor.h |
diff --git a/content/renderer/media/media_stream_audio_processor.h b/content/renderer/media/media_stream_audio_processor.h |
index be5b8b0409ea82d73e22cab068a0dbe8ce68282e..680505baf64ad62b5f9e361ffeb3fa020b7a1f0f 100644 |
--- a/content/renderer/media/media_stream_audio_processor.h |
+++ b/content/renderer/media/media_stream_audio_processor.h |
@@ -10,6 +10,7 @@ |
#include "base/threading/thread_checker.h" |
#include "base/time/time.h" |
#include "content/common/content_export.h" |
+#include "content/renderer/media/webrtc_audio_device_impl.h" |
#include "media/base/audio_converter.h" |
#include "third_party/webrtc/modules/audio_processing/include/audio_processing.h" |
#include "third_party/webrtc/modules/interface/module_common_types.h" |
@@ -37,27 +38,18 @@ class RTCMediaConstraints; |
// on the getUserMedia constraints, processes the data and outputs it in a unit |
// of 10 ms data chunk. |
class CONTENT_EXPORT MediaStreamAudioProcessor : |
- public base::RefCountedThreadSafe<MediaStreamAudioProcessor> { |
+ public base::RefCountedThreadSafe<MediaStreamAudioProcessor>, |
+ public WebRtcAudioRendererSource { |
public: |
MediaStreamAudioProcessor(const media::AudioParameters& source_params, |
const blink::WebMediaConstraints& constraints, |
- int effects); |
+ int effects, |
+ WebRtcAudioDeviceImpl* audio_device); |
// Pushes capture data in |audio_source| to the internal FIFO. |
// Called on the capture audio thread. |
void PushCaptureData(media::AudioBus* audio_source); |
- // Push the render audio to webrtc::AudioProcessing for analysis. This is |
- // needed iff echo processing is enabled. |
- // |render_audio| is the pointer to the render audio data, its format |
- // is specified by |sample_rate|, |number_of_channels| and |number_of_frames|. |
- // Called on the render audio thread. |
- void PushRenderData(const int16* render_audio, |
- int sample_rate, |
- int number_of_channels, |
- int number_of_frames, |
- base::TimeDelta render_delay); |
- |
// Processes a block of 10 ms data from the internal FIFO and outputs it via |
// |out|. |out| is the address of the pointer that will be pointed to |
// the post-processed data if the method is returning a true. The lifetime |
@@ -90,6 +82,12 @@ class CONTENT_EXPORT MediaStreamAudioProcessor : |
private: |
class MediaStreamAudioConverter; |
+ // WebRtcAudioRendererSource implementation. |
+ virtual void RenderData(media::AudioBus* audio_bus, |
+ int sample_rate, |
+ int audio_delay_milliseconds) OVERRIDE; |
+ virtual void RemoveAudioRenderer(WebRtcAudioRenderer* renderer) OVERRIDE; |
+ |
// Helper to initialize the WebRtc AudioProcessing. |
void InitializeAudioProcessingModule( |
const blink::WebMediaConstraints& constraints, int effects); |
@@ -135,8 +133,9 @@ class CONTENT_EXPORT MediaStreamAudioProcessor : |
// Data bus to help converting interleaved data to an AudioBus. |
scoped_ptr<media::AudioBus> render_data_bus_; |
- // Used to DCHECK that some methods are called on the main render thread. |
- base::ThreadChecker main_thread_checker_; |
+ // Raw pointer to the WebRtcAudioDeviceImpl, which is valid for the lifetime |
+ // of RenderThread. |
+ WebRtcAudioDeviceImpl* audio_device_; |
// Used to DCHECK that some methods are called on the capture audio thread. |
base::ThreadChecker capture_thread_checker_; |