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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 audio_transport_callback_->NeedMorePlayData(frames_per_10_ms, | 172 audio_transport_callback_->NeedMorePlayData(frames_per_10_ms, |
| 173 bytes_per_sample, | 173 bytes_per_sample, |
| 174 audio_bus->channels(), | 174 audio_bus->channels(), |
| 175 sample_rate, | 175 sample_rate, |
| 176 audio_data, | 176 audio_data, |
| 177 num_audio_frames, | 177 num_audio_frames, |
| 178 &elapsed_time_ms, | 178 &elapsed_time_ms, |
| 179 &ntp_time_ms); | 179 &ntp_time_ms); |
| 180 accumulated_audio_frames += num_audio_frames; | 180 accumulated_audio_frames += num_audio_frames; |
| 181 } | 181 } |
| 182 | 182 if (elapsed_time_ms >= 0) { |
| 183 renderer_->SetCurrentRenderTime( | |
|
no longer working on chromium
2014/06/10 16:21:38
this is on audio render thread.
Ronghua Wu (Left Chromium)
2014/06/10 17:01:07
Done.
| |
| 184 base::TimeDelta::FromMilliseconds(elapsed_time_ms)); | |
| 185 } | |
| 183 audio_data += bytes_per_10_ms; | 186 audio_data += bytes_per_10_ms; |
| 184 } | 187 } |
| 185 | 188 |
| 186 // De-interleave each channel and convert to 32-bit floating-point | 189 // De-interleave each channel and convert to 32-bit floating-point |
| 187 // with nominal range -1.0 -> +1.0 to match the callback format. | 190 // with nominal range -1.0 -> +1.0 to match the callback format. |
| 188 audio_bus->FromInterleaved(&render_buffer_[0], | 191 audio_bus->FromInterleaved(&render_buffer_[0], |
| 189 audio_bus->frames(), | 192 audio_bus->frames(), |
| 190 bytes_per_sample); | 193 bytes_per_sample); |
| 191 | 194 |
| 192 // Pass the render data to the playout sinks. | 195 // Pass the render data to the playout sinks. |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 559 | 562 |
| 560 // Start the Aec dump on the current default capturer. | 563 // Start the Aec dump on the current default capturer. |
| 561 scoped_refptr<WebRtcAudioCapturer> default_capturer(GetDefaultCapturer()); | 564 scoped_refptr<WebRtcAudioCapturer> default_capturer(GetDefaultCapturer()); |
| 562 if (!default_capturer) | 565 if (!default_capturer) |
| 563 return; | 566 return; |
| 564 | 567 |
| 565 default_capturer->StartAecDump(aec_dump_file_.Pass()); | 568 default_capturer->StartAecDump(aec_dump_file_.Pass()); |
| 566 } | 569 } |
| 567 | 570 |
| 568 } // namespace content | 571 } // namespace content |
| OLD | NEW |