OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // Reset action. | 140 // Reset action. |
141 *action = 0; | 141 *action = 0; |
142 | 142 |
143 // Is it time to pull audio? | 143 // Is it time to pull audio? |
144 if (time_to_playout_audio_ms_ == 0) { | 144 if (time_to_playout_audio_ms_ == 0) { |
145 time_to_playout_audio_ms_ = kPlayoutPeriodMs; | 145 time_to_playout_audio_ms_ = kPlayoutPeriodMs; |
146 bool muted; | 146 bool muted; |
147 receive_acm_->PlayoutData10Ms(static_cast<int>(FLAGS_output_fs_hz), | 147 receive_acm_->PlayoutData10Ms(static_cast<int>(FLAGS_output_fs_hz), |
148 &frame_, &muted); | 148 &frame_, &muted); |
149 ASSERT_FALSE(muted); | 149 ASSERT_FALSE(muted); |
150 fwrite(frame_.data_, sizeof(frame_.data_[0]), | 150 fwrite(frame_.data(), sizeof(*frame_.data()), |
151 frame_.samples_per_channel_ * frame_.num_channels_, pcm_out_fid_); | 151 frame_.samples_per_channel_ * frame_.num_channels_, pcm_out_fid_); |
152 *action |= kAudioPlayedOut; | 152 *action |= kAudioPlayedOut; |
153 } | 153 } |
154 | 154 |
155 // Is it time to push in next packet? | 155 // Is it time to push in next packet? |
156 if (time_to_insert_packet_ms_ <= .5) { | 156 if (time_to_insert_packet_ms_ <= .5) { |
157 *action |= kPacketPushedIn; | 157 *action |= kPacketPushedIn; |
158 | 158 |
159 // Update time-to-insert packet. | 159 // Update time-to-insert packet. |
160 uint32_t t = next_receive_ts_; | 160 uint32_t t = next_receive_ts_; |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 if (delay_log != NULL) { | 303 if (delay_log != NULL) { |
304 fprintf(delay_log, "%3d %3d\n", optimal_delay_ms, current_delay_ms); | 304 fprintf(delay_log, "%3d %3d\n", optimal_delay_ms, current_delay_ms); |
305 } | 305 } |
306 } | 306 } |
307 } | 307 } |
308 std::cout << std::endl; | 308 std::cout << std::endl; |
309 test.TearDown(); | 309 test.TearDown(); |
310 if (delay_log != NULL) | 310 if (delay_log != NULL) |
311 fclose(delay_log); | 311 fclose(delay_log); |
312 } | 312 } |
OLD | NEW |