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

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

Issue 795793003: Added a chrome flag to enable Delay Agnostic AEC in WebRTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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 | « content/public/common/content_switches.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_stream_audio_processor.cc
diff --git a/content/renderer/media/media_stream_audio_processor.cc b/content/renderer/media/media_stream_audio_processor.cc
index 7e3f08d45b1c3c4bb3f8a3a5e50b93ee1bc5330d..a4067ac4c166ca56f594a089a367bc81a527d558 100644
--- a/content/renderer/media/media_stream_audio_processor.cc
+++ b/content/renderer/media/media_stream_audio_processor.cc
@@ -4,11 +4,11 @@
#include "content/renderer/media/media_stream_audio_processor.h"
+#include "base/command_line.h"
#include "base/debug/trace_event.h"
-#if defined(OS_MACOSX)
#include "base/metrics/field_trial.h"
-#endif
#include "base/metrics/histogram.h"
+#include "content/public/common/content_switches.h"
#include "content/renderer/media/media_stream_audio_processor_options.h"
#include "content/renderer/media/rtc_media_constraints.h"
#include "content/renderer/media/webrtc_audio_device_impl.h"
@@ -77,6 +77,17 @@ void RecordProcessingState(AudioTrackProcessingStates state) {
state, AUDIO_PROCESSING_MAX);
}
+bool isDelayAgnosticAecEnabled() {
+ // Note: It's important to query the field trial state first, to ensure that
+ // UMA reports the correct group.
+ const std::string group_name =
+ base::FieldTrialList::FindFullName("NoReportedDelayOnMac");
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kEnableDelayAgnosticAec))
+ return true;
+
+ return (!group_name.empty() && group_name == "Enabled");
+}
} // namespace
// Wraps AudioBus to provide access to the array of channel pointers, since this
@@ -468,10 +479,8 @@ void MediaStreamAudioProcessor::InitializeAudioProcessingModule(
config.Set<webrtc::DelayCorrection>(new webrtc::DelayCorrection(true));
if (goog_experimental_ns)
config.Set<webrtc::ExperimentalNs>(new webrtc::ExperimentalNs(true));
-#if defined(OS_MACOSX)
- if (base::FieldTrialList::FindFullName("NoReportedDelayOnMac") == "Enabled")
+ if (isDelayAgnosticAecEnabled())
config.Set<webrtc::ReportedDelay>(new webrtc::ReportedDelay(false));
-#endif
if (goog_beamforming) {
ConfigureBeamforming(&config);
}
« no previous file with comments | « content/public/common/content_switches.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698