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/webaudio_capturer_source.h" | 5 #include "content/renderer/media/webaudio_capturer_source.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/renderer/media/webrtc_local_audio_source_provider.h" | 8 #include "content/renderer/media/webrtc_local_audio_source_provider.h" |
9 #include "content/renderer/media/webrtc_local_audio_track.h" | 9 #include "content/renderer/media/webrtc_local_audio_track.h" |
10 | 10 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 } | 78 } |
79 | 79 |
80 void WebAudioCapturerSource::Stop() { | 80 void WebAudioCapturerSource::Stop() { |
81 DCHECK(thread_checker_.CalledOnValidThread()); | 81 DCHECK(thread_checker_.CalledOnValidThread()); |
82 base::AutoLock auto_lock(lock_); | 82 base::AutoLock auto_lock(lock_); |
83 track_ = NULL; | 83 track_ = NULL; |
84 source_provider_ = NULL; | 84 source_provider_ = NULL; |
85 } | 85 } |
86 | 86 |
87 void WebAudioCapturerSource::consumeAudio( | 87 void WebAudioCapturerSource::consumeAudio( |
88 const WebKit::WebVector<const float*>& audio_data, | 88 const blink::WebVector<const float*>& audio_data, |
89 size_t number_of_frames) { | 89 size_t number_of_frames) { |
90 base::AutoLock auto_lock(lock_); | 90 base::AutoLock auto_lock(lock_); |
91 if (!track_) | 91 if (!track_) |
92 return; | 92 return; |
93 | 93 |
94 wrapper_bus_->set_frames(number_of_frames); | 94 wrapper_bus_->set_frames(number_of_frames); |
95 | 95 |
96 // Make sure WebKit is honoring what it told us up front | 96 // Make sure WebKit is honoring what it told us up front |
97 // about the channels. | 97 // about the channels. |
98 DCHECK_EQ(params_.channels(), static_cast<int>(audio_data.size())); | 98 DCHECK_EQ(params_.channels(), static_cast<int>(audio_data.size())); |
(...skipping 17 matching lines...) Expand all Loading... |
116 if (source_provider_) { | 116 if (source_provider_) { |
117 source_provider_->GetAudioProcessingParams( | 117 source_provider_->GetAudioProcessingParams( |
118 &delay_ms, &volume, &key_pressed); | 118 &delay_ms, &volume, &key_pressed); |
119 } | 119 } |
120 fifo_->Consume(capture_bus_.get(), 0, capture_frames); | 120 fifo_->Consume(capture_bus_.get(), 0, capture_frames); |
121 track_->Capture(capture_bus_.get(), delay_ms, volume, key_pressed); | 121 track_->Capture(capture_bus_.get(), delay_ms, volume, key_pressed); |
122 } | 122 } |
123 } | 123 } |
124 | 124 |
125 } // namespace content | 125 } // namespace content |
OLD | NEW |