Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1568)

Unified Diff: content/renderer/media/webrtc_local_audio_track.cc

Issue 24742007: When an audio track is disabled, still pass the data to webrtc for audio processing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webrtc_local_audio_track.cc
diff --git a/content/renderer/media/webrtc_local_audio_track.cc b/content/renderer/media/webrtc_local_audio_track.cc
index 37846335e8531270c5c6c66658c400137b82bcf4..c79757613fe192636f2048435f11b35c1414068e 100644
--- a/content/renderer/media/webrtc_local_audio_track.cc
+++ b/content/renderer/media/webrtc_local_audio_track.cc
@@ -156,12 +156,6 @@ void WebRtcLocalAudioTrack::Capture(media::AudioBus* audio_source,
scoped_refptr<ConfiguredBuffer> current_buffer;
{
base::AutoLock auto_lock(lock_);
- // When the track is disabled, we simply return here.
- // TODO(xians): Figure out if we should feed zero to sinks instead, in
- // order to inject VAD data in such case.
- if (!enabled())
- return;
-
capturer = capturer_;
voe_channels = voe_channels_;
current_buffer = buffer_;
@@ -173,13 +167,17 @@ void WebRtcLocalAudioTrack::Capture(media::AudioBus* audio_source,
// Push the data to the fifo.
current_buffer->Push(audio_source);
- // Only turn off the audio processing when the constrain is set to false as
+ // Only turn off the audio processing when the constraint is set to false as
// well as there is no correct delay value.
bool need_audio_processing = need_audio_processing_ ?
need_audio_processing_ : (audio_delay_milliseconds != 0);
int current_volume = volume;
while (current_buffer->Consume()) {
// Feed the data to the sinks.
+ // TODO (jiayl): we should not pass the real audio data down if the track is
+ // disabled. This is currently done so to feed input to WebRTC typing
+ // detection and should be changed when audio processing is moved from
+ // WebRTC to the track.
for (SinkList::const_iterator it = sinks.begin(); it != sinks.end(); ++it) {
int new_volume = (*it)->CaptureData(voe_channels,
current_buffer->buffer(),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698