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

Unified Diff: trunk/src/content/renderer/media/webrtc_audio_capturer.cc

Issue 148213002: Revert 246905 "Revert 246894 "Wire up AGC to the MediaStreamAudi..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 11 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 | « trunk/src/content/renderer/media/media_stream_audio_processor_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/content/renderer/media/webrtc_audio_capturer.cc
===================================================================
--- trunk/src/content/renderer/media/webrtc_audio_capturer.cc (revision 247207)
+++ trunk/src/content/renderer/media/webrtc_audio_capturer.cc (working copy)
@@ -478,16 +478,22 @@
// Process and consume the data in the processor until there is not enough
// data in the processor.
int16* output = NULL;
+ int new_volume = 0;
while (audio_processor->ProcessAndConsumeData(
- audio_delay, current_volume, key_pressed, &output)) {
+ audio_delay, current_volume, key_pressed, &new_volume, &output)) {
// Feed the post-processed data to the tracks.
for (TrackList::ItemList::const_iterator it = tracks.begin();
it != tracks.end(); ++it) {
(*it)->Capture(output, audio_delay, current_volume, key_pressed,
need_audio_processing);
}
- // TODO(xians): Apply the new volume after AGC is working with the
- // MediaStreamAudioProcessor.
+
+ if (new_volume) {
+ SetVolume(new_volume);
+
+ // Update the |current_volume| to avoid passing the old volume to AGC.
+ current_volume = new_volume;
+ }
}
}
« no previous file with comments | « trunk/src/content/renderer/media/media_stream_audio_processor_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698