Make pacing buffer send interval configurable.
Bug: webrtc:10153 Change-Id: I2f71b5fc902e24b87f0b6cba474d988b8c27aefa Reviewed-on: https://webrtc-review.googlesource.com/c/115301 Commit-Queue: Christoffer Rodbro <crodbro@webrtc.org> Reviewed-by: Sebastian Jansson <srte@webrtc.org> Cr-Commit-Position: refs/heads/master@{#26076}
This commit is contained in:
parent
61832dd018
commit
e2e000059d
@ -36,6 +36,7 @@ rtc_static_library("pacing") {
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../../rtc_base/experiments:alr_experiment",
|
||||
"../../rtc_base/experiments:field_trial_parser",
|
||||
"../../system_wrappers",
|
||||
"../../system_wrappers:field_trial",
|
||||
"../congestion_controller/goog_cc:alr_detector",
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
|
||||
namespace {
|
||||
// Time limit in milliseconds between packet bursts.
|
||||
const int64_t kMinPacketLimitMs = 5;
|
||||
const int64_t kDefaultMinPacketLimitMs = 5;
|
||||
const int64_t kCongestedPacketIntervalMs = 500;
|
||||
const int64_t kPausedProcessIntervalMs = kCongestedPacketIntervalMs;
|
||||
const int64_t kMaxElapsedTimeMs = 2000;
|
||||
@ -52,6 +52,7 @@ PacedSender::PacedSender(const Clock* clock,
|
||||
send_padding_if_silent_(
|
||||
field_trial::IsEnabled("WebRTC-Pacer-PadInSilence")),
|
||||
video_blocks_audio_(!field_trial::IsDisabled("WebRTC-Pacer-BlockAudio")),
|
||||
min_packet_limit_ms_("", kDefaultMinPacketLimitMs),
|
||||
last_timestamp_ms_(clock_->TimeInMilliseconds()),
|
||||
paused_(false),
|
||||
media_budget_(0),
|
||||
@ -70,10 +71,13 @@ PacedSender::PacedSender(const Clock* clock,
|
||||
pacing_factor_(kDefaultPaceMultiplier),
|
||||
queue_time_limit(kMaxQueueLengthMs),
|
||||
account_for_audio_(false) {
|
||||
if (!drain_large_queues_)
|
||||
if (!drain_large_queues_) {
|
||||
RTC_LOG(LS_WARNING) << "Pacer queues will not be drained,"
|
||||
"pushback experiment must be enabled.";
|
||||
UpdateBudgetWithElapsedTime(kMinPacketLimitMs);
|
||||
}
|
||||
ParseFieldTrial({&min_packet_limit_ms_},
|
||||
field_trial::FindFullName("WebRTC-Pacer-MinPacketLimitMs"));
|
||||
UpdateBudgetWithElapsedTime(min_packet_limit_ms_);
|
||||
}
|
||||
|
||||
PacedSender::~PacedSender() {}
|
||||
@ -258,7 +262,7 @@ int64_t PacedSender::TimeUntilNextProcess() {
|
||||
if (ret > 0 || (ret == 0 && !probing_send_failure_))
|
||||
return ret;
|
||||
}
|
||||
return std::max<int64_t>(kMinPacketLimitMs - elapsed_time_ms, 0);
|
||||
return std::max<int64_t>(min_packet_limit_ms_ - elapsed_time_ms, 0);
|
||||
}
|
||||
|
||||
int64_t PacedSender::UpdateTimeAndGetElapsedMs(int64_t now_us) {
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "modules/utility/include/process_thread.h"
|
||||
#include "rtc_base/criticalsection.h"
|
||||
#include "rtc_base/experiments/field_trial_parser.h"
|
||||
#include "rtc_base/thread_annotations.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -172,6 +173,7 @@ class PacedSender : public Pacer {
|
||||
const bool drain_large_queues_;
|
||||
const bool send_padding_if_silent_;
|
||||
const bool video_blocks_audio_;
|
||||
FieldTrialParameter<int> min_packet_limit_ms_;
|
||||
|
||||
rtc::CriticalSection critsect_;
|
||||
// TODO(webrtc:9716): Remove this when we are certain clocks are monotonic.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user