Index: content/renderer/media/webrtc_audio_device_impl.h |
diff --git a/content/renderer/media/webrtc_audio_device_impl.h b/content/renderer/media/webrtc_audio_device_impl.h |
index b644178030b5009677935ad1a45bbf80033479b4..039175550dfb8c66ce29c6534084a9a6f3a37617 100644 |
--- a/content/renderer/media/webrtc_audio_device_impl.h |
+++ b/content/renderer/media/webrtc_audio_device_impl.h |
@@ -210,12 +210,6 @@ class WebRtcAudioCapturerSink { |
// |sample_rate| is the sample frequency of audio data. |
// |number_of_channels| is the number of channels reflecting the order of |
// surround sound channels. |
- // |audio_delay_milliseconds| is recording delay value. |
- // |current_volume| is current microphone volume, in range of |0, 255]. |
- // |need_audio_processing| indicates if the audio needs WebRtc AEC/NS/AGC |
- // audio processing. |
- // The return value is the new microphone volume, in the range of |0, 255]. |
- // When the volume does not need to be updated, it returns 0. |
virtual int CaptureData(const std::vector<int>& channels, |
Henrik Grunell
2013/10/31 11:56:12
Why remove the description of some input parameter
|
const int16* audio_data, |
int sample_rate, |
@@ -233,6 +227,22 @@ class WebRtcAudioCapturerSink { |
virtual ~WebRtcAudioCapturerSink() {} |
}; |
+class WebRtcAudioRenderDataObserver { |
Henrik Grunell
2013/10/31 11:56:12
Add comment. See also next comment.
|
+ public: |
+ // Callback to get the mixed rendered data. |
+ virtual void OnRenderData(const int16* render_audio, |
+ int sample_rate, |
+ int number_of_channels, |
+ int number_of_frames, |
+ int render_delay_ms) = 0; |
+ |
+ // Callback to notify the observer the webrtc render object is closing. |
+ virtual void OnRenderClosing() = 0; |
+ |
+ protected: |
+ virtual ~WebRtcAudioRenderDataObserver() {} |
+}; |
+ |
// Note that this class inherits from webrtc::AudioDeviceModule but due to |
// the high number of non-implemented methods, we move the cruft over to the |
// WebRtcAudioDeviceNotImpl. |
@@ -305,6 +315,10 @@ class CONTENT_EXPORT WebRtcAudioDeviceImpl |
// Adds the capturer to the ADM. |
void AddAudioCapturer(const scoped_refptr<WebRtcAudioCapturer>& capturer); |
+ // Add/Remove the observer to get the mixed render data for AEC. |
Henrik Grunell
2013/10/31 11:56:12
I think the description "to get the mixed render d
|
+ void AddRenderDataObserver(WebRtcAudioRenderDataObserver* observer); |
+ void RemoveRenderDataObserver(WebRtcAudioRenderDataObserver* observer); |
+ |
// Gets the default capturer, which is the capturer in the list with |
// a valid |device_id|. Microphones are represented by capturers with a valid |
// |device_id|, since only one microphone is supported today, only one |
@@ -326,6 +340,7 @@ class CONTENT_EXPORT WebRtcAudioDeviceImpl |
private: |
typedef std::list<scoped_refptr<WebRtcAudioCapturer> > CapturerList; |
+ typedef std::list<WebRtcAudioRenderDataObserver* > RenderDataObservers; |
// Make destructor private to ensure that we can only be deleted by Release(). |
virtual ~WebRtcAudioDeviceImpl(); |
@@ -370,6 +385,8 @@ class CONTENT_EXPORT WebRtcAudioDeviceImpl |
// Provides access to the audio renderer in the browser process. |
scoped_refptr<WebRtcAudioRenderer> renderer_; |
+ RenderDataObservers render_data_observers_; |
+ |
// Weak reference to the audio callback. |
// The webrtc client defines |audio_transport_callback_| by calling |
// RegisterAudioCallback(). |