Detach legacy RtpRtcp from Module interface
Bug: webrtc:7219 Change-Id: I5faf8f68b043994a86d227926c13b07d0141f382 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267063 Auto-Submit: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Emil Lundmark <lndmrk@webrtc.org> Reviewed-by: Emil Lundmark <lndmrk@webrtc.org> Cr-Commit-Position: refs/heads/main@{#37353}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
91c05abd9b
commit
7769dc87d7
@ -36,7 +36,6 @@
|
||||
|
||||
namespace webrtc {
|
||||
namespace {
|
||||
const int64_t kRtpRtcpMaxIdleTimeProcessMs = 5;
|
||||
const int64_t kRtpRtcpRttProcessTimeMs = 1000;
|
||||
const int64_t kRtpRtcpBitrateProcessTimeMs = 10;
|
||||
const int64_t kDefaultExpectedRetransmissionTimeMs = 125;
|
||||
@ -71,8 +70,6 @@ ModuleRtpRtcpImpl::ModuleRtpRtcpImpl(const Configuration& configuration)
|
||||
clock_(configuration.clock),
|
||||
last_bitrate_process_time_(clock_->TimeInMilliseconds()),
|
||||
last_rtt_process_time_(clock_->TimeInMilliseconds()),
|
||||
next_process_time_(clock_->TimeInMilliseconds() +
|
||||
kRtpRtcpMaxIdleTimeProcessMs),
|
||||
packet_overhead_(28), // IPV4 UDP.
|
||||
nack_last_time_sent_full_ms_(0),
|
||||
nack_last_seq_number_sent_(0),
|
||||
@ -95,29 +92,14 @@ ModuleRtpRtcpImpl::ModuleRtpRtcpImpl(const Configuration& configuration)
|
||||
|
||||
ModuleRtpRtcpImpl::~ModuleRtpRtcpImpl() = default;
|
||||
|
||||
// Returns the number of milliseconds until the module want a worker thread
|
||||
// to call Process.
|
||||
int64_t ModuleRtpRtcpImpl::TimeUntilNextProcess() {
|
||||
return std::max<int64_t>(0,
|
||||
next_process_time_ - clock_->TimeInMilliseconds());
|
||||
}
|
||||
|
||||
// Process any pending tasks such as timeouts (non time critical events).
|
||||
void ModuleRtpRtcpImpl::Process() {
|
||||
const int64_t now = clock_->TimeInMilliseconds();
|
||||
// TODO(bugs.webrtc.org/11581): Figure out why we need to call Process() 200
|
||||
// times a second.
|
||||
next_process_time_ = now + kRtpRtcpMaxIdleTimeProcessMs;
|
||||
|
||||
if (rtp_sender_) {
|
||||
if (now >= last_bitrate_process_time_ + kRtpRtcpBitrateProcessTimeMs) {
|
||||
rtp_sender_->packet_sender.ProcessBitrateAndNotifyObservers();
|
||||
last_bitrate_process_time_ = now;
|
||||
// TODO(bugs.webrtc.org/11581): Is this a bug? At the top of the function,
|
||||
// next_process_time_ is incremented by 5ms, here we effectively do a
|
||||
// std::min() of (now + 5ms, now + 10ms). Seems like this is a no-op?
|
||||
next_process_time_ =
|
||||
std::min(next_process_time_, now + kRtpRtcpBitrateProcessTimeMs);
|
||||
}
|
||||
}
|
||||
|
||||
@ -183,11 +165,6 @@ void ModuleRtpRtcpImpl::Process() {
|
||||
// Get processed rtt.
|
||||
if (process_rtt) {
|
||||
last_rtt_process_time_ = now;
|
||||
// TODO(bugs.webrtc.org/11581): Is this a bug? At the top of the function,
|
||||
// next_process_time_ is incremented by 5ms, here we effectively do a
|
||||
// std::min() of (now + 5ms, now + 1000ms). Seems like this is a no-op?
|
||||
next_process_time_ = std::min(
|
||||
next_process_time_, last_rtt_process_time_ + kRtpRtcpRttProcessTimeMs);
|
||||
if (rtt_stats_) {
|
||||
// Make sure we have a valid RTT before setting.
|
||||
int64_t last_rtt = rtt_stats_->LastProcessedRtt();
|
||||
|
||||
Reference in New Issue
Block a user