Chromium Code Reviews| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 168 for (PlayoutDataSinkList::const_iterator it = playout_sinks_.begin(); | 168 for (PlayoutDataSinkList::const_iterator it = playout_sinks_.begin(); |
| 169 it != playout_sinks_.end(); ++it) { | 169 it != playout_sinks_.end(); ++it) { |
| 170 (*it)->OnPlayoutData(audio_bus, sample_rate, audio_delay_milliseconds); | 170 (*it)->OnPlayoutData(audio_bus, sample_rate, audio_delay_milliseconds); |
| 171 } | 171 } |
| 172 } | 172 } |
| 173 | 173 |
| 174 void WebRtcAudioDeviceImpl::RemoveAudioRenderer(WebRtcAudioRenderer* renderer) { | 174 void WebRtcAudioDeviceImpl::RemoveAudioRenderer(WebRtcAudioRenderer* renderer) { |
| 175 DCHECK(thread_checker_.CalledOnValidThread()); | 175 DCHECK(thread_checker_.CalledOnValidThread()); |
| 176 DCHECK_EQ(renderer, renderer_); | 176 DCHECK_EQ(renderer, renderer_); |
| 177 base::AutoLock auto_lock(lock_); | 177 base::AutoLock auto_lock(lock_); |
| 178 // Notify the playout sink on the change. | |
|
tommi (sloooow) - chröme
2014/03/04 20:48:39
s/on/of
no longer working on chromium
2014/03/05 13:01:04
Done.
| |
| 179 for (PlayoutDataSinkList::const_iterator it = playout_sinks_.begin(); | |
| 180 it != playout_sinks_.end(); ++it) { | |
|
tommi (sloooow) - chröme
2014/03/04 20:48:39
indent
no longer working on chromium
2014/03/05 13:01:04
Done.
| |
| 181 (*it)->OnPlayoutDataSourceChanged(); | |
| 182 } | |
| 183 | |
| 178 renderer_ = NULL; | 184 renderer_ = NULL; |
| 179 playing_ = false; | 185 playing_ = false; |
| 180 } | 186 } |
| 181 | 187 |
| 182 int32_t WebRtcAudioDeviceImpl::RegisterAudioCallback( | 188 int32_t WebRtcAudioDeviceImpl::RegisterAudioCallback( |
| 183 webrtc::AudioTransport* audio_callback) { | 189 webrtc::AudioTransport* audio_callback) { |
| 184 DVLOG(1) << "WebRtcAudioDeviceImpl::RegisterAudioCallback()"; | 190 DVLOG(1) << "WebRtcAudioDeviceImpl::RegisterAudioCallback()"; |
| 185 DCHECK(thread_checker_.CalledOnValidThread()); | 191 DCHECK(thread_checker_.CalledOnValidThread()); |
| 186 DCHECK_EQ(audio_transport_callback_ == NULL, audio_callback != NULL); | 192 DCHECK_EQ(audio_transport_callback_ == NULL, audio_callback != NULL); |
| 187 audio_transport_callback_ = audio_callback; | 193 audio_transport_callback_ = audio_callback; |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 479 // If there is no capturer or there are more than one open capture devices, | 485 // If there is no capturer or there are more than one open capture devices, |
| 480 // return false. | 486 // return false. |
| 481 if (capturers_.empty() || capturers_.size() > 1) | 487 if (capturers_.empty() || capturers_.size() > 1) |
| 482 return false; | 488 return false; |
| 483 | 489 |
| 484 return GetDefaultCapturer()->GetPairedOutputParameters( | 490 return GetDefaultCapturer()->GetPairedOutputParameters( |
| 485 session_id, output_sample_rate, output_frames_per_buffer); | 491 session_id, output_sample_rate, output_frames_per_buffer); |
| 486 } | 492 } |
| 487 | 493 |
| 488 } // namespace content | 494 } // namespace content |
| OLD | NEW |