Introduce ModuleRtpRtcpImpl factory that accepts Environment
ModuleRtpRtcpImpl and ModuleRtpRtcpImpl2 share certain components, RtcpReceiver in particular. To always have Environment in RtcpReceiver both legacy and new module need to propagate it. No-Iwyu: suggests too many changes, better address them separately. Bug: webrtc:362762208 Change-Id: I2c885f57e24f135229fb7cd9781126d663017b3d Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361142 Reviewed-by: Åsa Persson <asapersson@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42908}
This commit is contained in:
parent
cb00e16dcb
commit
164b3b3fce
@ -377,6 +377,7 @@ rtc_source_set("rtp_rtcp_legacy") {
|
||||
"..:module_fec_api",
|
||||
"../../api:rtp_headers",
|
||||
"../../api:transport_api",
|
||||
"../../api/environment",
|
||||
"../../api/rtc_event_log",
|
||||
"../../api/units:data_rate",
|
||||
"../../api/units:timestamp",
|
||||
|
||||
@ -13,21 +13,22 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "absl/base/attributes.h"
|
||||
#include "api/environment/environment.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class ABSL_DEPRECATED("") RtpRtcp : public RtpRtcpInterface {
|
||||
// A deprecated version of the RtpRtcp module.
|
||||
class [[deprecated("bugs.webrtc.org/42224904")]] RtpRtcp
|
||||
: public RtpRtcpInterface {
|
||||
public:
|
||||
// Instantiates a deprecated version of the RtpRtcp module.
|
||||
static std::unique_ptr<RtpRtcp> ABSL_DEPRECATED("")
|
||||
Create(const Configuration& configuration) {
|
||||
return DEPRECATED_Create(configuration);
|
||||
}
|
||||
[[deprecated("bugs.webrtc.org/362762208")]] //
|
||||
static std::unique_ptr<RtpRtcp>
|
||||
Create(const Configuration& configuration);
|
||||
|
||||
static std::unique_ptr<RtpRtcp> DEPRECATED_Create(
|
||||
const Configuration& configuration);
|
||||
[[deprecated("bugs.webrtc.org/42224904")]] //
|
||||
static std::unique_ptr<RtpRtcp>
|
||||
Create(const Environment& env, const Configuration& configuration);
|
||||
|
||||
// Process any pending tasks such as timeouts.
|
||||
virtual void Process() = 0;
|
||||
|
||||
@ -57,12 +57,24 @@ ModuleRtpRtcpImpl::RtpSenderContext::RtpSenderContext(
|
||||
&packet_history,
|
||||
config.paced_sender ? config.paced_sender : &non_paced_sender) {}
|
||||
|
||||
std::unique_ptr<RtpRtcp> RtpRtcp::DEPRECATED_Create(
|
||||
const Configuration& configuration) {
|
||||
std::unique_ptr<RtpRtcp> RtpRtcp::Create(const Configuration& configuration) {
|
||||
RTC_DCHECK(configuration.clock);
|
||||
return std::make_unique<ModuleRtpRtcpImpl>(configuration);
|
||||
}
|
||||
|
||||
std::unique_ptr<RtpRtcp> RtpRtcp::Create(const Environment& env,
|
||||
const Configuration& configuration) {
|
||||
RTC_DCHECK(configuration.field_trials == nullptr);
|
||||
RTC_DCHECK(configuration.clock == nullptr);
|
||||
RTC_DCHECK(configuration.event_log == nullptr);
|
||||
|
||||
Configuration config = configuration;
|
||||
config.field_trials = &env.field_trials();
|
||||
config.clock = &env.clock();
|
||||
config.event_log = &env.event_log();
|
||||
return std::make_unique<ModuleRtpRtcpImpl>(config);
|
||||
}
|
||||
|
||||
ModuleRtpRtcpImpl::ModuleRtpRtcpImpl(const Configuration& configuration)
|
||||
: rtcp_sender_(
|
||||
RTCPSender::Configuration::FromRtpRtcpConfiguration(configuration)),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user