OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
733 packet_rtx = BuildRtxPacket(*packet); | 733 packet_rtx = BuildRtxPacket(*packet); |
734 if (!packet_rtx) | 734 if (!packet_rtx) |
735 return false; | 735 return false; |
736 packet_to_send = packet_rtx.get(); | 736 packet_to_send = packet_rtx.get(); |
737 } | 737 } |
738 | 738 |
739 int64_t now_ms = clock_->TimeInMilliseconds(); | 739 int64_t now_ms = clock_->TimeInMilliseconds(); |
740 int64_t diff_ms = now_ms - capture_time_ms; | 740 int64_t diff_ms = now_ms - capture_time_ms; |
741 packet_to_send->SetExtension<TransmissionOffset>(kTimestampTicksPerMs * | 741 packet_to_send->SetExtension<TransmissionOffset>(kTimestampTicksPerMs * |
742 diff_ms); | 742 diff_ms); |
743 packet_to_send->SetExtension<AbsoluteSendTime>( | 743 packet_to_send->SetExtension<AbsoluteSendTime>( |
brandtr
2017/06/21 11:05:39
Can you add a comment here, and below, describing
ilnik
2017/06/21 11:17:18
Done.
| |
744 AbsoluteSendTime::MsTo24Bits(now_ms)); | 744 AbsoluteSendTime::MsTo24Bits(now_ms)); |
745 | 745 |
746 // TODO(ilnik): (webrtc:7859) For now we can't modify pacer exit timestamp in | 746 if (packet_to_send->HasExtension<VideoTimingExtension>()) |
747 // video timing extension because only some packets have it and it will break | 747 packet_to_send->set_pacer_exit_time_ms(now_ms); |
748 // FEC recovered packets, which will lead to corruptions. Ideally, here | |
749 // |packet->set_pacer_exit_time_ms(now_ms)| should be called if | |
750 // |VideoTimingExtension| is present. | |
751 | 748 |
752 PacketOptions options; | 749 PacketOptions options; |
753 if (UpdateTransportSequenceNumber(packet_to_send, &options.packet_id)) { | 750 if (UpdateTransportSequenceNumber(packet_to_send, &options.packet_id)) { |
754 AddPacketToTransportFeedback(options.packet_id, *packet_to_send, | 751 AddPacketToTransportFeedback(options.packet_id, *packet_to_send, |
755 pacing_info); | 752 pacing_info); |
756 } | 753 } |
757 | 754 |
758 if (!is_retransmit && !send_over_rtx) { | 755 if (!is_retransmit && !send_over_rtx) { |
759 UpdateDelayStatistics(packet->capture_time_ms(), now_ms); | 756 UpdateDelayStatistics(packet->capture_time_ms(), now_ms); |
760 UpdateOnSendPacket(options.packet_id, packet->capture_time_ms(), | 757 UpdateOnSendPacket(options.packet_id, packet->capture_time_ms(), |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
829 RtpPacketSender::Priority priority) { | 826 RtpPacketSender::Priority priority) { |
830 RTC_DCHECK(packet); | 827 RTC_DCHECK(packet); |
831 int64_t now_ms = clock_->TimeInMilliseconds(); | 828 int64_t now_ms = clock_->TimeInMilliseconds(); |
832 | 829 |
833 // |capture_time_ms| <= 0 is considered invalid. | 830 // |capture_time_ms| <= 0 is considered invalid. |
834 // TODO(holmer): This should be changed all over Video Engine so that negative | 831 // TODO(holmer): This should be changed all over Video Engine so that negative |
835 // time is consider invalid, while 0 is considered a valid time. | 832 // time is consider invalid, while 0 is considered a valid time. |
836 if (packet->capture_time_ms() > 0) { | 833 if (packet->capture_time_ms() > 0) { |
837 packet->SetExtension<TransmissionOffset>( | 834 packet->SetExtension<TransmissionOffset>( |
838 kTimestampTicksPerMs * (now_ms - packet->capture_time_ms())); | 835 kTimestampTicksPerMs * (now_ms - packet->capture_time_ms())); |
839 // TODO(ilnik): (webrtc:7859) For now we can't modify pacer exit timestamp | 836 if (packet->HasExtension<VideoTimingExtension>()) |
840 // in video timing extension because only some packets have it an it will | 837 packet->set_pacer_exit_time_ms(now_ms); |
841 // break FEC recovered packets, which will lead to corruptions. Ideally, | |
842 // here |packet->set_pacer_exit_time_ms(now_ms)| should be called if | |
843 // |VideoTimingExtension| is present. | |
844 } | 838 } |
845 packet->SetExtension<AbsoluteSendTime>(AbsoluteSendTime::MsTo24Bits(now_ms)); | 839 packet->SetExtension<AbsoluteSendTime>(AbsoluteSendTime::MsTo24Bits(now_ms)); |
846 | 840 |
847 if (video_) { | 841 if (video_) { |
848 BWE_TEST_LOGGING_PLOT_WITH_SSRC(1, "VideoTotBitrate_kbps", now_ms, | 842 BWE_TEST_LOGGING_PLOT_WITH_SSRC(1, "VideoTotBitrate_kbps", now_ms, |
849 ActualSendBitrateKbit(), packet->Ssrc()); | 843 ActualSendBitrateKbit(), packet->Ssrc()); |
850 BWE_TEST_LOGGING_PLOT_WITH_SSRC(1, "VideoFecBitrate_kbps", now_ms, | 844 BWE_TEST_LOGGING_PLOT_WITH_SSRC(1, "VideoFecBitrate_kbps", now_ms, |
851 FecOverheadRate() / 1000, packet->Ssrc()); | 845 FecOverheadRate() / 1000, packet->Ssrc()); |
852 BWE_TEST_LOGGING_PLOT_WITH_SSRC(1, "VideoNackBitrate_kbps", now_ms, | 846 BWE_TEST_LOGGING_PLOT_WITH_SSRC(1, "VideoNackBitrate_kbps", now_ms, |
853 NackOverheadRate() / 1000, packet->Ssrc()); | 847 NackOverheadRate() / 1000, packet->Ssrc()); |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1281 if (rtp_overhead_bytes_per_packet_ == packet.headers_size()) { | 1275 if (rtp_overhead_bytes_per_packet_ == packet.headers_size()) { |
1282 return; | 1276 return; |
1283 } | 1277 } |
1284 rtp_overhead_bytes_per_packet_ = packet.headers_size(); | 1278 rtp_overhead_bytes_per_packet_ = packet.headers_size(); |
1285 overhead_bytes_per_packet = rtp_overhead_bytes_per_packet_; | 1279 overhead_bytes_per_packet = rtp_overhead_bytes_per_packet_; |
1286 } | 1280 } |
1287 overhead_observer_->OnOverheadChanged(overhead_bytes_per_packet); | 1281 overhead_observer_->OnOverheadChanged(overhead_bytes_per_packet); |
1288 } | 1282 } |
1289 | 1283 |
1290 } // namespace webrtc | 1284 } // namespace webrtc |
OLD | NEW |