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

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

Issue 334743006: Support multiple files for AEC dump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase again... Created 6 years, 6 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/renderer/media/webrtc_audio_device_impl.h ('k') | content/renderer/render_thread_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webrtc_audio_device_impl.cc
diff --git a/content/renderer/media/webrtc_audio_device_impl.cc b/content/renderer/media/webrtc_audio_device_impl.cc
index 293ff36c15cc52bb58e0edc8c0f0ae7ef91255a0..1339a6f4cb80161efb228271aaad2830eecec5ff 100644
--- a/content/renderer/media/webrtc_audio_device_impl.cc
+++ b/content/renderer/media/webrtc_audio_device_impl.cc
@@ -249,8 +249,6 @@ int32_t WebRtcAudioDeviceImpl::Terminate() {
DCHECK(!renderer_.get() || !renderer_->IsStarted())
<< "The shared audio renderer shouldn't be running";
- DisableAecDump();
-
// Stop all the capturers to ensure no further OnData() and
// RemoveAudioCapturer() callback.
// Cache the capturers in a local list since WebRtcAudioCapturer::Stop()
@@ -477,11 +475,6 @@ void WebRtcAudioDeviceImpl::AddAudioCapturer(
capturers_.end());
capturers_.push_back(capturer);
}
-
- // Start the Aec dump if the Aec dump has been enabled and has not been
- // started.
- if (aec_dump_file_.IsValid())
- MaybeStartAecDump();
}
void WebRtcAudioDeviceImpl::RemoveAudioCapturer(
@@ -533,48 +526,4 @@ bool WebRtcAudioDeviceImpl::GetAuthorizedDeviceInfoForAudioRenderer(
session_id, output_sample_rate, output_frames_per_buffer);
}
-void WebRtcAudioDeviceImpl::EnableAecDump(base::File aec_dump_file) {
- DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK(aec_dump_file.IsValid());
-
- // Close the previous AEC dump file description if it has not been consumed.
- // This can happen if no getUserMedia has been made yet.
- // TODO(xians): DCHECK(!aec_dump_file_.IsValid()) after the browser
- // guarantees it won't call EnableAecDump() more than once in a row.
- if (aec_dump_file_.IsValid())
- aec_dump_file_.Close();
-
- aec_dump_file_ = aec_dump_file.Pass();
- MaybeStartAecDump();
-}
-
-void WebRtcAudioDeviceImpl::DisableAecDump() {
- DCHECK(thread_checker_.CalledOnValidThread());
- // Simply invalidate the |aec_dump_file_| if we have not pass the ownership
- // to WebRtc.
- if (aec_dump_file_.IsValid()) {
- aec_dump_file_.Close();
- return;
- }
-
- // We might have call StartAecDump() on one of the capturer. Loop
- // through all the capturers and call StopAecDump() on each of them.
- for (CapturerList::const_iterator iter = capturers_.begin();
- iter != capturers_.end(); ++iter) {
- (*iter)->StopAecDump();
- }
-}
-
-void WebRtcAudioDeviceImpl::MaybeStartAecDump() {
- DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK(aec_dump_file_.IsValid());
-
- // Start the Aec dump on the current default capturer.
- scoped_refptr<WebRtcAudioCapturer> default_capturer(GetDefaultCapturer());
- if (!default_capturer)
- return;
-
- default_capturer->StartAecDump(aec_dump_file_.Pass());
-}
-
} // namespace content
« no previous file with comments | « content/renderer/media/webrtc_audio_device_impl.h ('k') | content/renderer/render_thread_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698