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 |
11 #include "webrtc/modules/rtp_rtcp/source/rtp_sender.h" | 11 #include "webrtc/modules/rtp_rtcp/source/rtp_sender.h" |
12 | 12 |
13 #include <algorithm> | 13 #include <algorithm> |
14 #include <utility> | 14 #include <utility> |
15 | 15 |
16 #include "webrtc/base/checks.h" | 16 #include "webrtc/base/checks.h" |
17 #include "webrtc/base/logging.h" | 17 #include "webrtc/base/logging.h" |
18 #include "webrtc/base/rate_limiter.h" | 18 #include "webrtc/base/rate_limiter.h" |
19 #include "webrtc/base/trace_event.h" | 19 #include "webrtc/base/trace_event.h" |
20 #include "webrtc/base/timeutils.h" | 20 #include "webrtc/base/timeutils.h" |
21 #include "webrtc/call.h" | 21 #include "webrtc/call.h" |
22 #include "webrtc/call/rtc_event_log.h" | 22 #include "webrtc/call/rtc_event_log.h" |
| 23 #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h" |
23 #include "webrtc/modules/rtp_rtcp/include/rtp_cvo.h" | 24 #include "webrtc/modules/rtp_rtcp/include/rtp_cvo.h" |
24 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" | 25 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" |
25 #include "webrtc/modules/rtp_rtcp/source/playout_delay_oracle.h" | 26 #include "webrtc/modules/rtp_rtcp/source/playout_delay_oracle.h" |
26 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h" | 27 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h" |
27 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_to_send.h" | 28 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_to_send.h" |
28 #include "webrtc/modules/rtp_rtcp/source/rtp_sender_audio.h" | 29 #include "webrtc/modules/rtp_rtcp/source/rtp_sender_audio.h" |
29 #include "webrtc/modules/rtp_rtcp/source/rtp_sender_video.h" | 30 #include "webrtc/modules/rtp_rtcp/source/rtp_sender_video.h" |
30 #include "webrtc/modules/rtp_rtcp/source/time_util.h" | 31 #include "webrtc/modules/rtp_rtcp/source/time_util.h" |
31 | 32 |
32 namespace webrtc { | 33 namespace webrtc { |
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
898 | 899 |
899 // |capture_time_ms| <= 0 is considered invalid. | 900 // |capture_time_ms| <= 0 is considered invalid. |
900 // TODO(holmer): This should be changed all over Video Engine so that negative | 901 // TODO(holmer): This should be changed all over Video Engine so that negative |
901 // time is consider invalid, while 0 is considered a valid time. | 902 // time is consider invalid, while 0 is considered a valid time. |
902 if (packet->capture_time_ms() > 0) { | 903 if (packet->capture_time_ms() > 0) { |
903 packet->SetExtension<TransmissionOffset>( | 904 packet->SetExtension<TransmissionOffset>( |
904 kTimestampTicksPerMs * (now_ms - packet->capture_time_ms())); | 905 kTimestampTicksPerMs * (now_ms - packet->capture_time_ms())); |
905 } | 906 } |
906 packet->SetExtension<AbsoluteSendTime>(now_ms); | 907 packet->SetExtension<AbsoluteSendTime>(now_ms); |
907 | 908 |
| 909 if (video_) { |
| 910 BWE_TEST_LOGGING_PLOT_WITH_SSRC(1, "VideoTotBitrate[kbps]", now_ms, |
| 911 ActualSendBitrateKbit(), packet->Ssrc()); |
| 912 BWE_TEST_LOGGING_PLOT_WITH_SSRC(1, "VideoFecBitrate[Kbps]", now_ms, |
| 913 FecOverheadRate() / 1000, packet->Ssrc()); |
| 914 BWE_TEST_LOGGING_PLOT_WITH_SSRC(1, "VideoNackBitrate[Kbps]", now_ms, |
| 915 NackOverheadRate() / 1000, packet->Ssrc()); |
| 916 } else { |
| 917 BWE_TEST_LOGGING_PLOT_WITH_SSRC(1, "AudioTotBitrate[kbps]", now_ms, |
| 918 ActualSendBitrateKbit(), packet->Ssrc()); |
| 919 BWE_TEST_LOGGING_PLOT_WITH_SSRC(1, "AudioNackBitrate[Kbps]", now_ms, |
| 920 NackOverheadRate() / 1000, packet->Ssrc()); |
| 921 } |
| 922 |
908 if (paced_sender_) { | 923 if (paced_sender_) { |
909 uint16_t seq_no = packet->SequenceNumber(); | 924 uint16_t seq_no = packet->SequenceNumber(); |
910 uint32_t ssrc = packet->Ssrc(); | 925 uint32_t ssrc = packet->Ssrc(); |
911 // Correct offset between implementations of millisecond time stamps in | 926 // Correct offset between implementations of millisecond time stamps in |
912 // TickTime and Clock. | 927 // TickTime and Clock. |
913 int64_t corrected_time_ms = packet->capture_time_ms() + clock_delta_ms_; | 928 int64_t corrected_time_ms = packet->capture_time_ms() + clock_delta_ms_; |
914 size_t payload_length = packet->payload_size(); | 929 size_t payload_length = packet->payload_size(); |
915 packet_history_.PutRtpPacket(std::move(packet), storage, false); | 930 packet_history_.PutRtpPacket(std::move(packet), storage, false); |
916 | 931 |
917 paced_sender_->InsertPacket(priority, ssrc, seq_no, corrected_time_ms, | 932 paced_sender_->InsertPacket(priority, ssrc, seq_no, corrected_time_ms, |
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1753 rtc::CritScope lock(&send_critsect_); | 1768 rtc::CritScope lock(&send_critsect_); |
1754 | 1769 |
1755 RtpState state; | 1770 RtpState state; |
1756 state.sequence_number = sequence_number_rtx_; | 1771 state.sequence_number = sequence_number_rtx_; |
1757 state.start_timestamp = timestamp_offset_; | 1772 state.start_timestamp = timestamp_offset_; |
1758 | 1773 |
1759 return state; | 1774 return state; |
1760 } | 1775 } |
1761 | 1776 |
1762 } // namespace webrtc | 1777 } // namespace webrtc |
OLD | NEW |