| 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/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 void WebRtcLocalAudioRenderer::OnRenderError() { | 49 void WebRtcLocalAudioRenderer::OnRenderError() { |
| 50 NOTIMPLEMENTED(); | 50 NOTIMPLEMENTED(); |
| 51 } | 51 } |
| 52 | 52 |
| 53 // content::WebRtcAudioCapturerSink implementation | 53 // content::WebRtcAudioCapturerSink implementation |
| 54 void WebRtcLocalAudioRenderer::CaptureData(const int16* audio_data, | 54 void WebRtcLocalAudioRenderer::CaptureData(const int16* audio_data, |
| 55 int number_of_channels, | 55 int number_of_channels, |
| 56 int number_of_frames, | 56 int number_of_frames, |
| 57 int audio_delay_milliseconds, | 57 int audio_delay_milliseconds, |
| 58 double volume) { | 58 double volume, |
| 59 bool key_pressed) { |
| 59 TRACE_EVENT0("audio", "WebRtcLocalAudioRenderer::CaptureData"); | 60 TRACE_EVENT0("audio", "WebRtcLocalAudioRenderer::CaptureData"); |
| 60 base::AutoLock auto_lock(thread_lock_); | 61 base::AutoLock auto_lock(thread_lock_); |
| 61 | 62 |
| 62 if (!playing_) | 63 if (!playing_) |
| 63 return; | 64 return; |
| 64 | 65 |
| 65 // Push captured audio to FIFO so it can be read by a local sink. | 66 // Push captured audio to FIFO so it can be read by a local sink. |
| 66 if (loopback_fifo_) { | 67 if (loopback_fifo_) { |
| 67 if (loopback_fifo_->frames() + number_of_frames <= | 68 if (loopback_fifo_->frames() + number_of_frames <= |
| 68 loopback_fifo_->max_frames()) { | 69 loopback_fifo_->max_frames()) { |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 if (!sink_.get()) | 235 if (!sink_.get()) |
| 235 return base::TimeDelta(); | 236 return base::TimeDelta(); |
| 236 return total_render_time(); | 237 return total_render_time(); |
| 237 } | 238 } |
| 238 | 239 |
| 239 bool WebRtcLocalAudioRenderer::IsLocalRenderer() const { | 240 bool WebRtcLocalAudioRenderer::IsLocalRenderer() const { |
| 240 return true; | 241 return true; |
| 241 } | 242 } |
| 242 | 243 |
| 243 } // namespace content | 244 } // namespace content |
| OLD | NEW |