| 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 "webrtc/video/video_quality_test.h" | 10 #include "webrtc/video/video_quality_test.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 const PacketTime& packet_time) override { | 223 const PacketTime& packet_time) override { |
| 224 // Ignore timestamps of RTCP packets. They're not synchronized with | 224 // Ignore timestamps of RTCP packets. They're not synchronized with |
| 225 // RTP packet timestamps and so they would confuse wrap_handler_. | 225 // RTP packet timestamps and so they would confuse wrap_handler_. |
| 226 if (RtpHeaderParser::IsRtcp(packet, length)) { | 226 if (RtpHeaderParser::IsRtcp(packet, length)) { |
| 227 return receiver_->DeliverPacket(media_type, packet, length, packet_time); | 227 return receiver_->DeliverPacket(media_type, packet, length, packet_time); |
| 228 } | 228 } |
| 229 | 229 |
| 230 RtpUtility::RtpHeaderParser parser(packet, length); | 230 RtpUtility::RtpHeaderParser parser(packet, length); |
| 231 RTPHeader header; | 231 RTPHeader header; |
| 232 parser.Parse(&header); | 232 parser.Parse(&header); |
| 233 if (!IsFlexfec(header.payloadType) && header.ssrc != ssrc_to_analyze_) { | 233 if (!IsFlexfec(header.payloadType) && header.ssrc == ssrc_to_analyze_) { |
| 234 // Ignore FlexFEC timestamps, to avoid collisions with media timestamps. | 234 // Ignore FlexFEC timestamps, to avoid collisions with media timestamps. |
| 235 // (FlexFEC and media are sent on different SSRCs, which have different | 235 // (FlexFEC and media are sent on different SSRCs, which have different |
| 236 // timestamps spaces.) | 236 // timestamps spaces.) |
| 237 // Also ignore packets from wrong SSRC. | 237 // Also ignore packets from wrong SSRC. |
| 238 rtc::CritScope lock(&crit_); | 238 rtc::CritScope lock(&crit_); |
| 239 int64_t timestamp = | 239 int64_t timestamp = |
| 240 wrap_handler_.Unwrap(header.timestamp - rtp_timestamp_delta_); | 240 wrap_handler_.Unwrap(header.timestamp - rtp_timestamp_delta_); |
| 241 recv_times_[timestamp] = | 241 recv_times_[timestamp] = |
| 242 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); | 242 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); |
| 243 } | 243 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 RtpUtility::RtpHeaderParser parser(packet, length); | 278 RtpUtility::RtpHeaderParser parser(packet, length); |
| 279 RTPHeader header; | 279 RTPHeader header; |
| 280 parser.Parse(&header); | 280 parser.Parse(&header); |
| 281 | 281 |
| 282 int64_t current_time = | 282 int64_t current_time = |
| 283 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); | 283 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); |
| 284 bool result = transport_->SendRtp(packet, length, options); | 284 bool result = transport_->SendRtp(packet, length, options); |
| 285 { | 285 { |
| 286 rtc::CritScope lock(&crit_); | 286 rtc::CritScope lock(&crit_); |
| 287 if (rtp_timestamp_delta_ == 0 && header.ssrc == ssrc_to_analyze_) { | 287 if (rtp_timestamp_delta_ == 0 && header.ssrc == ssrc_to_analyze_) { |
| 288 RTC_CHECK(static_cast<bool>(first_sent_timestamp_)); |
| 288 rtp_timestamp_delta_ = header.timestamp - *first_sent_timestamp_; | 289 rtp_timestamp_delta_ = header.timestamp - *first_sent_timestamp_; |
| 289 } | 290 } |
| 290 | 291 |
| 291 if (!IsFlexfec(header.payloadType) && header.ssrc == ssrc_to_analyze_) { | 292 if (!IsFlexfec(header.payloadType) && header.ssrc == ssrc_to_analyze_) { |
| 292 // Ignore FlexFEC timestamps, to avoid collisions with media timestamps. | 293 // Ignore FlexFEC timestamps, to avoid collisions with media timestamps. |
| 293 // (FlexFEC and media are sent on different SSRCs, which have different | 294 // (FlexFEC and media are sent on different SSRCs, which have different |
| 294 // timestamps spaces.) | 295 // timestamps spaces.) |
| 295 // Also ignore packets from wrong SSRC. | 296 // Also ignore packets from wrong SSRC. |
| 296 int64_t timestamp = | 297 int64_t timestamp = |
| 297 wrap_handler_.Unwrap(header.timestamp - rtp_timestamp_delta_); | 298 wrap_handler_.Unwrap(header.timestamp - rtp_timestamp_delta_); |
| (...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1589 std::ostringstream str; | 1590 std::ostringstream str; |
| 1590 str << receive_logs_++; | 1591 str << receive_logs_++; |
| 1591 std::string path = | 1592 std::string path = |
| 1592 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; | 1593 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; |
| 1593 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), | 1594 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), |
| 1594 10000000); | 1595 10000000); |
| 1595 } | 1596 } |
| 1596 } | 1597 } |
| 1597 | 1598 |
| 1598 } // namespace webrtc | 1599 } // namespace webrtc |
| OLD | NEW |