Fix SendSideBweWithOverhead using new pacer code path.

This field trial was read in RTPSender, and the altered packet size
passed along to the pacer. Now, the pacer packet queue looks directly
at the packet instance, so it needs to be aware of the experiment flag
in order to make the right decision.

Bug: webrtc:10633, b/138582168
Change-Id: If1148f39c463e11ad49a659913465f131cf9b526
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/147270
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28714}
This commit is contained in:
Erik Språng
2019-07-30 22:36:02 +02:00
committed by Commit Bot
parent e529ecb5bb
commit 7702c8ac04
3 changed files with 22 additions and 5 deletions

View File

@ -96,7 +96,7 @@ PacedSender::PacedSender(Clock* clock,
pacing_bitrate_(DataRate::Zero()),
time_last_process_us_(clock->TimeInMicroseconds()),
last_send_time_us_(clock->TimeInMicroseconds()),
packets_(clock->TimeInMicroseconds()),
packets_(clock->TimeInMicroseconds(), field_trials),
packet_counter_(0),
congestion_window_size_(DataSize::PlusInfinity()),
outstanding_data_(DataSize::Zero()),

View File

@ -71,8 +71,19 @@ RoundRobinPacketQueue::Stream::Stream() : bytes(0), ssrc(0) {}
RoundRobinPacketQueue::Stream::Stream(const Stream& stream) = default;
RoundRobinPacketQueue::Stream::~Stream() {}
RoundRobinPacketQueue::RoundRobinPacketQueue(int64_t start_time_us)
: time_last_updated_ms_(start_time_us / 1000) {}
bool IsEnabled(const WebRtcKeyValueConfig* field_trials, const char* name) {
if (!field_trials) {
return false;
}
return field_trials->Lookup(name).find("Enabled") == 0;
}
RoundRobinPacketQueue::RoundRobinPacketQueue(
int64_t start_time_us,
const WebRtcKeyValueConfig* field_trials)
: time_last_updated_ms_(start_time_us / 1000),
send_side_bwe_with_overhead_(
IsEnabled(field_trials, "WebRTC-SendSideBwe-WithOverhead")) {}
RoundRobinPacketQueue::~RoundRobinPacketQueue() {}
@ -98,7 +109,9 @@ void RoundRobinPacketQueue::Push(int priority,
uint32_t ssrc = packet->Ssrc();
uint16_t sequence_number = packet->SequenceNumber();
int64_t capture_time_ms = packet->capture_time_ms();
size_t size_bytes = packet->payload_size() + packet->padding_size();
size_t size_bytes = send_side_bwe_with_overhead_
? packet->size()
: packet->payload_size() + packet->padding_size();
auto type = packet->packet_type();
RTC_DCHECK(type.has_value());

View File

@ -21,6 +21,7 @@
#include <set>
#include "absl/types/optional.h"
#include "api/transport/webrtc_key_value_config.h"
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
#include "system_wrappers/include/clock.h"
@ -29,7 +30,8 @@ namespace webrtc {
class RoundRobinPacketQueue {
public:
explicit RoundRobinPacketQueue(int64_t start_time_us);
RoundRobinPacketQueue(int64_t start_time_us,
const WebRtcKeyValueConfig* field_trials);
~RoundRobinPacketQueue();
struct QueuedPacket {
@ -187,6 +189,8 @@ class RoundRobinPacketQueue {
// end iterator of this list if queue does not have direct ownership of the
// packet.
std::list<std::unique_ptr<RtpPacketToSend>> rtp_packets_;
const bool send_side_bwe_with_overhead_;
};
} // namespace webrtc