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 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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>( |
744 AbsoluteSendTime::MsTo24Bits(now_ms)); | 744 AbsoluteSendTime::MsTo24Bits(now_ms)); |
745 | 745 |
| 746 if (packet_to_send->HasExtension<VideoTimingExtension>()) |
| 747 packet_to_send->set_pacer_exit_time_ms(now_ms); |
| 748 |
746 PacketOptions options; | 749 PacketOptions options; |
747 if (UpdateTransportSequenceNumber(packet_to_send, &options.packet_id)) { | 750 if (UpdateTransportSequenceNumber(packet_to_send, &options.packet_id)) { |
748 AddPacketToTransportFeedback(options.packet_id, *packet_to_send, | 751 AddPacketToTransportFeedback(options.packet_id, *packet_to_send, |
749 pacing_info); | 752 pacing_info); |
750 } | 753 } |
751 | 754 |
752 if (!is_retransmit && !send_over_rtx) { | 755 if (!is_retransmit && !send_over_rtx) { |
753 UpdateDelayStatistics(packet->capture_time_ms(), now_ms); | 756 UpdateDelayStatistics(packet->capture_time_ms(), now_ms); |
754 UpdateOnSendPacket(options.packet_id, packet->capture_time_ms(), | 757 UpdateOnSendPacket(options.packet_id, packet->capture_time_ms(), |
755 packet->Ssrc()); | 758 packet->Ssrc()); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 RtpPacketSender::Priority priority) { | 826 RtpPacketSender::Priority priority) { |
824 RTC_DCHECK(packet); | 827 RTC_DCHECK(packet); |
825 int64_t now_ms = clock_->TimeInMilliseconds(); | 828 int64_t now_ms = clock_->TimeInMilliseconds(); |
826 | 829 |
827 // |capture_time_ms| <= 0 is considered invalid. | 830 // |capture_time_ms| <= 0 is considered invalid. |
828 // 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 |
829 // time is consider invalid, while 0 is considered a valid time. | 832 // time is consider invalid, while 0 is considered a valid time. |
830 if (packet->capture_time_ms() > 0) { | 833 if (packet->capture_time_ms() > 0) { |
831 packet->SetExtension<TransmissionOffset>( | 834 packet->SetExtension<TransmissionOffset>( |
832 kTimestampTicksPerMs * (now_ms - packet->capture_time_ms())); | 835 kTimestampTicksPerMs * (now_ms - packet->capture_time_ms())); |
| 836 if (packet->HasExtension<VideoTimingExtension>()) |
| 837 packet->set_pacer_exit_time_ms(now_ms); |
833 } | 838 } |
834 packet->SetExtension<AbsoluteSendTime>(AbsoluteSendTime::MsTo24Bits(now_ms)); | 839 packet->SetExtension<AbsoluteSendTime>(AbsoluteSendTime::MsTo24Bits(now_ms)); |
835 | 840 |
836 if (video_) { | 841 if (video_) { |
837 BWE_TEST_LOGGING_PLOT_WITH_SSRC(1, "VideoTotBitrate_kbps", now_ms, | 842 BWE_TEST_LOGGING_PLOT_WITH_SSRC(1, "VideoTotBitrate_kbps", now_ms, |
838 ActualSendBitrateKbit(), packet->Ssrc()); | 843 ActualSendBitrateKbit(), packet->Ssrc()); |
839 BWE_TEST_LOGGING_PLOT_WITH_SSRC(1, "VideoFecBitrate_kbps", now_ms, | 844 BWE_TEST_LOGGING_PLOT_WITH_SSRC(1, "VideoFecBitrate_kbps", now_ms, |
840 FecOverheadRate() / 1000, packet->Ssrc()); | 845 FecOverheadRate() / 1000, packet->Ssrc()); |
841 BWE_TEST_LOGGING_PLOT_WITH_SSRC(1, "VideoNackBitrate_kbps", now_ms, | 846 BWE_TEST_LOGGING_PLOT_WITH_SSRC(1, "VideoNackBitrate_kbps", now_ms, |
842 NackOverheadRate() / 1000, packet->Ssrc()); | 847 NackOverheadRate() / 1000, packet->Ssrc()); |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1270 if (rtp_overhead_bytes_per_packet_ == packet.headers_size()) { | 1275 if (rtp_overhead_bytes_per_packet_ == packet.headers_size()) { |
1271 return; | 1276 return; |
1272 } | 1277 } |
1273 rtp_overhead_bytes_per_packet_ = packet.headers_size(); | 1278 rtp_overhead_bytes_per_packet_ = packet.headers_size(); |
1274 overhead_bytes_per_packet = rtp_overhead_bytes_per_packet_; | 1279 overhead_bytes_per_packet = rtp_overhead_bytes_per_packet_; |
1275 } | 1280 } |
1276 overhead_observer_->OnOverheadChanged(overhead_bytes_per_packet); | 1281 overhead_observer_->OnOverheadChanged(overhead_bytes_per_packet); |
1277 } | 1282 } |
1278 | 1283 |
1279 } // namespace webrtc | 1284 } // namespace webrtc |
OLD | NEW |