Chromium Code Reviews| 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)); |