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

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

Issue 190713004: Only turn on the audio processing by default for MEDIA_DEVICE_AUDIO_CAPTURE (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: unittest Created 6 years, 9 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
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 a80207acc344d4f98a6d9967fb485a8e67851606..ef693b241cee6b352a6c28efe5ba97d58cacd7a6 100644
--- a/content/renderer/media/media_stream_audio_processor.cc
+++ b/content/renderer/media/media_stream_audio_processor.cc
@@ -142,6 +142,7 @@ class MediaStreamAudioProcessor::MediaStreamAudioConverter
MediaStreamAudioProcessor::MediaStreamAudioProcessor(
const blink::WebMediaConstraints& constraints,
int effects,
+ MediaStreamType type,
WebRtcPlayoutDataSource* playout_data_source)
: render_delay_ms_(0),
playout_data_source_(playout_data_source),
@@ -149,7 +150,7 @@ MediaStreamAudioProcessor::MediaStreamAudioProcessor(
typing_detected_(false) {
capture_thread_checker_.DetachFromThread();
render_thread_checker_.DetachFromThread();
- InitializeAudioProcessingModule(constraints, effects);
+ InitializeAudioProcessingModule(constraints, effects, type);
}
MediaStreamAudioProcessor::~MediaStreamAudioProcessor() {
@@ -260,7 +261,8 @@ void MediaStreamAudioProcessor::GetStats(AudioProcessorStats* stats) {
}
void MediaStreamAudioProcessor::InitializeAudioProcessingModule(
- const blink::WebMediaConstraints& constraints, int effects) {
+ const blink::WebMediaConstraints& constraints, int effects,
+ MediaStreamType type) {
DCHECK(!audio_processing_);
if (!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableAudioTrackProcessing)) {
@@ -268,7 +270,12 @@ void MediaStreamAudioProcessor::InitializeAudioProcessingModule(
}
RTCMediaConstraints native_constraints(constraints);
- ApplyFixedAudioConstraints(&native_constraints);
+
+ // Only apply the fixed constraints for gUM of MEDIA_DEVICE_AUDIO_CAPTURE.
+ DCHECK(IsAudioMediaType(type));
+ if (type == MEDIA_DEVICE_AUDIO_CAPTURE)
+ ApplyFixedAudioConstraints(&native_constraints);
+
if (effects & media::AudioParameters::ECHO_CANCELLER) {
// If platform echo canceller is enabled, disable the software AEC.
native_constraints.AddMandatory(
« no previous file with comments | « content/renderer/media/media_stream_audio_processor.h ('k') | content/renderer/media/media_stream_audio_processor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698