| 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_local_audio_renderer.h" | 5 #include "content/renderer/media/webrtc_local_audio_renderer.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 DVLOG(1) << "FIFO is full"; | 78 DVLOG(1) << "FIFO is full"; |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 | 82 |
| 83 void WebRtcLocalAudioRenderer::SetCaptureFormat( | 83 void WebRtcLocalAudioRenderer::SetCaptureFormat( |
| 84 const media::AudioParameters& params) { | 84 const media::AudioParameters& params) { |
| 85 NOTIMPLEMENTED() << "WebRtcLocalAudioRenderer::SetCaptureFormat()"; | 85 NOTIMPLEMENTED() << "WebRtcLocalAudioRenderer::SetCaptureFormat()"; |
| 86 } | 86 } |
| 87 | 87 |
| 88 void WebRtcLocalAudioRenderer::OnCaptureDeviceStopped() { | |
| 89 DVLOG(1) << "WebRtcLocalAudioRenderer::OnCaptureDeviceStopped()"; | |
| 90 DCHECK(thread_checker_.CalledOnValidThread()); | |
| 91 { | |
| 92 base::AutoLock auto_lock(thread_lock_); | |
| 93 if (!sink_) | |
| 94 return; | |
| 95 | |
| 96 if (loopback_fifo_) | |
| 97 loopback_fifo_->Clear(); | |
| 98 } | |
| 99 | |
| 100 // The capture device has stopped and we should therefore stop all activity | |
| 101 // as well to save resources. | |
| 102 Stop(); | |
| 103 } | |
| 104 | |
| 105 // webrtc::ObserverInterface implementation | 88 // webrtc::ObserverInterface implementation |
| 106 void WebRtcLocalAudioRenderer::OnChanged() { | 89 void WebRtcLocalAudioRenderer::OnChanged() { |
| 107 DVLOG(1) << "WebRtcLocalAudioRenderer::OnChanged()"; | 90 DVLOG(1) << "WebRtcLocalAudioRenderer::OnChanged()"; |
| 108 DCHECK(thread_checker_.CalledOnValidThread()); | 91 DCHECK(thread_checker_.CalledOnValidThread()); |
| 109 base::AutoLock auto_lock(thread_lock_); | 92 base::AutoLock auto_lock(thread_lock_); |
| 110 track_is_enabled_ = audio_track_->enabled(); | 93 track_is_enabled_ = audio_track_->enabled(); |
| 111 } | 94 } |
| 112 | 95 |
| 113 // WebRtcLocalAudioRenderer::WebRtcLocalAudioRenderer implementation. | 96 // WebRtcLocalAudioRenderer::WebRtcLocalAudioRenderer implementation. |
| 114 WebRtcLocalAudioRenderer::WebRtcLocalAudioRenderer( | 97 WebRtcLocalAudioRenderer::WebRtcLocalAudioRenderer( |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 if (!sink_) | 248 if (!sink_) |
| 266 return base::TimeDelta(); | 249 return base::TimeDelta(); |
| 267 return total_render_time(); | 250 return total_render_time(); |
| 268 } | 251 } |
| 269 | 252 |
| 270 bool WebRtcLocalAudioRenderer::IsLocalRenderer() const { | 253 bool WebRtcLocalAudioRenderer::IsLocalRenderer() const { |
| 271 return true; | 254 return true; |
| 272 } | 255 } |
| 273 | 256 |
| 274 } // namespace content | 257 } // namespace content |
| OLD | NEW |