diff options
author | xians@chromium.org <xians@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-15 22:22:15 +0000 |
---|---|---|
committer | xians@chromium.org <xians@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-15 22:22:15 +0000 |
commit | 2f5cfc90659aae2fe624243498184ceb71ad0510 (patch) | |
tree | 47e363656498e6c315b95a792562c19864901184 /content/renderer/media/webrtc_local_audio_track.h | |
parent | 953e5c6f1a5b950476314f41f761fef497157cab (diff) | |
download | chromium_src-2f5cfc90659aae2fe624243498184ceb71ad0510.zip chromium_src-2f5cfc90659aae2fe624243498184ceb71ad0510.tar.gz chromium_src-2f5cfc90659aae2fe624243498184ceb71ad0510.tar.bz2 |
Wire up the MediaStreamAudioProcessor with the WebRtcAudioCapturer.
This CL is a follow up to https://codereview.chromium.org/88513002, which is hooking up the MediaStreamAudioProcessor to the production code. With this CL, we move the audio processing from WebRtc to Chrome behind a flag.
When chrome is launched with flag enable-audio-track-processing, the audio processing in happening in the WebRtcAudioCapturer, otherwise it will be in WebRtc, which is the same as without this CL.
Theoretically, we should be able to apply different constraints on different audio tracks, that means there can be multiple audio processors with different configurations for different tracks. But this can't be done before we completely move the audio processing to Chrome. So this CL has only one processor in the WebRtcAudioCapturer. Note that this is not a regression since our code has been behaving like this before this CL.
BUG=264611
TEST= content_unittest && ./chrome --enable-audio-track-processing works with audio processing.
Review URL: https://codereview.chromium.org/112203004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244992 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/media/webrtc_local_audio_track.h')
-rw-r--r-- | content/renderer/media/webrtc_local_audio_track.h | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/content/renderer/media/webrtc_local_audio_track.h b/content/renderer/media/webrtc_local_audio_track.h index 0ad463b..53444ec 100644 --- a/content/renderer/media/webrtc_local_audio_track.h +++ b/content/renderer/media/webrtc_local_audio_track.h @@ -14,7 +14,6 @@ #include "content/renderer/media/tagged_list.h" #include "content/renderer/media/webrtc_audio_device_impl.h" #include "content/renderer/media/webrtc_local_audio_source_provider.h" -#include "third_party/libjingle/source/talk/app/webrtc/mediaconstraintsinterface.h" #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" #include "third_party/libjingle/source/talk/app/webrtc/mediastreamtrack.h" #include "third_party/libjingle/source/talk/media/base/audiorenderer.h" @@ -49,8 +48,7 @@ class CONTENT_EXPORT WebRtcLocalAudioTrack const std::string& id, const scoped_refptr<WebRtcAudioCapturer>& capturer, WebAudioCapturerSource* webaudio_source, - webrtc::AudioSourceInterface* track_source, - const webrtc::MediaConstraintsInterface* constraints); + webrtc::AudioSourceInterface* track_source); // Add a sink to the track. This function will trigger a OnSetFormat() // call on the |sink|. @@ -77,10 +75,11 @@ class CONTENT_EXPORT WebRtcLocalAudioTrack // Method called by the capturer to deliver the capture data. // Call on the capture audio thread. - void Capture(media::AudioBus* audio_source, - int audio_delay_milliseconds, + void Capture(const int16* audio_data, + base::TimeDelta delay, int volume, - bool key_pressed); + bool key_pressed, + bool need_audio_processing); // Method called by the capturer to set the audio parameters used by source // of the capture data.. @@ -96,8 +95,7 @@ class CONTENT_EXPORT WebRtcLocalAudioTrack const std::string& label, const scoped_refptr<WebRtcAudioCapturer>& capturer, WebAudioCapturerSource* webaudio_source, - webrtc::AudioSourceInterface* track_source, - const webrtc::MediaConstraintsInterface* constraints); + webrtc::AudioSourceInterface* track_source); virtual ~WebRtcLocalAudioTrack(); @@ -144,12 +142,9 @@ class CONTENT_EXPORT WebRtcLocalAudioTrack // A vector of WebRtc VoE channels that the capturer sends data to. std::vector<int> voe_channels_; - bool need_audio_processing_; - - // Buffers used for temporary storage during capture callbacks. - // Allocated and accessed only on the capture audio thread. - class ConfiguredBuffer; - scoped_ptr<ConfiguredBuffer> buffer_; + // Audio parameters of the audio capture stream. + // Accessed on only the audio capture thread. + media::AudioParameters audio_parameters_; // The source provider to feed the track data to other clients like // WebAudio. |