Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_sender.cc

Issue 1327933003: Enable probing with repeated payload packets by default. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix additional tests. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/rtp_rtcp/source/rtp_sender.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
index cec7e17e4b621fbe7984281633db41d0793e19df..3d46009172a5a2f6fddf38b0db84eea63e804a06 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
@@ -569,8 +569,10 @@ size_t RTPSender::TrySendRedundantPayloads(size_t bytes_to_send) {
return bytes_to_send - bytes_left;
}
-size_t RTPSender::BuildPaddingPacket(uint8_t* packet, size_t header_length) {
- size_t padding_bytes_in_packet = kMaxPaddingLength;
+size_t RTPSender::BuildPaddingPacket(uint8_t* packet,
+ size_t header_length,
+ size_t max_padding_length) {
mflodman 2015/09/08 12:33:51 This could be named only padding_length, since we'
stefan-webrtc 2015/09/08 13:17:34 Done.
+ size_t padding_bytes_in_packet = max_padding_length;
mflodman 2015/09/08 12:33:51 No need for this variable.
stefan-webrtc 2015/09/08 13:17:34 Done.
packet[0] |= 0x20; // Set padding bit.
int32_t *data =
reinterpret_cast<int32_t *>(&(packet[header_length]));
@@ -592,7 +594,7 @@ size_t RTPSender::TrySendPadData(size_t bytes) {
CriticalSectionScoped cs(send_critsect_.get());
timestamp = timestamp_;
capture_time_ms = capture_time_ms_;
- if (last_timestamp_time_ms_ > 0) {
+ if (rtx_ != kRtxOff && last_timestamp_time_ms_ > 0) {
timestamp +=
(clock_->TimeInMilliseconds() - last_timestamp_time_ms_) * 90;
capture_time_ms +=
@@ -612,8 +614,10 @@ size_t RTPSender::SendPadData(uint32_t timestamp,
packet_router_;
for (; bytes > 0; bytes -= padding_bytes_in_packet) {
// Always send full padding packets.
mflodman 2015/09/08 12:33:51 Can you extend this comment to indicate this is ta
stefan-webrtc 2015/09/08 13:17:35 Done.
- if (bytes < kMaxPaddingLength)
- bytes = kMaxPaddingLength;
+ size_t max_padding_length =
+ std::min(MaxDataPayloadLength(), kMaxPaddingLength);
+ if (bytes < max_padding_length)
+ bytes = max_padding_length;
uint32_t ssrc;
uint16_t sequence_number;
@@ -651,7 +655,8 @@ size_t RTPSender::SendPadData(uint32_t timestamp,
CreateRtpHeader(padding_packet, payload_type, ssrc, false, timestamp,
sequence_number, std::vector<uint32_t>());
assert(header_length != static_cast<size_t>(-1));
- padding_bytes_in_packet = BuildPaddingPacket(padding_packet, header_length);
+ padding_bytes_in_packet =
+ BuildPaddingPacket(padding_packet, header_length, max_padding_length);
assert(padding_bytes_in_packet <= bytes);
size_t length = padding_bytes_in_packet + header_length;
int64_t now_ms = clock_->TimeInMilliseconds();

Powered by Google App Engine
This is Rietveld 408576698