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

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: 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 81dec9130df16858a8e525190bb4c72f63d4515c..d42e22e18d83650f9cdb93e790e1d0d2e5758382 100644
--- a/content/renderer/media/media_stream_audio_processor.cc
+++ b/content/renderer/media/media_stream_audio_processor.cc
@@ -4,11 +4,13 @@
#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"
@@ -73,6 +75,20 @@ void RecordProcessingState(AudioTrackProcessingStates state) {
state, AUDIO_PROCESSING_MAX);
}
+bool isDelayAgnosticAecEnabled() {
+#if defined(OS_MACOSX)
perkj_chrome 2015/01/09 07:37:08 Are these if defs necessary? How about: base::Com
bjornv 2015/01/10 10:08:40 You have to acquire the Finch group name first, bu
+ const std::string group_name =
+ base::FieldTrialList::FindFullName("NoReportedDelayOnMac");
+#endif
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kEnableDelayAgnosticAec))
+ return true;
+#if defined(OS_MACOSX)
+ return (group_name == "Enabled");
+#else
+ return false;
+#endif
+}
} // namespace
// Wraps AudioBus to provide access to the array of channel pointers, since this
@@ -462,10 +478,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
// Create and configure the webrtc::AudioProcessing.
audio_processing_.reset(webrtc::AudioProcessing::Create(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