Propagate Environment to audio RtpRtcp modules
Bug: webrtc:362762208 Change-Id: I5be383dd709958cbefb06fe489c96e5ba6891bef Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361143 Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42904}
This commit is contained in:
parent
0b4b5b0ae8
commit
24366b0b4c
@ -563,12 +563,10 @@ ChannelReceive::ChannelReceive(
|
|||||||
|
|
||||||
rtp_receive_statistics_->EnableRetransmitDetection(remote_ssrc_, true);
|
rtp_receive_statistics_->EnableRetransmitDetection(remote_ssrc_, true);
|
||||||
RtpRtcpInterface::Configuration configuration;
|
RtpRtcpInterface::Configuration configuration;
|
||||||
configuration.clock = &env_.clock();
|
|
||||||
configuration.audio = true;
|
configuration.audio = true;
|
||||||
configuration.receiver_only = true;
|
configuration.receiver_only = true;
|
||||||
configuration.outgoing_transport = rtcp_send_transport;
|
configuration.outgoing_transport = rtcp_send_transport;
|
||||||
configuration.receive_statistics = rtp_receive_statistics_.get();
|
configuration.receive_statistics = rtp_receive_statistics_.get();
|
||||||
configuration.event_log = &env_.event_log();
|
|
||||||
configuration.local_media_ssrc = local_ssrc;
|
configuration.local_media_ssrc = local_ssrc;
|
||||||
configuration.rtcp_packet_type_counter_observer = this;
|
configuration.rtcp_packet_type_counter_observer = this;
|
||||||
configuration.non_sender_rtt_measurement = enable_non_sender_rtt;
|
configuration.non_sender_rtt_measurement = enable_non_sender_rtt;
|
||||||
@ -576,7 +574,7 @@ ChannelReceive::ChannelReceive(
|
|||||||
if (frame_transformer)
|
if (frame_transformer)
|
||||||
InitFrameTransformerDelegate(std::move(frame_transformer));
|
InitFrameTransformerDelegate(std::move(frame_transformer));
|
||||||
|
|
||||||
rtp_rtcp_ = ModuleRtpRtcpImpl2::Create(configuration);
|
rtp_rtcp_ = std::make_unique<ModuleRtpRtcpImpl2>(env_, configuration);
|
||||||
rtp_rtcp_->SetRemoteSSRC(remote_ssrc_);
|
rtp_rtcp_->SetRemoteSSRC(remote_ssrc_);
|
||||||
|
|
||||||
// Ensure that RTCP is enabled for the created channel.
|
// Ensure that RTCP is enabled for the created channel.
|
||||||
|
|||||||
@ -488,13 +488,10 @@ ChannelSend::ChannelSend(
|
|||||||
configuration.report_block_data_observer = this;
|
configuration.report_block_data_observer = this;
|
||||||
configuration.network_link_rtcp_observer =
|
configuration.network_link_rtcp_observer =
|
||||||
transport_controller->GetRtcpObserver();
|
transport_controller->GetRtcpObserver();
|
||||||
configuration.clock = &env_.clock();
|
|
||||||
configuration.audio = true;
|
configuration.audio = true;
|
||||||
configuration.outgoing_transport = rtp_transport;
|
configuration.outgoing_transport = rtp_transport;
|
||||||
|
|
||||||
configuration.paced_sender = rtp_packet_pacer_proxy_.get();
|
configuration.paced_sender = rtp_packet_pacer_proxy_.get();
|
||||||
|
|
||||||
configuration.event_log = &env_.event_log();
|
|
||||||
configuration.rtt_stats = rtcp_rtt_stats;
|
configuration.rtt_stats = rtcp_rtt_stats;
|
||||||
if (env_.field_trials().IsDisabled("WebRTC-DisableRtxRateLimiter")) {
|
if (env_.field_trials().IsDisabled("WebRTC-DisableRtxRateLimiter")) {
|
||||||
configuration.retransmission_rate_limiter =
|
configuration.retransmission_rate_limiter =
|
||||||
@ -503,15 +500,13 @@ ChannelSend::ChannelSend(
|
|||||||
configuration.extmap_allow_mixed = extmap_allow_mixed;
|
configuration.extmap_allow_mixed = extmap_allow_mixed;
|
||||||
configuration.rtcp_report_interval_ms = rtcp_report_interval_ms;
|
configuration.rtcp_report_interval_ms = rtcp_report_interval_ms;
|
||||||
configuration.rtcp_packet_type_counter_observer = this;
|
configuration.rtcp_packet_type_counter_observer = this;
|
||||||
|
|
||||||
configuration.local_media_ssrc = ssrc;
|
configuration.local_media_ssrc = ssrc;
|
||||||
configuration.field_trials = &env_.field_trials();
|
|
||||||
|
|
||||||
rtp_rtcp_ = ModuleRtpRtcpImpl2::Create(configuration);
|
rtp_rtcp_ = std::make_unique<ModuleRtpRtcpImpl2>(env_, configuration);
|
||||||
rtp_rtcp_->SetSendingMediaStatus(false);
|
rtp_rtcp_->SetSendingMediaStatus(false);
|
||||||
|
|
||||||
rtp_sender_audio_ = std::make_unique<RTPSenderAudio>(configuration.clock,
|
rtp_sender_audio_ =
|
||||||
rtp_rtcp_->RtpSender());
|
std::make_unique<RTPSenderAudio>(&env_.clock(), rtp_rtcp_->RtpSender());
|
||||||
|
|
||||||
// Ensure that RTCP is enabled by default for the created channel.
|
// Ensure that RTCP is enabled by default for the created channel.
|
||||||
rtp_rtcp_->SetRTCPStatus(RtcpMode::kCompound);
|
rtp_rtcp_->SetRTCPStatus(RtcpMode::kCompound);
|
||||||
|
|||||||
@ -39,14 +39,13 @@ AudioChannel::AudioChannel(
|
|||||||
receive_statistics_ = ReceiveStatistics::Create(&env.clock());
|
receive_statistics_ = ReceiveStatistics::Create(&env.clock());
|
||||||
|
|
||||||
RtpRtcpInterface::Configuration rtp_config;
|
RtpRtcpInterface::Configuration rtp_config;
|
||||||
rtp_config.clock = &env.clock();
|
|
||||||
rtp_config.audio = true;
|
rtp_config.audio = true;
|
||||||
rtp_config.receive_statistics = receive_statistics_.get();
|
rtp_config.receive_statistics = receive_statistics_.get();
|
||||||
rtp_config.rtcp_report_interval_ms = kRtcpReportIntervalMs;
|
rtp_config.rtcp_report_interval_ms = kRtcpReportIntervalMs;
|
||||||
rtp_config.outgoing_transport = transport;
|
rtp_config.outgoing_transport = transport;
|
||||||
rtp_config.local_media_ssrc = local_ssrc;
|
rtp_config.local_media_ssrc = local_ssrc;
|
||||||
|
|
||||||
rtp_rtcp_ = ModuleRtpRtcpImpl2::Create(rtp_config);
|
rtp_rtcp_ = std::make_unique<ModuleRtpRtcpImpl2>(env, rtp_config);
|
||||||
|
|
||||||
rtp_rtcp_->SetSendingMediaStatus(false);
|
rtp_rtcp_->SetSendingMediaStatus(false);
|
||||||
rtp_rtcp_->SetRTCPStatus(RtcpMode::kCompound);
|
rtp_rtcp_->SetRTCPStatus(RtcpMode::kCompound);
|
||||||
|
|||||||
@ -34,16 +34,15 @@ using ::testing::Invoke;
|
|||||||
using ::testing::NiceMock;
|
using ::testing::NiceMock;
|
||||||
using ::testing::Unused;
|
using ::testing::Unused;
|
||||||
|
|
||||||
std::unique_ptr<ModuleRtpRtcpImpl2> CreateRtpStack(Clock* clock,
|
std::unique_ptr<ModuleRtpRtcpImpl2> CreateRtpStack(const Environment& env,
|
||||||
Transport* transport,
|
Transport* transport,
|
||||||
uint32_t remote_ssrc) {
|
uint32_t remote_ssrc) {
|
||||||
RtpRtcpInterface::Configuration rtp_config;
|
RtpRtcpInterface::Configuration rtp_config;
|
||||||
rtp_config.clock = clock;
|
|
||||||
rtp_config.audio = true;
|
rtp_config.audio = true;
|
||||||
rtp_config.rtcp_report_interval_ms = 5000;
|
rtp_config.rtcp_report_interval_ms = 5000;
|
||||||
rtp_config.outgoing_transport = transport;
|
rtp_config.outgoing_transport = transport;
|
||||||
rtp_config.local_media_ssrc = remote_ssrc;
|
rtp_config.local_media_ssrc = remote_ssrc;
|
||||||
auto rtp_rtcp = ModuleRtpRtcpImpl2::Create(rtp_config);
|
auto rtp_rtcp = std::make_unique<ModuleRtpRtcpImpl2>(env, rtp_config);
|
||||||
rtp_rtcp->SetSendingMediaStatus(false);
|
rtp_rtcp->SetSendingMediaStatus(false);
|
||||||
rtp_rtcp->SetRTCPStatus(RtcpMode::kCompound);
|
rtp_rtcp->SetRTCPStatus(RtcpMode::kCompound);
|
||||||
return rtp_rtcp;
|
return rtp_rtcp;
|
||||||
@ -68,8 +67,7 @@ class AudioEgressTest : public ::testing::Test {
|
|||||||
// Prepare test on audio egress by using PCMu codec with specific
|
// Prepare test on audio egress by using PCMu codec with specific
|
||||||
// sequence number and its status to be running.
|
// sequence number and its status to be running.
|
||||||
void SetUp() override {
|
void SetUp() override {
|
||||||
rtp_rtcp_ =
|
rtp_rtcp_ = CreateRtpStack(env_, &transport_, kRemoteSsrc);
|
||||||
CreateRtpStack(time_controller_.GetClock(), &transport_, kRemoteSsrc);
|
|
||||||
egress_ = std::make_unique<AudioEgress>(env_, rtp_rtcp_.get());
|
egress_ = std::make_unique<AudioEgress>(env_, rtp_rtcp_.get());
|
||||||
constexpr int kPcmuPayload = 0;
|
constexpr int kPcmuPayload = 0;
|
||||||
egress_->SetEncoder(kPcmuPayload, kPcmuFormat,
|
egress_->SetEncoder(kPcmuPayload, kPcmuFormat,
|
||||||
|
|||||||
@ -46,13 +46,12 @@ class AudioIngressTest : public ::testing::Test {
|
|||||||
ReceiveStatistics::Create(time_controller_.GetClock());
|
ReceiveStatistics::Create(time_controller_.GetClock());
|
||||||
|
|
||||||
RtpRtcpInterface::Configuration rtp_config;
|
RtpRtcpInterface::Configuration rtp_config;
|
||||||
rtp_config.clock = time_controller_.GetClock();
|
|
||||||
rtp_config.audio = true;
|
rtp_config.audio = true;
|
||||||
rtp_config.receive_statistics = receive_statistics_.get();
|
rtp_config.receive_statistics = receive_statistics_.get();
|
||||||
rtp_config.rtcp_report_interval_ms = 5000;
|
rtp_config.rtcp_report_interval_ms = 5000;
|
||||||
rtp_config.outgoing_transport = &transport_;
|
rtp_config.outgoing_transport = &transport_;
|
||||||
rtp_config.local_media_ssrc = 0xdeadc0de;
|
rtp_config.local_media_ssrc = 0xdeadc0de;
|
||||||
rtp_rtcp_ = ModuleRtpRtcpImpl2::Create(rtp_config);
|
rtp_rtcp_ = std::make_unique<ModuleRtpRtcpImpl2>(env_, rtp_config);
|
||||||
|
|
||||||
rtp_rtcp_->SetSendingMediaStatus(false);
|
rtp_rtcp_->SetSendingMediaStatus(false);
|
||||||
rtp_rtcp_->SetRTCPStatus(RtcpMode::kCompound);
|
rtp_rtcp_->SetRTCPStatus(RtcpMode::kCompound);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user