| OLD | NEW |
| 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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 source = source_; | 410 source = source_; |
| 411 tracks = tracks_.Items(); | 411 tracks = tracks_.Items(); |
| 412 tracks_.Clear(); | 412 tracks_.Clear(); |
| 413 running_ = false; | 413 running_ = false; |
| 414 } | 414 } |
| 415 | 415 |
| 416 // Remove the capturer object from the WebRtcAudioDeviceImpl. | 416 // Remove the capturer object from the WebRtcAudioDeviceImpl. |
| 417 if (audio_device_) | 417 if (audio_device_) |
| 418 audio_device_->RemoveAudioCapturer(this); | 418 audio_device_->RemoveAudioCapturer(this); |
| 419 | 419 |
| 420 // Stop the Aec dump. | |
| 421 StopAecDump(); | |
| 422 | |
| 423 for (TrackList::ItemList::const_iterator it = tracks.begin(); | 420 for (TrackList::ItemList::const_iterator it = tracks.begin(); |
| 424 it != tracks.end(); | 421 it != tracks.end(); |
| 425 ++it) { | 422 ++it) { |
| 426 (*it)->Stop(); | 423 (*it)->Stop(); |
| 427 } | 424 } |
| 428 | 425 |
| 429 if (source.get()) | 426 if (source.get()) |
| 430 source->Stop(); | 427 source->Stop(); |
| 431 } | 428 } |
| 432 | 429 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 } | 605 } |
| 609 | 606 |
| 610 void WebRtcAudioCapturer::SetCapturerSourceForTesting( | 607 void WebRtcAudioCapturer::SetCapturerSourceForTesting( |
| 611 const scoped_refptr<media::AudioCapturerSource>& source, | 608 const scoped_refptr<media::AudioCapturerSource>& source, |
| 612 media::AudioParameters params) { | 609 media::AudioParameters params) { |
| 613 // Create a new audio stream as source which uses the new source. | 610 // Create a new audio stream as source which uses the new source. |
| 614 SetCapturerSource(source, params.channel_layout(), | 611 SetCapturerSource(source, params.channel_layout(), |
| 615 static_cast<float>(params.sample_rate())); | 612 static_cast<float>(params.sample_rate())); |
| 616 } | 613 } |
| 617 | 614 |
| 618 void WebRtcAudioCapturer::StartAecDump(base::File aec_dump_file) { | |
| 619 DCHECK(thread_checker_.CalledOnValidThread()); | |
| 620 DCHECK(aec_dump_file.IsValid()); | |
| 621 audio_processor_->StartAecDump(aec_dump_file.Pass()); | |
| 622 } | |
| 623 | |
| 624 void WebRtcAudioCapturer::StopAecDump() { | |
| 625 DCHECK(thread_checker_.CalledOnValidThread()); | |
| 626 audio_processor_->StopAecDump(); | |
| 627 } | |
| 628 | |
| 629 } // namespace content | 615 } // namespace content |
| OLD | NEW |