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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 return audio_bus->frames(); | 46 return audio_bus->frames(); |
47 } | 47 } |
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 int WebRtcLocalAudioRenderer::CaptureData(const std::vector<int>& channels, | 54 int WebRtcLocalAudioRenderer::CaptureData(const std::vector<int>& channels, |
55 const int16* audio_data, | 55 const int16* audio_data, |
56 int sample_rate, | 56 int sample_rate, |
57 int number_of_channels, | 57 int number_of_channels, |
58 int number_of_frames, | 58 int number_of_frames, |
59 int audio_delay_milliseconds, | 59 int audio_delay_milliseconds, |
60 int current_volume, | 60 int current_volume, |
61 bool need_audio_processing, | 61 bool need_audio_processing) { |
62 bool key_pressed) { | |
63 TRACE_EVENT0("audio", "WebRtcLocalAudioRenderer::CaptureData"); | 62 TRACE_EVENT0("audio", "WebRtcLocalAudioRenderer::CaptureData"); |
64 base::AutoLock auto_lock(thread_lock_); | 63 base::AutoLock auto_lock(thread_lock_); |
65 | 64 |
66 if (!playing_) | 65 if (!playing_) |
67 return 0; | 66 return 0; |
68 | 67 |
69 // Push captured audio to FIFO so it can be read by a local sink. | 68 // Push captured audio to FIFO so it can be read by a local sink. |
70 if (loopback_fifo_) { | 69 if (loopback_fifo_) { |
71 if (loopback_fifo_->frames() + number_of_frames <= | 70 if (loopback_fifo_->frames() + number_of_frames <= |
72 loopback_fifo_->max_frames()) { | 71 loopback_fifo_->max_frames()) { |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 if (!sink_.get()) | 239 if (!sink_.get()) |
241 return base::TimeDelta(); | 240 return base::TimeDelta(); |
242 return total_render_time(); | 241 return total_render_time(); |
243 } | 242 } |
244 | 243 |
245 bool WebRtcLocalAudioRenderer::IsLocalRenderer() const { | 244 bool WebRtcLocalAudioRenderer::IsLocalRenderer() const { |
246 return true; | 245 return true; |
247 } | 246 } |
248 | 247 |
249 } // namespace content | 248 } // namespace content |
OLD | NEW |