OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_device_impl.h" | 5 #include "content/renderer/media/webrtc_audio_device_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/win/windows_version.h" | 10 #include "base/win/windows_version.h" |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
241 return 0; | 241 return 0; |
242 | 242 |
243 StopRecording(); | 243 StopRecording(); |
244 StopPlayout(); | 244 StopPlayout(); |
245 | 245 |
246 DCHECK(!renderer_.get() || !renderer_->IsStarted()) | 246 DCHECK(!renderer_.get() || !renderer_->IsStarted()) |
247 << "The shared audio renderer shouldn't be running"; | 247 << "The shared audio renderer shouldn't be running"; |
248 | 248 |
249 DisableAecDump(); | 249 DisableAecDump(); |
250 | 250 |
251 capturers_.clear(); | 251 // Stop all the capturers to ensure no further OnData() and |
252 // RemoveAudioCapturer() callback. | |
253 // Cache the captures in a local list since WebRtcAudioCapturer::Stop() | |
henrika (OOO until Aug 14)
2014/06/03 11:00:15
capturers
no longer working on chromium
2014/06/03 11:31:14
Done.
| |
254 // will trigger RemoveAudioCapturer() callback. | |
255 CapturerList capturers; | |
256 capturers.swap(capturers_); | |
257 for (CapturerList::const_iterator iter = capturers.begin(); | |
258 iter != capturers.end(); ++iter) { | |
259 (*iter)->Stop(); | |
260 } | |
252 | 261 |
253 initialized_ = false; | 262 initialized_ = false; |
254 return 0; | 263 return 0; |
255 } | 264 } |
256 | 265 |
257 bool WebRtcAudioDeviceImpl::Initialized() const { | 266 bool WebRtcAudioDeviceImpl::Initialized() const { |
258 return initialized_; | 267 return initialized_; |
259 } | 268 } |
260 | 269 |
261 int32_t WebRtcAudioDeviceImpl::PlayoutIsAvailable(bool* available) { | 270 int32_t WebRtcAudioDeviceImpl::PlayoutIsAvailable(bool* available) { |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
552 | 561 |
553 // Start the Aec dump on the current default capturer. | 562 // Start the Aec dump on the current default capturer. |
554 scoped_refptr<WebRtcAudioCapturer> default_capturer(GetDefaultCapturer()); | 563 scoped_refptr<WebRtcAudioCapturer> default_capturer(GetDefaultCapturer()); |
555 if (!default_capturer) | 564 if (!default_capturer) |
556 return; | 565 return; |
557 | 566 |
558 default_capturer->StartAecDump(aec_dump_file_.Pass()); | 567 default_capturer->StartAecDump(aec_dump_file_.Pass()); |
559 } | 568 } |
560 | 569 |
561 } // namespace content | 570 } // namespace content |
OLD | NEW |