Chromium Code Reviews| 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 11 matching lines...) Expand all Loading... | |
| 22 #include "webrtc/call/rtc_event_log.h" | 22 #include "webrtc/call/rtc_event_log.h" |
| 23 #include "webrtc/modules/rtp_rtcp/include/rtp_cvo.h" | 23 #include "webrtc/modules/rtp_rtcp/include/rtp_cvo.h" |
| 24 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" | 24 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" |
| 25 #include "webrtc/modules/rtp_rtcp/source/playout_delay_oracle.h" | 25 #include "webrtc/modules/rtp_rtcp/source/playout_delay_oracle.h" |
| 26 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h" | 26 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h" |
| 27 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_to_send.h" | 27 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_to_send.h" |
| 28 #include "webrtc/modules/rtp_rtcp/source/rtp_sender_audio.h" | 28 #include "webrtc/modules/rtp_rtcp/source/rtp_sender_audio.h" |
| 29 #include "webrtc/modules/rtp_rtcp/source/rtp_sender_video.h" | 29 #include "webrtc/modules/rtp_rtcp/source/rtp_sender_video.h" |
| 30 #include "webrtc/modules/rtp_rtcp/source/time_util.h" | 30 #include "webrtc/modules/rtp_rtcp/source/time_util.h" |
| 31 | 31 |
| 32 #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h" | |
| 33 | |
| 32 namespace webrtc { | 34 namespace webrtc { |
| 33 | 35 |
| 34 namespace { | 36 namespace { |
| 35 // Max in the RFC 3550 is 255 bytes, we limit it to be modulus 32 for SRTP. | 37 // Max in the RFC 3550 is 255 bytes, we limit it to be modulus 32 for SRTP. |
| 36 constexpr size_t kMaxPaddingLength = 224; | 38 constexpr size_t kMaxPaddingLength = 224; |
| 37 constexpr int kSendSideDelayWindowMs = 1000; | 39 constexpr int kSendSideDelayWindowMs = 1000; |
| 38 constexpr size_t kRtpHeaderLength = 12; | 40 constexpr size_t kRtpHeaderLength = 12; |
| 39 constexpr uint16_t kMaxInitRtpSeqNumber = 32767; // 2^15 -1. | 41 constexpr uint16_t kMaxInitRtpSeqNumber = 32767; // 2^15 -1. |
| 40 constexpr uint32_t kTimestampTicksPerMs = 90; | 42 constexpr uint32_t kTimestampTicksPerMs = 90; |
| 41 constexpr int kBitrateStatisticsWindowMs = 1000; | 43 constexpr int kBitrateStatisticsWindowMs = 1000; |
| (...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 897 | 899 |
| 898 // |capture_time_ms| <= 0 is considered invalid. | 900 // |capture_time_ms| <= 0 is considered invalid. |
| 899 // 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 |
| 900 // time is consider invalid, while 0 is considered a valid time. | 902 // time is consider invalid, while 0 is considered a valid time. |
| 901 if (packet->capture_time_ms() > 0) { | 903 if (packet->capture_time_ms() > 0) { |
| 902 packet->SetExtension<TransmissionOffset>( | 904 packet->SetExtension<TransmissionOffset>( |
| 903 kTimestampTicksPerMs * (now_ms - packet->capture_time_ms())); | 905 kTimestampTicksPerMs * (now_ms - packet->capture_time_ms())); |
| 904 } | 906 } |
| 905 packet->SetExtension<AbsoluteSendTime>(now_ms); | 907 packet->SetExtension<AbsoluteSendTime>(now_ms); |
| 906 | 908 |
| 909 if (video_) { | |
| 910 BWE_TEST_LOGGING_PLOT(1, "SentBitrate[Kbps]", \ | |
| 911 now_ms, ActualSendBitrateKbit()); | |
| 912 BWE_TEST_LOGGING_PLOT(1, "FecBitrate[Kbps]", \ | |
| 913 now_ms, FecOverheadRate()/1000); | |
| 914 BWE_TEST_LOGGING_PLOT(1, "NackBitrate[Kbps]", \ | |
| 915 now_ms, NackOverheadRate()/1000); | |
| 916 BWE_TEST_LOGGING_PLOT(1, "VideoBitrate[bps]", \ | |
| 917 now_ms, VideoBitrateSent()/1000); | |
| 918 } | |
| 919 | |
| 920 if (!video_) { | |
| 921 BWE_TEST_LOGGING_PLOT(1, "AudioSentBitrate[Kbps]", \ | |
| 922 now_ms, ActualSendBitrateKbit()); | |
| 923 } | |
| 924 | |
|
stefan-webrtc
2016/09/01 14:07:36
Note that these are measured per ssrc, so I think
Gaetano Carlucci
2016/09/01 16:06:26
yes, adding ssrc should be enough
| |
| 907 if (paced_sender_) { | 925 if (paced_sender_) { |
| 908 uint16_t seq_no = packet->SequenceNumber(); | 926 uint16_t seq_no = packet->SequenceNumber(); |
| 909 uint32_t ssrc = packet->Ssrc(); | 927 uint32_t ssrc = packet->Ssrc(); |
| 910 // Correct offset between implementations of millisecond time stamps in | 928 // Correct offset between implementations of millisecond time stamps in |
| 911 // TickTime and Clock. | 929 // TickTime and Clock. |
| 912 int64_t corrected_time_ms = packet->capture_time_ms() + clock_delta_ms_; | 930 int64_t corrected_time_ms = packet->capture_time_ms() + clock_delta_ms_; |
| 913 size_t payload_length = packet->payload_size(); | 931 size_t payload_length = packet->payload_size(); |
| 914 packet_history_.PutRtpPacket(std::move(packet), storage, false); | 932 packet_history_.PutRtpPacket(std::move(packet), storage, false); |
| 915 | 933 |
| 916 paced_sender_->InsertPacket(priority, ssrc, seq_no, corrected_time_ms, | 934 paced_sender_->InsertPacket(priority, ssrc, seq_no, corrected_time_ms, |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1721 rtc::CritScope lock(&send_critsect_); | 1739 rtc::CritScope lock(&send_critsect_); |
| 1722 | 1740 |
| 1723 RtpState state; | 1741 RtpState state; |
| 1724 state.sequence_number = sequence_number_rtx_; | 1742 state.sequence_number = sequence_number_rtx_; |
| 1725 state.start_timestamp = timestamp_offset_; | 1743 state.start_timestamp = timestamp_offset_; |
| 1726 | 1744 |
| 1727 return state; | 1745 return state; |
| 1728 } | 1746 } |
| 1729 | 1747 |
| 1730 } // namespace webrtc | 1748 } // namespace webrtc |
| OLD | NEW |