| 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/platform_file.h" | 9 #include "base/platform_file.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 for (PlayoutDataSinkList::const_iterator it = playout_sinks_.begin(); | 170 for (PlayoutDataSinkList::const_iterator it = playout_sinks_.begin(); |
| 171 it != playout_sinks_.end(); ++it) { | 171 it != playout_sinks_.end(); ++it) { |
| 172 (*it)->OnPlayoutData(audio_bus, sample_rate, audio_delay_milliseconds); | 172 (*it)->OnPlayoutData(audio_bus, sample_rate, audio_delay_milliseconds); |
| 173 } | 173 } |
| 174 } | 174 } |
| 175 | 175 |
| 176 void WebRtcAudioDeviceImpl::RemoveAudioRenderer(WebRtcAudioRenderer* renderer) { | 176 void WebRtcAudioDeviceImpl::RemoveAudioRenderer(WebRtcAudioRenderer* renderer) { |
| 177 DCHECK(thread_checker_.CalledOnValidThread()); | 177 DCHECK(thread_checker_.CalledOnValidThread()); |
| 178 DCHECK_EQ(renderer, renderer_); | 178 DCHECK_EQ(renderer, renderer_); |
| 179 base::AutoLock auto_lock(lock_); | 179 base::AutoLock auto_lock(lock_); |
| 180 // Notify the playout sink of the change. |
| 181 for (PlayoutDataSinkList::const_iterator it = playout_sinks_.begin(); |
| 182 it != playout_sinks_.end(); ++it) { |
| 183 (*it)->OnPlayoutDataSourceChanged(); |
| 184 } |
| 185 |
| 180 renderer_ = NULL; | 186 renderer_ = NULL; |
| 181 playing_ = false; | 187 playing_ = false; |
| 182 } | 188 } |
| 183 | 189 |
| 184 int32_t WebRtcAudioDeviceImpl::RegisterAudioCallback( | 190 int32_t WebRtcAudioDeviceImpl::RegisterAudioCallback( |
| 185 webrtc::AudioTransport* audio_callback) { | 191 webrtc::AudioTransport* audio_callback) { |
| 186 DVLOG(1) << "WebRtcAudioDeviceImpl::RegisterAudioCallback()"; | 192 DVLOG(1) << "WebRtcAudioDeviceImpl::RegisterAudioCallback()"; |
| 187 DCHECK(thread_checker_.CalledOnValidThread()); | 193 DCHECK(thread_checker_.CalledOnValidThread()); |
| 188 DCHECK_EQ(audio_transport_callback_ == NULL, audio_callback != NULL); | 194 DCHECK_EQ(audio_transport_callback_ == NULL, audio_callback != NULL); |
| 189 audio_transport_callback_ = audio_callback; | 195 audio_transport_callback_ = audio_callback; |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 return; | 539 return; |
| 534 | 540 |
| 535 default_capturer->StartAecDump(aec_dump_file_); | 541 default_capturer->StartAecDump(aec_dump_file_); |
| 536 | 542 |
| 537 // Invalidate the |aec_dump_file_| since the ownership of the file has been | 543 // Invalidate the |aec_dump_file_| since the ownership of the file has been |
| 538 // passed to WebRtc. | 544 // passed to WebRtc. |
| 539 aec_dump_file_ = base::kInvalidPlatformFileValue; | 545 aec_dump_file_ = base::kInvalidPlatformFileValue; |
| 540 } | 546 } |
| 541 | 547 |
| 542 } // namespace content | 548 } // namespace content |
| OLD | NEW |