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

Side by Side Diff: content/renderer/media/webrtc_audio_capturer.cc

Issue 190643003: Fix/Add content_unittests to work for the code behind --enable-audio-track-processing (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: ready for review 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/webrtc_audio_capturer.h" 5 #include "content/renderer/media/webrtc_audio_capturer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 audio_delay = base::TimeDelta::FromMilliseconds(audio_delay_milliseconds); 457 audio_delay = base::TimeDelta::FromMilliseconds(audio_delay_milliseconds);
458 audio_delay_ = audio_delay; 458 audio_delay_ = audio_delay;
459 key_pressed_ = key_pressed; 459 key_pressed_ = key_pressed;
460 tracks = tracks_.Items(); 460 tracks = tracks_.Items();
461 tracks_.RetrieveAndClearTags(&tracks_to_notify_format); 461 tracks_.RetrieveAndClearTags(&tracks_to_notify_format);
462 462
463 // Set the flag to turn on the audio processing in PeerConnection level. 463 // Set the flag to turn on the audio processing in PeerConnection level.
464 // Note that, we turn off the audio processing in PeerConnection if the 464 // Note that, we turn off the audio processing in PeerConnection if the
465 // processor has already processed the data. 465 // processor has already processed the data.
466 need_audio_processing = need_audio_processing_ ? 466 need_audio_processing = need_audio_processing_ ?
467 !audio_processor_->has_audio_processing() : false; 467 !audio_processor_->IsAudioTrackProcessingEnabled() : false;
tommi (sloooow) - chröme 2014/03/11 13:30:58 This isn't the same behavior as before. IsAudioTr
no longer working on chromium 2014/03/11 14:34:44 Yes. When the command line flag is on, |need_audi
468 } 468 }
469 469
470 DCHECK(audio_processor_->InputFormat().IsValid()); 470 DCHECK(audio_processor_->InputFormat().IsValid());
471 DCHECK_EQ(audio_source->channels(), 471 DCHECK_EQ(audio_source->channels(),
472 audio_processor_->InputFormat().channels()); 472 audio_processor_->InputFormat().channels());
473 DCHECK_EQ(audio_source->frames(), 473 DCHECK_EQ(audio_source->frames(),
474 audio_processor_->InputFormat().frames_per_buffer()); 474 audio_processor_->InputFormat().frames_per_buffer());
475 475
476 // Notify the tracks on when the format changes. This will do nothing if 476 // Notify the tracks on when the format changes. This will do nothing if
477 // |tracks_to_notify_format| is empty. 477 // |tracks_to_notify_format| is empty.
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 DCHECK_NE(aec_dump_file, base::kInvalidPlatformFileValue); 580 DCHECK_NE(aec_dump_file, base::kInvalidPlatformFileValue);
581 audio_processor_->StartAecDump(aec_dump_file); 581 audio_processor_->StartAecDump(aec_dump_file);
582 } 582 }
583 583
584 void WebRtcAudioCapturer::StopAecDump() { 584 void WebRtcAudioCapturer::StopAecDump() {
585 DCHECK(thread_checker_.CalledOnValidThread()); 585 DCHECK(thread_checker_.CalledOnValidThread());
586 audio_processor_->StopAecDump(); 586 audio_processor_->StopAecDump();
587 } 587 }
588 588
589 } // namespace content 589 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698