OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 bool SendRtcp(const uint8_t* packet, size_t length) override { | 192 bool SendRtcp(const uint8_t* packet, size_t length) override { |
193 return transport_->SendRtcp(packet, length); | 193 return transport_->SendRtcp(packet, length); |
194 } | 194 } |
195 | 195 |
196 void EncodedFrameCallback(const EncodedFrame& frame) override { | 196 void EncodedFrameCallback(const EncodedFrame& frame) override { |
197 rtc::CritScope lock(&comparison_lock_); | 197 rtc::CritScope lock(&comparison_lock_); |
198 if (frames_recorded_ < frames_to_process_) | 198 if (frames_recorded_ < frames_to_process_) |
199 encoded_frame_size_.AddSample(frame.length_); | 199 encoded_frame_size_.AddSample(frame.length_); |
200 } | 200 } |
201 | 201 |
202 void RenderFrame(const VideoFrame& video_frame, | 202 void OnFrame(const VideoFrame& video_frame) override { |
203 int time_to_render_ms) override { | |
204 int64_t render_time_ms = | 203 int64_t render_time_ms = |
205 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); | 204 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); |
206 | 205 |
207 rtc::CritScope lock(&crit_); | 206 rtc::CritScope lock(&crit_); |
208 uint32_t send_timestamp = | 207 uint32_t send_timestamp = |
209 wrap_handler_.Unwrap(video_frame.timestamp() - rtp_timestamp_delta_); | 208 wrap_handler_.Unwrap(video_frame.timestamp() - rtp_timestamp_delta_); |
210 | 209 |
211 while (wrap_handler_.Unwrap(frames_.front().timestamp()) < send_timestamp) { | 210 while (wrap_handler_.Unwrap(frames_.front().timestamp()) < send_timestamp) { |
212 if (last_rendered_frame_.IsZeroSize()) { | 211 if (last_rendered_frame_.IsZeroSize()) { |
213 // No previous frame rendered, this one was dropped after sending but | 212 // No previous frame rendered, this one was dropped after sending but |
(...skipping 19 matching lines...) Expand all Loading... |
233 // Look at RTPSender::BuildRTPHeader. | 232 // Look at RTPSender::BuildRTPHeader. |
234 ++send_timestamp; | 233 ++send_timestamp; |
235 } | 234 } |
236 ASSERT_EQ(reference_timestamp, send_timestamp); | 235 ASSERT_EQ(reference_timestamp, send_timestamp); |
237 | 236 |
238 AddFrameComparison(reference_frame, video_frame, false, render_time_ms); | 237 AddFrameComparison(reference_frame, video_frame, false, render_time_ms); |
239 | 238 |
240 last_rendered_frame_ = video_frame; | 239 last_rendered_frame_ = video_frame; |
241 } | 240 } |
242 | 241 |
243 bool IsTextureSupported() const override { return false; } | |
244 | |
245 void Wait() { | 242 void Wait() { |
246 // Frame comparisons can be very expensive. Wait for test to be done, but | 243 // Frame comparisons can be very expensive. Wait for test to be done, but |
247 // at time-out check if frames_processed is going up. If so, give it more | 244 // at time-out check if frames_processed is going up. If so, give it more |
248 // time, otherwise fail. Hopefully this will reduce test flakiness. | 245 // time, otherwise fail. Hopefully this will reduce test flakiness. |
249 | 246 |
250 stats_polling_thread_.Start(); | 247 stats_polling_thread_.Start(); |
251 | 248 |
252 int last_frames_processed = -1; | 249 int last_frames_processed = -1; |
253 int iteration = 0; | 250 int iteration = 0; |
254 while (!done_.Wait(VideoQualityTest::kDefaultTimeoutMs)) { | 251 while (!done_.Wait(VideoQualityTest::kDefaultTimeoutMs)) { |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 video_send_stream_->Stop(); | 1121 video_send_stream_->Stop(); |
1125 receive_stream->Stop(); | 1122 receive_stream->Stop(); |
1126 | 1123 |
1127 call->DestroyVideoReceiveStream(receive_stream); | 1124 call->DestroyVideoReceiveStream(receive_stream); |
1128 call->DestroyVideoSendStream(video_send_stream_); | 1125 call->DestroyVideoSendStream(video_send_stream_); |
1129 | 1126 |
1130 transport.StopSending(); | 1127 transport.StopSending(); |
1131 } | 1128 } |
1132 | 1129 |
1133 } // namespace webrtc | 1130 } // namespace webrtc |
OLD | NEW |