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
@ -351,7 +351,6 @@ rtc_source_set("rtp_rtcp_legacy") {
|
|||||||
deps = [
|
deps = [
|
||||||
":rtp_rtcp",
|
":rtp_rtcp",
|
||||||
":rtp_rtcp_format",
|
":rtp_rtcp_format",
|
||||||
"..:module_api",
|
|
||||||
"..:module_fec_api",
|
"..:module_fec_api",
|
||||||
"../../api:rtp_headers",
|
"../../api:rtp_headers",
|
||||||
"../../api:transport_api",
|
"../../api:transport_api",
|
||||||
|
@ -14,13 +14,12 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "absl/base/attributes.h"
|
#include "absl/base/attributes.h"
|
||||||
#include "modules/include/module.h"
|
|
||||||
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
|
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
// DEPRECATED. Do not use.
|
// DEPRECATED. Do not use.
|
||||||
class RtpRtcp : public Module, public RtpRtcpInterface {
|
class RtpRtcp : public RtpRtcpInterface {
|
||||||
public:
|
public:
|
||||||
// Instantiates a deprecated version of the RtpRtcp module.
|
// Instantiates a deprecated version of the RtpRtcp module.
|
||||||
static std::unique_ptr<RtpRtcp> ABSL_DEPRECATED("")
|
static std::unique_ptr<RtpRtcp> ABSL_DEPRECATED("")
|
||||||
@ -36,6 +35,9 @@ class RtpRtcp : public Module, public RtpRtcpInterface {
|
|||||||
void SendPictureLossIndication() { SendRTCP(kRtcpPli); }
|
void SendPictureLossIndication() { SendRTCP(kRtcpPli); }
|
||||||
// using FIR, https://tools.ietf.org/html/rfc5104#section-4.3.1.2
|
// using FIR, https://tools.ietf.org/html/rfc5104#section-4.3.1.2
|
||||||
void SendFullIntraRequest() { SendRTCP(kRtcpFir); }
|
void SendFullIntraRequest() { SendRTCP(kRtcpFir); }
|
||||||
|
|
||||||
|
// Process any pending tasks such as timeouts.
|
||||||
|
virtual void Process() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
@ -36,7 +36,6 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace {
|
namespace {
|
||||||
const int64_t kRtpRtcpMaxIdleTimeProcessMs = 5;
|
|
||||||
const int64_t kRtpRtcpRttProcessTimeMs = 1000;
|
const int64_t kRtpRtcpRttProcessTimeMs = 1000;
|
||||||
const int64_t kRtpRtcpBitrateProcessTimeMs = 10;
|
const int64_t kRtpRtcpBitrateProcessTimeMs = 10;
|
||||||
const int64_t kDefaultExpectedRetransmissionTimeMs = 125;
|
const int64_t kDefaultExpectedRetransmissionTimeMs = 125;
|
||||||
@ -71,8 +70,6 @@ ModuleRtpRtcpImpl::ModuleRtpRtcpImpl(const Configuration& configuration)
|
|||||||
clock_(configuration.clock),
|
clock_(configuration.clock),
|
||||||
last_bitrate_process_time_(clock_->TimeInMilliseconds()),
|
last_bitrate_process_time_(clock_->TimeInMilliseconds()),
|
||||||
last_rtt_process_time_(clock_->TimeInMilliseconds()),
|
last_rtt_process_time_(clock_->TimeInMilliseconds()),
|
||||||
next_process_time_(clock_->TimeInMilliseconds() +
|
|
||||||
kRtpRtcpMaxIdleTimeProcessMs),
|
|
||||||
packet_overhead_(28), // IPV4 UDP.
|
packet_overhead_(28), // IPV4 UDP.
|
||||||
nack_last_time_sent_full_ms_(0),
|
nack_last_time_sent_full_ms_(0),
|
||||||
nack_last_seq_number_sent_(0),
|
nack_last_seq_number_sent_(0),
|
||||||
@ -95,29 +92,14 @@ ModuleRtpRtcpImpl::ModuleRtpRtcpImpl(const Configuration& configuration)
|
|||||||
|
|
||||||
ModuleRtpRtcpImpl::~ModuleRtpRtcpImpl() = default;
|
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).
|
// Process any pending tasks such as timeouts (non time critical events).
|
||||||
void ModuleRtpRtcpImpl::Process() {
|
void ModuleRtpRtcpImpl::Process() {
|
||||||
const int64_t now = clock_->TimeInMilliseconds();
|
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 (rtp_sender_) {
|
||||||
if (now >= last_bitrate_process_time_ + kRtpRtcpBitrateProcessTimeMs) {
|
if (now >= last_bitrate_process_time_ + kRtpRtcpBitrateProcessTimeMs) {
|
||||||
rtp_sender_->packet_sender.ProcessBitrateAndNotifyObservers();
|
rtp_sender_->packet_sender.ProcessBitrateAndNotifyObservers();
|
||||||
last_bitrate_process_time_ = now;
|
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.
|
// Get processed rtt.
|
||||||
if (process_rtt) {
|
if (process_rtt) {
|
||||||
last_rtt_process_time_ = now;
|
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_) {
|
if (rtt_stats_) {
|
||||||
// Make sure we have a valid RTT before setting.
|
// Make sure we have a valid RTT before setting.
|
||||||
int64_t last_rtt = rtt_stats_->LastProcessedRtt();
|
int64_t last_rtt = rtt_stats_->LastProcessedRtt();
|
||||||
|
@ -51,10 +51,6 @@ class ModuleRtpRtcpImpl : public RtpRtcp, public RTCPReceiver::ModuleRtpRtcp {
|
|||||||
const RtpRtcpInterface::Configuration& configuration);
|
const RtpRtcpInterface::Configuration& configuration);
|
||||||
~ModuleRtpRtcpImpl() override;
|
~ModuleRtpRtcpImpl() override;
|
||||||
|
|
||||||
// Returns the number of milliseconds until the module want a worker thread to
|
|
||||||
// call Process.
|
|
||||||
int64_t TimeUntilNextProcess() override;
|
|
||||||
|
|
||||||
// Process any pending tasks such as timeouts.
|
// Process any pending tasks such as timeouts.
|
||||||
void Process() override;
|
void Process() override;
|
||||||
|
|
||||||
@ -309,7 +305,6 @@ class ModuleRtpRtcpImpl : public RtpRtcp, public RTCPReceiver::ModuleRtpRtcp {
|
|||||||
|
|
||||||
int64_t last_bitrate_process_time_;
|
int64_t last_bitrate_process_time_;
|
||||||
int64_t last_rtt_process_time_;
|
int64_t last_rtt_process_time_;
|
||||||
int64_t next_process_time_;
|
|
||||||
uint16_t packet_overhead_;
|
uint16_t packet_overhead_;
|
||||||
|
|
||||||
// Send side
|
// Send side
|
||||||
|
Reference in New Issue
Block a user