Specific pacing configuration.
Allow configuration of pacing parameters, independently of ALR configuration. Bug: webrtc:10038 Change-Id: I2a7f650d1e6d58f9936fc481988bc4bb6fba7220 Reviewed-on: https://webrtc-review.googlesource.com/c/112127 Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Christoffer Rodbro <crodbro@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25796}
This commit is contained in:
parent
ba2840ce4e
commit
196c5ba045
@ -159,6 +159,16 @@ bool SameStreamsEnabled(const VideoBitrateAllocation& lhs,
|
||||
}
|
||||
} // namespace
|
||||
|
||||
PacingConfig::PacingConfig()
|
||||
: pacing_factor("factor", PacedSender::kDefaultPaceMultiplier),
|
||||
max_pacing_delay("max_delay",
|
||||
TimeDelta::ms(PacedSender::kMaxQueueLengthMs)) {
|
||||
ParseFieldTrial({&pacing_factor, &max_pacing_delay},
|
||||
field_trial::FindFullName("WebRTC-Video-Pacing"));
|
||||
}
|
||||
PacingConfig::PacingConfig(const PacingConfig&) = default;
|
||||
PacingConfig::~PacingConfig() = default;
|
||||
|
||||
// CheckEncoderActivityTask is used for tracking when the encoder last produced
|
||||
// and encoded video frame. If the encoder has not produced anything the last
|
||||
// kEncoderTimeOutMs we also want to stop sending padding.
|
||||
@ -229,6 +239,7 @@ VideoSendStreamImpl::VideoSendStreamImpl(
|
||||
std::unique_ptr<FecController> fec_controller)
|
||||
: has_alr_probing_(config->periodic_alr_bandwidth_probing ||
|
||||
GetAlrSettings(content_type)),
|
||||
pacing_config_(PacingConfig()),
|
||||
stats_proxy_(stats_proxy),
|
||||
config_(config),
|
||||
worker_queue_(worker_queue),
|
||||
@ -302,9 +313,9 @@ VideoSendStreamImpl::VideoSendStreamImpl(
|
||||
transport->SetQueueTimeLimit(alr_settings->max_paced_queue_time);
|
||||
} else {
|
||||
transport->EnablePeriodicAlrProbing(false);
|
||||
transport->SetPacingFactor(PacedSender::kDefaultPaceMultiplier);
|
||||
configured_pacing_factor_ = PacedSender::kDefaultPaceMultiplier;
|
||||
transport->SetQueueTimeLimit(PacedSender::kMaxQueueLengthMs);
|
||||
transport->SetPacingFactor(pacing_config_.pacing_factor);
|
||||
configured_pacing_factor_ = pacing_config_.pacing_factor;
|
||||
transport->SetQueueTimeLimit(pacing_config_.max_pacing_delay.Get().ms());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -29,6 +29,16 @@
|
||||
namespace webrtc {
|
||||
namespace internal {
|
||||
|
||||
// Pacing buffer config; overridden by ALR config if provided.
|
||||
struct PacingConfig {
|
||||
PacingConfig();
|
||||
PacingConfig(const PacingConfig&);
|
||||
PacingConfig& operator=(const PacingConfig&) = default;
|
||||
~PacingConfig();
|
||||
FieldTrialParameter<double> pacing_factor;
|
||||
FieldTrialParameter<TimeDelta> max_pacing_delay;
|
||||
};
|
||||
|
||||
// VideoSendStreamImpl implements internal::VideoSendStream.
|
||||
// It is created and destroyed on |worker_queue|. The intent is to decrease the
|
||||
// need for locking and to ensure methods are called in sequence.
|
||||
@ -111,6 +121,7 @@ class VideoSendStreamImpl : public webrtc::BitrateAllocatorObserver,
|
||||
void SignalEncoderActive();
|
||||
|
||||
const bool has_alr_probing_;
|
||||
const PacingConfig pacing_config_;
|
||||
|
||||
SendStatisticsProxy* const stats_proxy_;
|
||||
const VideoSendStream::Config* const config_;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user