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 | |
186 renderer_ = NULL; | 180 renderer_ = NULL; |
187 playing_ = false; | 181 playing_ = false; |
188 } | 182 } |
189 | 183 |
190 int32_t WebRtcAudioDeviceImpl::RegisterAudioCallback( | 184 int32_t WebRtcAudioDeviceImpl::RegisterAudioCallback( |
191 webrtc::AudioTransport* audio_callback) { | 185 webrtc::AudioTransport* audio_callback) { |
192 DVLOG(1) << "WebRtcAudioDeviceImpl::RegisterAudioCallback()"; | 186 DVLOG(1) << "WebRtcAudioDeviceImpl::RegisterAudioCallback()"; |
193 DCHECK(thread_checker_.CalledOnValidThread()); | 187 DCHECK(thread_checker_.CalledOnValidThread()); |
194 DCHECK_EQ(audio_transport_callback_ == NULL, audio_callback != NULL); | 188 DCHECK_EQ(audio_transport_callback_ == NULL, audio_callback != NULL); |
195 audio_transport_callback_ = audio_callback; | 189 audio_transport_callback_ = audio_callback; |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 return; | 533 return; |
540 | 534 |
541 default_capturer->StartAecDump(aec_dump_file_); | 535 default_capturer->StartAecDump(aec_dump_file_); |
542 | 536 |
543 // Invalidate the |aec_dump_file_| since the ownership of the file has been | 537 // Invalidate the |aec_dump_file_| since the ownership of the file has been |
544 // passed to WebRtc. | 538 // passed to WebRtc. |
545 aec_dump_file_ = base::kInvalidPlatformFileValue; | 539 aec_dump_file_ = base::kInvalidPlatformFileValue; |
546 } | 540 } |
547 | 541 |
548 } // namespace content | 542 } // namespace content |
OLD | NEW |