Index: content/renderer/media/webrtc_audio_capturer.h |
diff --git a/content/renderer/media/webrtc_audio_capturer.h b/content/renderer/media/webrtc_audio_capturer.h |
index 370cfe509cb38336361628ee1dd1d1f30654c9b3..4fb0ec75dd19c70a2765dd3a3c5d23e35141c8c4 100644 |
--- a/content/renderer/media/webrtc_audio_capturer.h |
+++ b/content/renderer/media/webrtc_audio_capturer.h |
@@ -13,7 +13,6 @@ |
#include "base/synchronization/lock.h" |
#include "base/threading/thread_checker.h" |
#include "content/renderer/media/webrtc_audio_device_impl.h" |
-#include "content/renderer/media/webrtc_local_audio_source_provider.h" |
#include "media/audio/audio_input_device.h" |
#include "media/base/audio_capturer_source.h" |
@@ -68,11 +67,11 @@ class CONTENT_EXPORT WebRtcAudioCapturer |
// Called on the main render thread or libjingle working thread. |
void RemoveTrack(WebRtcLocalAudioTrack* track); |
- // SetCapturerSource() is called if the client on the source side desires to |
- // provide their own captured audio data. Client is responsible for calling |
- // Start() on its own source to have the ball rolling. |
+ // InitializeCapturerSource() is called if the client on the source side |
+ // desires to provide their own captured audio data. Client is responsible |
+ // for calling Start() on its own source to have the ball rolling. |
// Called on the main render thread. |
- void SetCapturerSource( |
+ void InitializeCapturerSource( |
const scoped_refptr<media::AudioCapturerSource>& source, |
media::ChannelLayout channel_layout, |
float sample_rate); |
@@ -111,13 +110,15 @@ class CONTENT_EXPORT WebRtcAudioCapturer |
const std::string& device_id() const { return device_id_; } |
int session_id() const { return session_id_; } |
- WebKit::WebAudioSourceProvider* audio_source_provider() const { |
- return source_provider_.get(); |
- } |
- |
// Stops recording audio. |
void Stop(); |
+ // Called by the WebAudioCapturerSource to get the audio processing params. |
+ // This function is triggered by provideInput() on the WebAudio audio thread, |
+ // so it has been under the protection of |lock_|. |
+ // TODO(xians): Remove after moving APM from WebRtc to Chrome. |
+ void GetAudioProcessingParams(int* delay_ms, int* volume, bool* key_pressed); |
+ |
protected: |
friend class base::RefCountedThreadSafe<WebRtcAudioCapturer>; |
WebRtcAudioCapturer(); |
@@ -144,8 +145,6 @@ class CONTENT_EXPORT WebRtcAudioCapturer |
// thread. It should NOT be called under |lock_|. |
void Start(); |
- |
- |
// Helper function to get the buffer size based on |peer_connection_mode_| |
// and sample rate; |
int GetBufferSize(int sample_rate) const; |
@@ -154,7 +153,7 @@ class CONTENT_EXPORT WebRtcAudioCapturer |
base::ThreadChecker thread_checker_; |
// Protects |source_|, |audio_tracks_|, |running_|, |loopback_fifo_|, |
- // |params_|, |buffering_| and |agc_is_enabled_|. |
+ // |source_params_|, |buffering_| and |agc_is_enabled_|. |
mutable base::Lock lock_; |
// A list of audio tracks that the audio data is fed to. |
@@ -188,18 +187,16 @@ class CONTENT_EXPORT WebRtcAudioCapturer |
// Range is [0, 255]. |
int volume_; |
- // The source provider to feed the capture data to other clients like |
- // WebAudio. |
- // TODO(xians): Move the source provider to track once we don't need to feed |
- // delay, volume, key_pressed information to WebAudioCapturerSource. |
- const scoped_ptr<WebRtcLocalAudioSourceProvider> source_provider_; |
- |
// Flag which affects the buffer size used by the capturer. |
bool peer_connection_mode_; |
int output_sample_rate_; |
int output_frames_per_buffer_; |
+ // Cache value for the audio processing params. |
+ int audio_delay_ms_; |
+ bool key_pressed_; |
+ |
DISALLOW_COPY_AND_ASSIGN(WebRtcAudioCapturer); |
}; |