Propagate Environment to RtpRtcp module in FlexfecReceiver
No-Iwyu: suggests too many changes, better address them separately. Bug: webrtc:362762208 Change-Id: I0b8ce423470d86f96412cb508c1d125bf81a570f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361141 Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Åsa Persson <asapersson@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42909}
This commit is contained in:
parent
164b3b3fce
commit
4e41db264b
@ -293,6 +293,7 @@ rtc_library("call") {
|
||||
"../api:sequence_checker",
|
||||
"../api:simulated_network_api",
|
||||
"../api:transport_api",
|
||||
"../api/environment",
|
||||
"../api/rtc_event_log",
|
||||
"../api/task_queue:pending_task_safety_flag",
|
||||
"../api/transport:network_control",
|
||||
|
||||
@ -1054,7 +1054,7 @@ FlexfecReceiveStream* Call::CreateFlexfecReceiveStream(
|
||||
// OnRtpPacket until the constructor is finished and the object is
|
||||
// in a valid state, since OnRtpPacket runs on the same thread.
|
||||
FlexfecReceiveStreamImpl* receive_stream = new FlexfecReceiveStreamImpl(
|
||||
&env_.clock(), std::move(config), &video_receiver_controller_,
|
||||
env_, std::move(config), &video_receiver_controller_,
|
||||
call_stats_->AsRtcpRttStats());
|
||||
|
||||
// TODO(bugs.webrtc.org/11993): Set this up asynchronously on the network
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
|
||||
#include "api/array_view.h"
|
||||
#include "api/call/transport.h"
|
||||
#include "api/environment/environment.h"
|
||||
#include "api/rtp_parameters.h"
|
||||
#include "call/rtp_stream_receiver_controller_interface.h"
|
||||
#include "modules/rtp_rtcp/include/flexfec_receiver.h"
|
||||
@ -25,7 +26,6 @@
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
#include "system_wrappers/include/clock.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -100,45 +100,33 @@ std::unique_ptr<FlexfecReceiver> MaybeCreateFlexfecReceiver(
|
||||
recovered_packet_receiver));
|
||||
}
|
||||
|
||||
std::unique_ptr<ModuleRtpRtcpImpl2> CreateRtpRtcpModule(
|
||||
Clock* clock,
|
||||
ReceiveStatistics* receive_statistics,
|
||||
const FlexfecReceiveStreamImpl::Config& config,
|
||||
RtcpRttStats* rtt_stats) {
|
||||
RtpRtcpInterface::Configuration configuration;
|
||||
configuration.audio = false;
|
||||
configuration.receiver_only = true;
|
||||
configuration.clock = clock;
|
||||
configuration.receive_statistics = receive_statistics;
|
||||
configuration.outgoing_transport = config.rtcp_send_transport;
|
||||
configuration.rtt_stats = rtt_stats;
|
||||
configuration.local_media_ssrc = config.rtp.local_ssrc;
|
||||
return ModuleRtpRtcpImpl2::Create(configuration);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
FlexfecReceiveStreamImpl::FlexfecReceiveStreamImpl(
|
||||
Clock* clock,
|
||||
const Environment& env,
|
||||
Config config,
|
||||
RecoveredPacketReceiver* recovered_packet_receiver,
|
||||
RtcpRttStats* rtt_stats)
|
||||
: remote_ssrc_(config.rtp.remote_ssrc),
|
||||
payload_type_(config.payload_type),
|
||||
receiver_(
|
||||
MaybeCreateFlexfecReceiver(clock, config, recovered_packet_receiver)),
|
||||
rtp_receive_statistics_(ReceiveStatistics::Create(clock)),
|
||||
rtp_rtcp_(CreateRtpRtcpModule(clock,
|
||||
rtp_receive_statistics_.get(),
|
||||
config,
|
||||
rtt_stats)) {
|
||||
receiver_(MaybeCreateFlexfecReceiver(&env.clock(),
|
||||
config,
|
||||
recovered_packet_receiver)),
|
||||
rtp_receive_statistics_(ReceiveStatistics::Create(&env.clock())),
|
||||
rtp_rtcp_(env,
|
||||
{.audio = false,
|
||||
.receiver_only = true,
|
||||
.receive_statistics = rtp_receive_statistics_.get(),
|
||||
.outgoing_transport = config.rtcp_send_transport,
|
||||
.rtt_stats = rtt_stats,
|
||||
.local_media_ssrc = config.rtp.local_ssrc}) {
|
||||
RTC_LOG(LS_INFO) << "FlexfecReceiveStreamImpl: " << config.ToString();
|
||||
RTC_DCHECK_GE(payload_type_, -1);
|
||||
|
||||
packet_sequence_checker_.Detach();
|
||||
|
||||
// RTCP reporting.
|
||||
rtp_rtcp_->SetRTCPStatus(config.rtcp_mode);
|
||||
rtp_rtcp_.SetRTCPStatus(config.rtcp_mode);
|
||||
}
|
||||
|
||||
FlexfecReceiveStreamImpl::~FlexfecReceiveStreamImpl() {
|
||||
@ -192,10 +180,10 @@ int FlexfecReceiveStreamImpl::payload_type() const {
|
||||
|
||||
void FlexfecReceiveStreamImpl::SetLocalSsrc(uint32_t local_ssrc) {
|
||||
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
|
||||
if (local_ssrc == rtp_rtcp_->local_media_ssrc())
|
||||
if (local_ssrc == rtp_rtcp_.local_media_ssrc())
|
||||
return;
|
||||
|
||||
rtp_rtcp_->SetLocalSsrc(local_ssrc);
|
||||
rtp_rtcp_.SetLocalSsrc(local_ssrc);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -14,11 +14,11 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "api/environment/environment.h"
|
||||
#include "call/flexfec_receive_stream.h"
|
||||
#include "call/rtp_packet_sink_interface.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_impl2.h"
|
||||
#include "rtc_base/system/no_unique_address.h"
|
||||
#include "system_wrappers/include/clock.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -27,13 +27,12 @@ class ReceiveStatistics;
|
||||
class RecoveredPacketReceiver;
|
||||
class RtcpRttStats;
|
||||
class RtpPacketReceived;
|
||||
class RtpRtcp;
|
||||
class RtpStreamReceiverControllerInterface;
|
||||
class RtpStreamReceiverInterface;
|
||||
|
||||
class FlexfecReceiveStreamImpl : public FlexfecReceiveStream {
|
||||
public:
|
||||
FlexfecReceiveStreamImpl(Clock* clock,
|
||||
FlexfecReceiveStreamImpl(const Environment& env,
|
||||
Config config,
|
||||
RecoveredPacketReceiver* recovered_packet_receiver,
|
||||
RtcpRttStats* rtt_stats);
|
||||
@ -67,7 +66,7 @@ class FlexfecReceiveStreamImpl : public FlexfecReceiveStream {
|
||||
|
||||
void SetRtcpMode(RtcpMode mode) override {
|
||||
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
|
||||
rtp_rtcp_->SetRTCPStatus(mode);
|
||||
rtp_rtcp_.SetRTCPStatus(mode);
|
||||
}
|
||||
|
||||
const ReceiveStatistics* GetStats() const override {
|
||||
@ -88,7 +87,7 @@ class FlexfecReceiveStreamImpl : public FlexfecReceiveStream {
|
||||
|
||||
// RTCP reporting.
|
||||
const std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_;
|
||||
const std::unique_ptr<ModuleRtpRtcpImpl2> rtp_rtcp_;
|
||||
ModuleRtpRtcpImpl2 rtp_rtcp_;
|
||||
|
||||
std::unique_ptr<RtpStreamReceiverInterface> rtp_stream_receiver_
|
||||
RTC_GUARDED_BY(packet_sequence_checker_);
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
|
||||
#include "api/array_view.h"
|
||||
#include "api/call/transport.h"
|
||||
#include "api/environment/environment_factory.h"
|
||||
#include "api/rtp_headers.h"
|
||||
#include "api/rtp_parameters.h"
|
||||
#include "call/flexfec_receive_stream_impl.h"
|
||||
@ -88,8 +89,7 @@ class FlexfecReceiveStreamTest : public ::testing::Test {
|
||||
FlexfecReceiveStreamTest()
|
||||
: config_(CreateDefaultConfig(&rtcp_send_transport_)) {
|
||||
receive_stream_ = std::make_unique<FlexfecReceiveStreamImpl>(
|
||||
Clock::GetRealTimeClock(), config_, &recovered_packet_receiver_,
|
||||
&rtt_stats_);
|
||||
CreateEnvironment(), config_, &recovered_packet_receiver_, &rtt_stats_);
|
||||
receive_stream_->RegisterWithTransport(&rtp_stream_receiver_controller_);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user