mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
Remove dependency from RtpRtcp on the Module interface.
The 'Module' part of the implementation must not be called via the RtpRtcp interface, but is rather a part of the contract with ProcessThread. That in turn is an implementation detail for how timers are currently implemented in the default implementation. Along the way I'm deprecating away the factory function which was inside the interface and tied it to one specific implementation. Instead, I'm moving that to the implementation itself and down the line, we don't have to go through it if we just want to create an instance of the class. The key change is in rtp_rtcp.h and the new rtp_rtcp_interface.h header file (things moved from rtp_rtcp.h), the rest falls from that. Change-Id: I294f13e947b9e3e4e649400ee94a11a81e8071ce Bug: webrtc:11581 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176419 Reviewed-by: Magnus Flodman <mflodman@webrtc.org> Commit-Queue: Tommi <tommi@webrtc.org> Cr-Commit-Position: refs/heads/master@{#31440}
This commit is contained in:
parent
4d75d9c04c
commit
f25761d798
54 changed files with 718 additions and 704 deletions
|
@ -20,7 +20,7 @@
|
|||
#include "call/audio_send_stream.h"
|
||||
#include "call/audio_state.h"
|
||||
#include "call/bitrate_allocator.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/experiments/struct_parameters_parser.h"
|
||||
#include "rtc_base/race_checker.h"
|
||||
|
@ -175,7 +175,7 @@ class AudioSendStream final : public webrtc::AudioSendStream,
|
|||
RTC_GUARDED_BY(worker_queue_);
|
||||
RtpTransportControllerSendInterface* const rtp_transport_;
|
||||
|
||||
RtpRtcp* const rtp_rtcp_module_;
|
||||
RtpRtcpInterface* const rtp_rtcp_module_;
|
||||
absl::optional<RtpState> const suspended_rtp_state_;
|
||||
|
||||
// RFC 5285: Each distinct extension MUST have a unique ID. The value 0 is
|
||||
|
|
|
@ -203,7 +203,7 @@ struct ConfigHelper {
|
|||
return *static_cast<MockAudioEncoderFactory*>(
|
||||
stream_config_.encoder_factory.get());
|
||||
}
|
||||
MockRtpRtcp* rtp_rtcp() { return &rtp_rtcp_; }
|
||||
MockRtpRtcpInterface* rtp_rtcp() { return &rtp_rtcp_; }
|
||||
MockChannelSend* channel_send() { return channel_send_; }
|
||||
RtpTransportControllerSendInterface* transport() { return &rtp_transport_; }
|
||||
|
||||
|
@ -332,7 +332,7 @@ struct ConfigHelper {
|
|||
::testing::StrictMock<MockRtcpBandwidthObserver> bandwidth_observer_;
|
||||
::testing::NiceMock<MockRtcEventLog> event_log_;
|
||||
::testing::NiceMock<MockRtpTransportControllerSend> rtp_transport_;
|
||||
::testing::NiceMock<MockRtpRtcp> rtp_rtcp_;
|
||||
::testing::NiceMock<MockRtpRtcpInterface> rtp_rtcp_;
|
||||
::testing::NiceMock<MockLimitObserver> limit_observer_;
|
||||
BitrateAllocator bitrate_allocator_;
|
||||
// |worker_queue| is defined last to ensure all pending tasks are cancelled
|
||||
|
|
|
@ -216,7 +216,7 @@ class ChannelReceive : public ChannelReceiveInterface {
|
|||
std::map<uint8_t, int> payload_type_frequencies_;
|
||||
|
||||
std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_;
|
||||
std::unique_ptr<RtpRtcp> _rtpRtcpModule;
|
||||
std::unique_ptr<ModuleRtpRtcpImpl2> rtp_rtcp_;
|
||||
const uint32_t remote_ssrc_;
|
||||
|
||||
// Info for GetSyncInfo is updated on network or worker thread, and queried on
|
||||
|
@ -297,7 +297,7 @@ void ChannelReceive::OnReceivedPayloadData(
|
|||
}
|
||||
|
||||
int64_t round_trip_time = 0;
|
||||
_rtpRtcpModule->RTT(remote_ssrc_, &round_trip_time, NULL, NULL, NULL);
|
||||
rtp_rtcp_->RTT(remote_ssrc_, &round_trip_time, NULL, NULL, NULL);
|
||||
|
||||
std::vector<uint16_t> nack_list = acm_receiver_.GetNackList(round_trip_time);
|
||||
if (!nack_list.empty()) {
|
||||
|
@ -495,7 +495,7 @@ ChannelReceive::ChannelReceive(
|
|||
_outputAudioLevel.ResetLevelFullRange();
|
||||
|
||||
rtp_receive_statistics_->EnableRetransmitDetection(remote_ssrc_, true);
|
||||
RtpRtcp::Configuration configuration;
|
||||
RtpRtcpInterface::Configuration configuration;
|
||||
configuration.clock = clock;
|
||||
configuration.audio = true;
|
||||
configuration.receiver_only = true;
|
||||
|
@ -507,14 +507,14 @@ ChannelReceive::ChannelReceive(
|
|||
if (frame_transformer)
|
||||
InitFrameTransformerDelegate(std::move(frame_transformer));
|
||||
|
||||
_rtpRtcpModule = ModuleRtpRtcpImpl2::Create(configuration);
|
||||
_rtpRtcpModule->SetSendingMediaStatus(false);
|
||||
_rtpRtcpModule->SetRemoteSSRC(remote_ssrc_);
|
||||
rtp_rtcp_ = ModuleRtpRtcpImpl2::Create(configuration);
|
||||
rtp_rtcp_->SetSendingMediaStatus(false);
|
||||
rtp_rtcp_->SetRemoteSSRC(remote_ssrc_);
|
||||
|
||||
_moduleProcessThreadPtr->RegisterModule(_rtpRtcpModule.get(), RTC_FROM_HERE);
|
||||
_moduleProcessThreadPtr->RegisterModule(rtp_rtcp_.get(), RTC_FROM_HERE);
|
||||
|
||||
// Ensure that RTCP is enabled for the created channel.
|
||||
_rtpRtcpModule->SetRTCPStatus(RtcpMode::kCompound);
|
||||
rtp_rtcp_->SetRTCPStatus(RtcpMode::kCompound);
|
||||
}
|
||||
|
||||
ChannelReceive::~ChannelReceive() {
|
||||
|
@ -527,7 +527,7 @@ ChannelReceive::~ChannelReceive() {
|
|||
StopPlayout();
|
||||
|
||||
if (_moduleProcessThreadPtr)
|
||||
_moduleProcessThreadPtr->DeRegisterModule(_rtpRtcpModule.get());
|
||||
_moduleProcessThreadPtr->DeRegisterModule(rtp_rtcp_.get());
|
||||
}
|
||||
|
||||
void ChannelReceive::SetSink(AudioSinkInterface* sink) {
|
||||
|
@ -659,7 +659,7 @@ void ChannelReceive::ReceivedRTCPPacket(const uint8_t* data, size_t length) {
|
|||
UpdatePlayoutTimestamp(true, rtc::TimeMillis());
|
||||
|
||||
// Deliver RTCP packet to RTP/RTCP module for parsing
|
||||
_rtpRtcpModule->IncomingRtcpPacket(data, length);
|
||||
rtp_rtcp_->IncomingRtcpPacket(data, length);
|
||||
|
||||
int64_t rtt = GetRTT();
|
||||
if (rtt == 0) {
|
||||
|
@ -670,8 +670,8 @@ void ChannelReceive::ReceivedRTCPPacket(const uint8_t* data, size_t length) {
|
|||
uint32_t ntp_secs = 0;
|
||||
uint32_t ntp_frac = 0;
|
||||
uint32_t rtp_timestamp = 0;
|
||||
if (0 != _rtpRtcpModule->RemoteNTP(&ntp_secs, &ntp_frac, NULL, NULL,
|
||||
&rtp_timestamp)) {
|
||||
if (0 !=
|
||||
rtp_rtcp_->RemoteNTP(&ntp_secs, &ntp_frac, NULL, NULL, &rtp_timestamp)) {
|
||||
// Waiting for RTCP.
|
||||
return;
|
||||
}
|
||||
|
@ -709,14 +709,14 @@ void ChannelReceive::RegisterReceiverCongestionControlObjects(
|
|||
RTC_DCHECK(packet_router);
|
||||
RTC_DCHECK(!packet_router_);
|
||||
constexpr bool remb_candidate = false;
|
||||
packet_router->AddReceiveRtpModule(_rtpRtcpModule.get(), remb_candidate);
|
||||
packet_router->AddReceiveRtpModule(rtp_rtcp_.get(), remb_candidate);
|
||||
packet_router_ = packet_router;
|
||||
}
|
||||
|
||||
void ChannelReceive::ResetReceiverCongestionControlObjects() {
|
||||
RTC_DCHECK(worker_thread_checker_.IsCurrent());
|
||||
RTC_DCHECK(packet_router_);
|
||||
packet_router_->RemoveReceiveRtpModule(_rtpRtcpModule.get());
|
||||
packet_router_->RemoveReceiveRtpModule(rtp_rtcp_.get());
|
||||
packet_router_ = nullptr;
|
||||
}
|
||||
|
||||
|
@ -781,7 +781,7 @@ void ChannelReceive::SetNACKStatus(bool enable, int max_packets) {
|
|||
// Called when we are missing one or more packets.
|
||||
int ChannelReceive::ResendPackets(const uint16_t* sequence_numbers,
|
||||
int length) {
|
||||
return _rtpRtcpModule->SendNACK(sequence_numbers, length);
|
||||
return rtp_rtcp_->SendNACK(sequence_numbers, length);
|
||||
}
|
||||
|
||||
void ChannelReceive::SetAssociatedSendChannel(
|
||||
|
@ -877,9 +877,9 @@ int ChannelReceive::GetBaseMinimumPlayoutDelayMs() const {
|
|||
absl::optional<Syncable::Info> ChannelReceive::GetSyncInfo() const {
|
||||
RTC_DCHECK(module_process_thread_checker_.IsCurrent());
|
||||
Syncable::Info info;
|
||||
if (_rtpRtcpModule->RemoteNTP(&info.capture_time_ntp_secs,
|
||||
&info.capture_time_ntp_frac, nullptr, nullptr,
|
||||
&info.capture_time_source_clock) != 0) {
|
||||
if (rtp_rtcp_->RemoteNTP(&info.capture_time_ntp_secs,
|
||||
&info.capture_time_ntp_frac, nullptr, nullptr,
|
||||
&info.capture_time_source_clock) != 0) {
|
||||
return absl::nullopt;
|
||||
}
|
||||
{
|
||||
|
@ -942,7 +942,7 @@ int ChannelReceive::GetRtpTimestampRateHz() const {
|
|||
|
||||
int64_t ChannelReceive::GetRTT() const {
|
||||
std::vector<RTCPReportBlock> report_blocks;
|
||||
_rtpRtcpModule->RemoteRTCPStat(&report_blocks);
|
||||
rtp_rtcp_->RemoteRTCPStat(&report_blocks);
|
||||
|
||||
// TODO(nisse): Could we check the return value from the ->RTT() call below,
|
||||
// instead of checking if we have any report blocks?
|
||||
|
@ -961,8 +961,7 @@ int64_t ChannelReceive::GetRTT() const {
|
|||
int64_t min_rtt = 0;
|
||||
// TODO(nisse): This method computes RTT based on sender reports, even though
|
||||
// a receive stream is not supposed to do that.
|
||||
if (_rtpRtcpModule->RTT(remote_ssrc_, &rtt, &avg_rtt, &min_rtt, &max_rtt) !=
|
||||
0) {
|
||||
if (rtp_rtcp_->RTT(remote_ssrc_, &rtt, &avg_rtt, &min_rtt, &max_rtt) != 0) {
|
||||
return 0;
|
||||
}
|
||||
return rtt;
|
||||
|
|
|
@ -107,7 +107,7 @@ class ChannelSend : public ChannelSendInterface,
|
|||
ANAStats GetANAStatistics() const override;
|
||||
|
||||
// Used by AudioSendStream.
|
||||
RtpRtcp* GetRtpRtcp() const override;
|
||||
RtpRtcpInterface* GetRtpRtcp() const override;
|
||||
|
||||
void RegisterCngPayloadType(int payload_type, int payload_frequency) override;
|
||||
|
||||
|
@ -192,7 +192,7 @@ class ChannelSend : public ChannelSendInterface,
|
|||
|
||||
RtcEventLog* const event_log_;
|
||||
|
||||
std::unique_ptr<RtpRtcp> _rtpRtcpModule;
|
||||
std::unique_ptr<ModuleRtpRtcpImpl2> rtp_rtcp_;
|
||||
std::unique_ptr<RTPSenderAudio> rtp_sender_audio_;
|
||||
|
||||
std::unique_ptr<AudioCodingModule> audio_coding_;
|
||||
|
@ -389,9 +389,9 @@ int32_t ChannelSend::SendData(AudioFrameType frameType,
|
|||
// Asynchronously transform the payload before sending it. After the payload
|
||||
// is transformed, the delegate will call SendRtpAudio to send it.
|
||||
frame_transformer_delegate_->Transform(
|
||||
frameType, payloadType, rtp_timestamp, _rtpRtcpModule->StartTimestamp(),
|
||||
frameType, payloadType, rtp_timestamp, rtp_rtcp_->StartTimestamp(),
|
||||
payloadData, payloadSize, absolute_capture_timestamp_ms,
|
||||
_rtpRtcpModule->SSRC());
|
||||
rtp_rtcp_->SSRC());
|
||||
return 0;
|
||||
}
|
||||
return SendRtpAudio(frameType, payloadType, rtp_timestamp, payload,
|
||||
|
@ -428,7 +428,7 @@ int32_t ChannelSend::SendRtpAudio(AudioFrameType frameType,
|
|||
// Encrypt the audio payload into the buffer.
|
||||
size_t bytes_written = 0;
|
||||
int encrypt_status = frame_encryptor_->Encrypt(
|
||||
cricket::MEDIA_TYPE_AUDIO, _rtpRtcpModule->SSRC(),
|
||||
cricket::MEDIA_TYPE_AUDIO, rtp_rtcp_->SSRC(),
|
||||
/*additional_data=*/nullptr, payload, encrypted_audio_payload,
|
||||
&bytes_written);
|
||||
if (encrypt_status != 0) {
|
||||
|
@ -450,12 +450,12 @@ int32_t ChannelSend::SendRtpAudio(AudioFrameType frameType,
|
|||
|
||||
// Push data from ACM to RTP/RTCP-module to deliver audio frame for
|
||||
// packetization.
|
||||
if (!_rtpRtcpModule->OnSendingRtpFrame(rtp_timestamp,
|
||||
// Leaving the time when this frame was
|
||||
// received from the capture device as
|
||||
// undefined for voice for now.
|
||||
-1, payloadType,
|
||||
/*force_sender_report=*/false)) {
|
||||
if (!rtp_rtcp_->OnSendingRtpFrame(rtp_timestamp,
|
||||
// Leaving the time when this frame was
|
||||
// received from the capture device as
|
||||
// undefined for voice for now.
|
||||
-1, payloadType,
|
||||
/*force_sender_report=*/false)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -467,9 +467,8 @@ int32_t ChannelSend::SendRtpAudio(AudioFrameType frameType,
|
|||
|
||||
// This call will trigger Transport::SendPacket() from the RTP/RTCP module.
|
||||
if (!rtp_sender_audio_->SendAudio(
|
||||
frameType, payloadType,
|
||||
rtp_timestamp + _rtpRtcpModule->StartTimestamp(), payload.data(),
|
||||
payload.size(), absolute_capture_timestamp_ms)) {
|
||||
frameType, payloadType, rtp_timestamp + rtp_rtcp_->StartTimestamp(),
|
||||
payload.data(), payload.size(), absolute_capture_timestamp_ms)) {
|
||||
RTC_DLOG(LS_ERROR)
|
||||
<< "ChannelSend::SendData() failed to send data to RTP/RTCP module";
|
||||
return -1;
|
||||
|
@ -513,7 +512,7 @@ ChannelSend::ChannelSend(
|
|||
|
||||
audio_coding_.reset(AudioCodingModule::Create(AudioCodingModule::Config()));
|
||||
|
||||
RtpRtcp::Configuration configuration;
|
||||
RtpRtcpInterface::Configuration configuration;
|
||||
configuration.bandwidth_callback = rtcp_observer_.get();
|
||||
configuration.transport_feedback_callback = feedback_observer_proxy_.get();
|
||||
configuration.clock = (clock ? clock : Clock::GetRealTimeClock());
|
||||
|
@ -531,16 +530,16 @@ ChannelSend::ChannelSend(
|
|||
|
||||
configuration.local_media_ssrc = ssrc;
|
||||
|
||||
_rtpRtcpModule = ModuleRtpRtcpImpl2::Create(configuration);
|
||||
_rtpRtcpModule->SetSendingMediaStatus(false);
|
||||
rtp_rtcp_ = ModuleRtpRtcpImpl2::Create(configuration);
|
||||
rtp_rtcp_->SetSendingMediaStatus(false);
|
||||
|
||||
rtp_sender_audio_ = std::make_unique<RTPSenderAudio>(
|
||||
configuration.clock, _rtpRtcpModule->RtpSender());
|
||||
rtp_sender_audio_ = std::make_unique<RTPSenderAudio>(configuration.clock,
|
||||
rtp_rtcp_->RtpSender());
|
||||
|
||||
_moduleProcessThreadPtr->RegisterModule(_rtpRtcpModule.get(), RTC_FROM_HERE);
|
||||
_moduleProcessThreadPtr->RegisterModule(rtp_rtcp_.get(), RTC_FROM_HERE);
|
||||
|
||||
// Ensure that RTCP is enabled by default for the created channel.
|
||||
_rtpRtcpModule->SetRTCPStatus(RtcpMode::kCompound);
|
||||
rtp_rtcp_->SetRTCPStatus(RtcpMode::kCompound);
|
||||
|
||||
int error = audio_coding_->RegisterTransportCallback(this);
|
||||
RTC_DCHECK_EQ(0, error);
|
||||
|
@ -560,7 +559,7 @@ ChannelSend::~ChannelSend() {
|
|||
RTC_DCHECK_EQ(0, error);
|
||||
|
||||
if (_moduleProcessThreadPtr)
|
||||
_moduleProcessThreadPtr->DeRegisterModule(_rtpRtcpModule.get());
|
||||
_moduleProcessThreadPtr->DeRegisterModule(rtp_rtcp_.get());
|
||||
}
|
||||
|
||||
void ChannelSend::StartSend() {
|
||||
|
@ -568,8 +567,8 @@ void ChannelSend::StartSend() {
|
|||
RTC_DCHECK(!sending_);
|
||||
sending_ = true;
|
||||
|
||||
_rtpRtcpModule->SetSendingMediaStatus(true);
|
||||
int ret = _rtpRtcpModule->SetSendingStatus(true);
|
||||
rtp_rtcp_->SetSendingMediaStatus(true);
|
||||
int ret = rtp_rtcp_->SetSendingStatus(true);
|
||||
RTC_DCHECK_EQ(0, ret);
|
||||
// It is now OK to start processing on the encoder task queue.
|
||||
encoder_queue_.PostTask([this] {
|
||||
|
@ -595,10 +594,10 @@ void ChannelSend::StopSend() {
|
|||
|
||||
// Reset sending SSRC and sequence number and triggers direct transmission
|
||||
// of RTCP BYE
|
||||
if (_rtpRtcpModule->SetSendingStatus(false) == -1) {
|
||||
if (rtp_rtcp_->SetSendingStatus(false) == -1) {
|
||||
RTC_DLOG(LS_ERROR) << "StartSend() RTP/RTCP failed to stop sending";
|
||||
}
|
||||
_rtpRtcpModule->SetSendingMediaStatus(false);
|
||||
rtp_rtcp_->SetSendingMediaStatus(false);
|
||||
}
|
||||
|
||||
void ChannelSend::SetEncoder(int payload_type,
|
||||
|
@ -609,8 +608,8 @@ void ChannelSend::SetEncoder(int payload_type,
|
|||
|
||||
// The RTP/RTCP module needs to know the RTP timestamp rate (i.e. clockrate)
|
||||
// as well as some other things, so we collect this info and send it along.
|
||||
_rtpRtcpModule->RegisterSendPayloadFrequency(payload_type,
|
||||
encoder->RtpTimestampRateHz());
|
||||
rtp_rtcp_->RegisterSendPayloadFrequency(payload_type,
|
||||
encoder->RtpTimestampRateHz());
|
||||
rtp_sender_audio_->RegisterAudioPayload("audio", payload_type,
|
||||
encoder->RtpTimestampRateHz(),
|
||||
encoder->NumChannels(), 0);
|
||||
|
@ -665,7 +664,7 @@ void ChannelSend::OnUplinkPacketLossRate(float packet_loss_rate) {
|
|||
|
||||
void ChannelSend::ReceivedRTCPPacket(const uint8_t* data, size_t length) {
|
||||
// Deliver RTCP packet to RTP/RTCP module for parsing
|
||||
_rtpRtcpModule->IncomingRtcpPacket(data, length);
|
||||
rtp_rtcp_->IncomingRtcpPacket(data, length);
|
||||
|
||||
int64_t rtt = GetRTT();
|
||||
if (rtt == 0) {
|
||||
|
@ -714,7 +713,7 @@ bool ChannelSend::SendTelephoneEventOutband(int event, int duration_ms) {
|
|||
|
||||
void ChannelSend::RegisterCngPayloadType(int payload_type,
|
||||
int payload_frequency) {
|
||||
_rtpRtcpModule->RegisterSendPayloadFrequency(payload_type, payload_frequency);
|
||||
rtp_rtcp_->RegisterSendPayloadFrequency(payload_type, payload_frequency);
|
||||
rtp_sender_audio_->RegisterAudioPayload("CN", payload_type, payload_frequency,
|
||||
1, 0);
|
||||
}
|
||||
|
@ -724,7 +723,7 @@ void ChannelSend::SetSendTelephoneEventPayloadType(int payload_type,
|
|||
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
||||
RTC_DCHECK_LE(0, payload_type);
|
||||
RTC_DCHECK_GE(127, payload_type);
|
||||
_rtpRtcpModule->RegisterSendPayloadFrequency(payload_type, payload_frequency);
|
||||
rtp_rtcp_->RegisterSendPayloadFrequency(payload_type, payload_frequency);
|
||||
rtp_sender_audio_->RegisterAudioPayload("telephone-event", payload_type,
|
||||
payload_frequency, 0, 0);
|
||||
}
|
||||
|
@ -733,9 +732,9 @@ void ChannelSend::SetSendAudioLevelIndicationStatus(bool enable, int id) {
|
|||
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
||||
_includeAudioLevelIndication = enable;
|
||||
if (enable) {
|
||||
_rtpRtcpModule->RegisterRtpHeaderExtension(AudioLevel::kUri, id);
|
||||
rtp_rtcp_->RegisterRtpHeaderExtension(AudioLevel::kUri, id);
|
||||
} else {
|
||||
_rtpRtcpModule->DeregisterSendRtpHeaderExtension(AudioLevel::kUri);
|
||||
rtp_rtcp_->DeregisterSendRtpHeaderExtension(AudioLevel::kUri);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -756,19 +755,19 @@ void ChannelSend::RegisterSenderCongestionControlObjects(
|
|||
feedback_observer_proxy_->SetTransportFeedbackObserver(
|
||||
transport_feedback_observer);
|
||||
rtp_packet_pacer_proxy_->SetPacketPacer(rtp_packet_pacer);
|
||||
_rtpRtcpModule->SetStorePacketsStatus(true, 600);
|
||||
rtp_rtcp_->SetStorePacketsStatus(true, 600);
|
||||
constexpr bool remb_candidate = false;
|
||||
packet_router->AddSendRtpModule(_rtpRtcpModule.get(), remb_candidate);
|
||||
packet_router->AddSendRtpModule(rtp_rtcp_.get(), remb_candidate);
|
||||
packet_router_ = packet_router;
|
||||
}
|
||||
|
||||
void ChannelSend::ResetSenderCongestionControlObjects() {
|
||||
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
||||
RTC_DCHECK(packet_router_);
|
||||
_rtpRtcpModule->SetStorePacketsStatus(false, 600);
|
||||
rtp_rtcp_->SetStorePacketsStatus(false, 600);
|
||||
rtcp_observer_->SetBandwidthObserver(nullptr);
|
||||
feedback_observer_proxy_->SetTransportFeedbackObserver(nullptr);
|
||||
packet_router_->RemoveSendRtpModule(_rtpRtcpModule.get());
|
||||
packet_router_->RemoveSendRtpModule(rtp_rtcp_.get());
|
||||
packet_router_ = nullptr;
|
||||
rtp_packet_pacer_proxy_->SetPacketPacer(nullptr);
|
||||
}
|
||||
|
@ -777,7 +776,7 @@ void ChannelSend::SetRTCP_CNAME(absl::string_view c_name) {
|
|||
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
||||
// Note: SetCNAME() accepts a c string of length at most 255.
|
||||
const std::string c_name_limited(c_name.substr(0, 255));
|
||||
int ret = _rtpRtcpModule->SetCNAME(c_name_limited.c_str()) != 0;
|
||||
int ret = rtp_rtcp_->SetCNAME(c_name_limited.c_str()) != 0;
|
||||
RTC_DCHECK_EQ(0, ret) << "SetRTCP_CNAME() failed to set RTCP CNAME";
|
||||
}
|
||||
|
||||
|
@ -788,7 +787,7 @@ std::vector<ReportBlock> ChannelSend::GetRemoteRTCPReportBlocks() const {
|
|||
// report block according to RFC 3550.
|
||||
std::vector<RTCPReportBlock> rtcp_report_blocks;
|
||||
|
||||
int ret = _rtpRtcpModule->RemoteRTCPStat(&rtcp_report_blocks);
|
||||
int ret = rtp_rtcp_->RemoteRTCPStat(&rtcp_report_blocks);
|
||||
RTC_DCHECK_EQ(0, ret);
|
||||
|
||||
std::vector<ReportBlock> report_blocks;
|
||||
|
@ -817,7 +816,7 @@ CallSendStatistics ChannelSend::GetRTCPStatistics() const {
|
|||
|
||||
StreamDataCounters rtp_stats;
|
||||
StreamDataCounters rtx_stats;
|
||||
_rtpRtcpModule->GetSendStreamDataCounters(&rtp_stats, &rtx_stats);
|
||||
rtp_rtcp_->GetSendStreamDataCounters(&rtp_stats, &rtx_stats);
|
||||
stats.payload_bytes_sent =
|
||||
rtp_stats.transmitted.payload_bytes + rtx_stats.transmitted.payload_bytes;
|
||||
stats.header_and_padding_bytes_sent =
|
||||
|
@ -830,7 +829,7 @@ CallSendStatistics ChannelSend::GetRTCPStatistics() const {
|
|||
stats.packetsSent =
|
||||
rtp_stats.transmitted.packets + rtx_stats.transmitted.packets;
|
||||
stats.retransmitted_packets_sent = rtp_stats.retransmitted.packets;
|
||||
stats.report_block_datas = _rtpRtcpModule->GetLatestReportBlockData();
|
||||
stats.report_block_datas = rtp_rtcp_->GetLatestReportBlockData();
|
||||
|
||||
return stats;
|
||||
}
|
||||
|
@ -895,14 +894,14 @@ ANAStats ChannelSend::GetANAStatistics() const {
|
|||
return audio_coding_->GetANAStats();
|
||||
}
|
||||
|
||||
RtpRtcp* ChannelSend::GetRtpRtcp() const {
|
||||
RtpRtcpInterface* ChannelSend::GetRtpRtcp() const {
|
||||
RTC_DCHECK(module_process_thread_checker_.IsCurrent());
|
||||
return _rtpRtcpModule.get();
|
||||
return rtp_rtcp_.get();
|
||||
}
|
||||
|
||||
int64_t ChannelSend::GetRTT() const {
|
||||
std::vector<RTCPReportBlock> report_blocks;
|
||||
_rtpRtcpModule->RemoteRTCPStat(&report_blocks);
|
||||
rtp_rtcp_->RemoteRTCPStat(&report_blocks);
|
||||
|
||||
if (report_blocks.empty()) {
|
||||
return 0;
|
||||
|
@ -914,8 +913,8 @@ int64_t ChannelSend::GetRTT() const {
|
|||
int64_t min_rtt = 0;
|
||||
// We don't know in advance the remote ssrc used by the other end's receiver
|
||||
// reports, so use the SSRC of the first report block for calculating the RTT.
|
||||
if (_rtpRtcpModule->RTT(report_blocks[0].sender_ssrc, &rtt, &avg_rtt,
|
||||
&min_rtt, &max_rtt) != 0) {
|
||||
if (rtp_rtcp_->RTT(report_blocks[0].sender_ssrc, &rtt, &avg_rtt, &min_rtt,
|
||||
&max_rtt) != 0) {
|
||||
return 0;
|
||||
}
|
||||
return rtt;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "api/function_view.h"
|
||||
#include "api/task_queue/task_queue_factory.h"
|
||||
#include "modules/rtp_rtcp/include/report_block_data.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_sender_audio.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -30,7 +30,6 @@ namespace webrtc {
|
|||
class FrameEncryptorInterface;
|
||||
class ProcessThread;
|
||||
class RtcEventLog;
|
||||
class RtpRtcp;
|
||||
class RtpTransportControllerSendInterface;
|
||||
|
||||
struct CallSendStatistics {
|
||||
|
@ -97,7 +96,7 @@ class ChannelSendInterface {
|
|||
|
||||
virtual void ProcessAndEncodeAudio(
|
||||
std::unique_ptr<AudioFrame> audio_frame) = 0;
|
||||
virtual RtpRtcp* GetRtpRtcp() const = 0;
|
||||
virtual RtpRtcpInterface* GetRtpRtcp() const = 0;
|
||||
|
||||
// In RTP we currently rely on RTCP packets (|ReceivedRTCPPacket|) to inform
|
||||
// about RTT.
|
||||
|
|
|
@ -152,7 +152,7 @@ class MockChannelSend : public voe::ChannelSendInterface {
|
|||
ProcessAndEncodeAudio,
|
||||
(std::unique_ptr<AudioFrame>),
|
||||
(override));
|
||||
MOCK_METHOD(RtpRtcp*, GetRtpRtcp, (), (const, override));
|
||||
MOCK_METHOD(RtpRtcpInterface*, GetRtpRtcp, (), (const, override));
|
||||
MOCK_METHOD(int, GetBitrate, (), (const, override));
|
||||
MOCK_METHOD(int64_t, GetRTT, (), (const, override));
|
||||
MOCK_METHOD(void, StartSend, (), (override));
|
||||
|
|
|
@ -44,7 +44,7 @@ AudioChannel::AudioChannel(
|
|||
Clock* clock = Clock::GetRealTimeClock();
|
||||
receive_statistics_ = ReceiveStatistics::Create(clock);
|
||||
|
||||
RtpRtcp::Configuration rtp_config;
|
||||
RtpRtcpInterface::Configuration rtp_config;
|
||||
rtp_config.clock = clock;
|
||||
rtp_config.audio = true;
|
||||
rtp_config.receive_statistics = receive_statistics_.get();
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "api/voip/voip_base.h"
|
||||
#include "audio/voip/audio_egress.h"
|
||||
#include "audio/voip/audio_ingress.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_impl2.h"
|
||||
#include "modules/utility/include/process_thread.h"
|
||||
#include "rtc_base/critical_section.h"
|
||||
#include "rtc_base/ref_count.h"
|
||||
|
@ -88,7 +88,7 @@ class AudioChannel : public rtc::RefCountInterface {
|
|||
// Listed in order for safe destruction of AudioChannel object.
|
||||
// Synchronization for these are handled internally.
|
||||
std::unique_ptr<ReceiveStatistics> receive_statistics_;
|
||||
std::unique_ptr<RtpRtcp> rtp_rtcp_;
|
||||
std::unique_ptr<ModuleRtpRtcpImpl2> rtp_rtcp_;
|
||||
std::unique_ptr<AudioIngress> ingress_;
|
||||
std::unique_ptr<AudioEgress> egress_;
|
||||
};
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
namespace webrtc {
|
||||
|
||||
AudioEgress::AudioEgress(RtpRtcp* rtp_rtcp,
|
||||
AudioEgress::AudioEgress(RtpRtcpInterface* rtp_rtcp,
|
||||
Clock* clock,
|
||||
TaskQueueFactory* task_queue_factory)
|
||||
: rtp_rtcp_(rtp_rtcp),
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "call/audio_sender.h"
|
||||
#include "modules/audio_coding/include/audio_coding_module.h"
|
||||
#include "modules/rtp_rtcp/include/report_block_data.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_sender_audio.h"
|
||||
#include "rtc_base/task_queue.h"
|
||||
#include "rtc_base/thread_checker.h"
|
||||
|
@ -43,7 +43,7 @@ namespace webrtc {
|
|||
// smaller footprint.
|
||||
class AudioEgress : public AudioSender, public AudioPacketizationCallback {
|
||||
public:
|
||||
AudioEgress(RtpRtcp* rtp_rtcp,
|
||||
AudioEgress(RtpRtcpInterface* rtp_rtcp,
|
||||
Clock* clock,
|
||||
TaskQueueFactory* task_queue_factory);
|
||||
~AudioEgress() override;
|
||||
|
@ -109,7 +109,7 @@ class AudioEgress : public AudioSender, public AudioPacketizationCallback {
|
|||
absl::optional<SdpAudioFormat> encoder_format_ RTC_GUARDED_BY(lock_);
|
||||
|
||||
// Synchronization is handled internally by RtpRtcp.
|
||||
RtpRtcp* const rtp_rtcp_;
|
||||
RtpRtcpInterface* const rtp_rtcp_;
|
||||
|
||||
// Synchronization is handled internally by RTPSenderAudio.
|
||||
RTPSenderAudio rtp_sender_audio_;
|
||||
|
|
|
@ -36,7 +36,7 @@ AudioCodingModule::Config CreateAcmConfig(
|
|||
} // namespace
|
||||
|
||||
AudioIngress::AudioIngress(
|
||||
RtpRtcp* rtp_rtcp,
|
||||
RtpRtcpInterface* rtp_rtcp,
|
||||
Clock* clock,
|
||||
ReceiveStatistics* receive_statistics,
|
||||
rtc::scoped_refptr<AudioDecoderFactory> decoder_factory)
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
#include "modules/audio_coding/include/audio_coding_module.h"
|
||||
#include "modules/rtp_rtcp/include/receive_statistics.h"
|
||||
#include "modules/rtp_rtcp/include/remote_ntp_time_estimator.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_packet_received.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
|
||||
#include "rtc_base/critical_section.h"
|
||||
#include "rtc_base/time_utils.h"
|
||||
|
||||
|
@ -44,7 +44,7 @@ namespace webrtc {
|
|||
// smaller footprint.
|
||||
class AudioIngress : public AudioMixer::Source {
|
||||
public:
|
||||
AudioIngress(RtpRtcp* rtp_rtcp,
|
||||
AudioIngress(RtpRtcpInterface* rtp_rtcp,
|
||||
Clock* clock,
|
||||
ReceiveStatistics* receive_statistics,
|
||||
rtc::scoped_refptr<AudioDecoderFactory> decoder_factory);
|
||||
|
@ -122,8 +122,8 @@ class AudioIngress : public AudioMixer::Source {
|
|||
// Synchronizaton is handled internally by ReceiveStatistics.
|
||||
ReceiveStatistics* const rtp_receive_statistics_;
|
||||
|
||||
// Synchronizaton is handled internally by RtpRtcp.
|
||||
RtpRtcp* const rtp_rtcp_;
|
||||
// Synchronizaton is handled internally by RtpRtcpInterface.
|
||||
RtpRtcpInterface* const rtp_rtcp_;
|
||||
|
||||
// Synchronizaton is handled internally by acm2::AcmReceiver.
|
||||
acm2::AcmReceiver acm_receiver_;
|
||||
|
|
|
@ -28,10 +28,10 @@ using ::testing::Invoke;
|
|||
using ::testing::NiceMock;
|
||||
using ::testing::Unused;
|
||||
|
||||
std::unique_ptr<RtpRtcp> CreateRtpStack(Clock* clock,
|
||||
Transport* transport,
|
||||
uint32_t remote_ssrc) {
|
||||
RtpRtcp::Configuration rtp_config;
|
||||
std::unique_ptr<ModuleRtpRtcpImpl2> CreateRtpStack(Clock* clock,
|
||||
Transport* transport,
|
||||
uint32_t remote_ssrc) {
|
||||
RtpRtcpInterface::Configuration rtp_config;
|
||||
rtp_config.clock = clock;
|
||||
rtp_config.audio = true;
|
||||
rtp_config.rtcp_report_interval_ms = 5000;
|
||||
|
@ -101,7 +101,7 @@ class AudioEgressTest : public ::testing::Test {
|
|||
SimulatedClock fake_clock_;
|
||||
NiceMock<MockTransport> transport_;
|
||||
SineWaveGenerator wave_generator_;
|
||||
std::unique_ptr<RtpRtcp> rtp_rtcp_;
|
||||
std::unique_ptr<ModuleRtpRtcpImpl2> rtp_rtcp_;
|
||||
std::unique_ptr<TaskQueueFactory> task_queue_factory_;
|
||||
rtc::scoped_refptr<AudioEncoderFactory> encoder_factory_;
|
||||
std::unique_ptr<AudioEgress> egress_;
|
||||
|
|
|
@ -39,7 +39,7 @@ class AudioIngressTest : public ::testing::Test {
|
|||
: fake_clock_(123456789), wave_generator_(1000.0, kAudioLevel) {
|
||||
receive_statistics_ = ReceiveStatistics::Create(&fake_clock_);
|
||||
|
||||
RtpRtcp::Configuration rtp_config;
|
||||
RtpRtcpInterface::Configuration rtp_config;
|
||||
rtp_config.clock = &fake_clock_;
|
||||
rtp_config.audio = true;
|
||||
rtp_config.receive_statistics = receive_statistics_.get();
|
||||
|
@ -95,7 +95,7 @@ class AudioIngressTest : public ::testing::Test {
|
|||
SineWaveGenerator wave_generator_;
|
||||
NiceMock<MockTransport> transport_;
|
||||
std::unique_ptr<ReceiveStatistics> receive_statistics_;
|
||||
std::unique_ptr<RtpRtcp> rtp_rtcp_;
|
||||
std::unique_ptr<ModuleRtpRtcpImpl2> rtp_rtcp_;
|
||||
rtc::scoped_refptr<AudioEncoderFactory> encoder_factory_;
|
||||
rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_;
|
||||
std::unique_ptr<TaskQueueFactory> task_queue_factory_;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "call/audio_state.h"
|
||||
#include "modules/audio_device/include/mock_audio_device.h"
|
||||
#include "modules/audio_processing/include/mock_audio_processing.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
|
||||
#include "test/fake_encoder.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/mock_audio_decoder_factory.h"
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "modules/rtp_rtcp/include/flexfec_receiver.h"
|
||||
#include "modules/rtp_rtcp/include/receive_statistics.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_packet_received.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_impl2.h"
|
||||
#include "modules/utility/include/process_thread.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/location.h"
|
||||
|
@ -119,12 +118,12 @@ std::unique_ptr<FlexfecReceiver> MaybeCreateFlexfecReceiver(
|
|||
recovered_packet_receiver));
|
||||
}
|
||||
|
||||
std::unique_ptr<RtpRtcp> CreateRtpRtcpModule(
|
||||
std::unique_ptr<ModuleRtpRtcpImpl2> CreateRtpRtcpModule(
|
||||
Clock* clock,
|
||||
ReceiveStatistics* receive_statistics,
|
||||
const FlexfecReceiveStreamImpl::Config& config,
|
||||
RtcpRttStats* rtt_stats) {
|
||||
RtpRtcp::Configuration configuration;
|
||||
RtpRtcpInterface::Configuration configuration;
|
||||
configuration.audio = false;
|
||||
configuration.receiver_only = true;
|
||||
configuration.clock = clock;
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "call/flexfec_receive_stream.h"
|
||||
#include "call/rtp_packet_sink_interface.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_impl2.h"
|
||||
#include "system_wrappers/include/clock.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -55,7 +56,7 @@ class FlexfecReceiveStreamImpl : public FlexfecReceiveStream {
|
|||
|
||||
// RTCP reporting.
|
||||
const std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_;
|
||||
const std::unique_ptr<RtpRtcp> rtp_rtcp_;
|
||||
const std::unique_ptr<ModuleRtpRtcpImpl2> rtp_rtcp_;
|
||||
ProcessThread* process_thread_;
|
||||
|
||||
std::unique_ptr<RtpStreamReceiverInterface> rtp_stream_receiver_;
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace webrtc {
|
|||
namespace webrtc_internal_rtp_video_sender {
|
||||
|
||||
RtpStreamSender::RtpStreamSender(
|
||||
std::unique_ptr<RtpRtcp> rtp_rtcp,
|
||||
std::unique_ptr<ModuleRtpRtcpImpl2> rtp_rtcp,
|
||||
std::unique_ptr<RTPSenderVideo> sender_video,
|
||||
std::unique_ptr<VideoFecGenerator> fec_generator)
|
||||
: rtp_rtcp(std::move(rtp_rtcp)),
|
||||
|
@ -200,7 +200,7 @@ std::vector<RtpStreamSender> CreateRtpStreamSenders(
|
|||
const WebRtcKeyValueConfig& trials) {
|
||||
RTC_DCHECK_GT(rtp_config.ssrcs.size(), 0);
|
||||
|
||||
RtpRtcp::Configuration configuration;
|
||||
RtpRtcpInterface::Configuration configuration;
|
||||
configuration.clock = clock;
|
||||
configuration.audio = false;
|
||||
configuration.receiver_only = false;
|
||||
|
@ -253,7 +253,8 @@ std::vector<RtpStreamSender> CreateRtpStreamSenders(
|
|||
|
||||
configuration.need_rtp_packet_infos = rtp_config.lntf.enabled;
|
||||
|
||||
auto rtp_rtcp = ModuleRtpRtcpImpl2::Create(configuration);
|
||||
std::unique_ptr<ModuleRtpRtcpImpl2> rtp_rtcp(
|
||||
ModuleRtpRtcpImpl2::Create(configuration));
|
||||
rtp_rtcp->SetSendingStatus(false);
|
||||
rtp_rtcp->SetSendingMediaStatus(false);
|
||||
rtp_rtcp->SetRTCPStatus(RtcpMode::kCompound);
|
||||
|
@ -628,7 +629,7 @@ void RtpVideoSender::ConfigureSsrcs() {
|
|||
RTC_CHECK(ssrc_to_rtp_module_.empty());
|
||||
for (size_t i = 0; i < rtp_config_.ssrcs.size(); ++i) {
|
||||
uint32_t ssrc = rtp_config_.ssrcs[i];
|
||||
RtpRtcp* const rtp_rtcp = rtp_streams_[i].rtp_rtcp.get();
|
||||
RtpRtcpInterface* const rtp_rtcp = rtp_streams_[i].rtp_rtcp.get();
|
||||
|
||||
// Restore RTP state if previous existed.
|
||||
auto it = suspended_ssrcs_.find(ssrc);
|
||||
|
@ -645,7 +646,7 @@ void RtpVideoSender::ConfigureSsrcs() {
|
|||
RTC_DCHECK_EQ(rtp_config_.rtx.ssrcs.size(), rtp_config_.ssrcs.size());
|
||||
for (size_t i = 0; i < rtp_config_.rtx.ssrcs.size(); ++i) {
|
||||
uint32_t ssrc = rtp_config_.rtx.ssrcs[i];
|
||||
RtpRtcp* const rtp_rtcp = rtp_streams_[i].rtp_rtcp.get();
|
||||
RtpRtcpInterface* const rtp_rtcp = rtp_streams_[i].rtp_rtcp.get();
|
||||
auto it = suspended_ssrcs_.find(ssrc);
|
||||
if (it != suspended_ssrcs_.end())
|
||||
rtp_rtcp->SetRtxState(it->second);
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "call/rtp_transport_controller_send_interface.h"
|
||||
#include "call/rtp_video_sender_interface.h"
|
||||
#include "modules/rtp_rtcp/include/flexfec_sender.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_impl2.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_sender.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_sender_video.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_sequence_number_map.h"
|
||||
|
@ -44,14 +45,13 @@ namespace webrtc {
|
|||
|
||||
class FrameEncryptorInterface;
|
||||
class RTPFragmentationHeader;
|
||||
class RtpRtcp;
|
||||
class RtpTransportControllerSendInterface;
|
||||
|
||||
namespace webrtc_internal_rtp_video_sender {
|
||||
// RTP state for a single simulcast stream. Internal to the implementation of
|
||||
// RtpVideoSender.
|
||||
struct RtpStreamSender {
|
||||
RtpStreamSender(std::unique_ptr<RtpRtcp> rtp_rtcp,
|
||||
RtpStreamSender(std::unique_ptr<ModuleRtpRtcpImpl2> rtp_rtcp,
|
||||
std::unique_ptr<RTPSenderVideo> sender_video,
|
||||
std::unique_ptr<VideoFecGenerator> fec_generator);
|
||||
~RtpStreamSender();
|
||||
|
@ -60,7 +60,7 @@ struct RtpStreamSender {
|
|||
RtpStreamSender& operator=(RtpStreamSender&&) = default;
|
||||
|
||||
// Note: Needs pointer stability.
|
||||
std::unique_ptr<RtpRtcp> rtp_rtcp;
|
||||
std::unique_ptr<ModuleRtpRtcpImpl2> rtp_rtcp;
|
||||
std::unique_ptr<RTPSenderVideo> sender_video;
|
||||
std::unique_ptr<VideoFecGenerator> fec_generator;
|
||||
};
|
||||
|
@ -215,7 +215,7 @@ class RtpVideoSender : public RtpVideoSenderInterface,
|
|||
// Effectively const map from SSRC to RtpRtcp, for all media SSRCs.
|
||||
// This map is set at construction time and never changed, but it's
|
||||
// non-trivial to make it properly const.
|
||||
std::map<uint32_t, RtpRtcp*> ssrc_to_rtp_module_;
|
||||
std::map<uint32_t, RtpRtcpInterface*> ssrc_to_rtp_module_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(RtpVideoSender);
|
||||
};
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
#include <utility>
|
||||
|
||||
#include "absl/types/optional.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/time_utils.h"
|
||||
|
@ -53,7 +53,8 @@ PacketRouter::~PacketRouter() {
|
|||
RTC_DCHECK(active_remb_module_ == nullptr);
|
||||
}
|
||||
|
||||
void PacketRouter::AddSendRtpModule(RtpRtcp* rtp_module, bool remb_candidate) {
|
||||
void PacketRouter::AddSendRtpModule(RtpRtcpInterface* rtp_module,
|
||||
bool remb_candidate) {
|
||||
rtc::CritScope cs(&modules_crit_);
|
||||
|
||||
AddSendRtpModuleToMap(rtp_module, rtp_module->SSRC());
|
||||
|
@ -73,7 +74,8 @@ void PacketRouter::AddSendRtpModule(RtpRtcp* rtp_module, bool remb_candidate) {
|
|||
}
|
||||
}
|
||||
|
||||
void PacketRouter::AddSendRtpModuleToMap(RtpRtcp* rtp_module, uint32_t ssrc) {
|
||||
void PacketRouter::AddSendRtpModuleToMap(RtpRtcpInterface* rtp_module,
|
||||
uint32_t ssrc) {
|
||||
RTC_DCHECK(send_modules_map_.find(ssrc) == send_modules_map_.end());
|
||||
// Always keep the audio modules at the back of the list, so that when we
|
||||
// iterate over the modules in order to find one that can send padding we
|
||||
|
@ -94,7 +96,7 @@ void PacketRouter::RemoveSendRtpModuleFromMap(uint32_t ssrc) {
|
|||
send_modules_map_.erase(kv);
|
||||
}
|
||||
|
||||
void PacketRouter::RemoveSendRtpModule(RtpRtcp* rtp_module) {
|
||||
void PacketRouter::RemoveSendRtpModule(RtpRtcpInterface* rtp_module) {
|
||||
rtc::CritScope cs(&modules_crit_);
|
||||
MaybeRemoveRembModuleCandidate(rtp_module, /* media_sender = */ true);
|
||||
|
||||
|
@ -158,7 +160,7 @@ void PacketRouter::SendPacket(std::unique_ptr<RtpPacketToSend> packet,
|
|||
return;
|
||||
}
|
||||
|
||||
RtpRtcp* rtp_module = kv->second;
|
||||
RtpRtcpInterface* rtp_module = kv->second;
|
||||
if (!rtp_module->TrySendPacket(packet.get(), cluster_info)) {
|
||||
RTC_LOG(LS_WARNING) << "Failed to send packet, rejected by RTP module.";
|
||||
return;
|
||||
|
@ -193,7 +195,7 @@ std::vector<std::unique_ptr<RtpPacketToSend>> PacketRouter::GeneratePadding(
|
|||
// Iterate over all modules send module. Video modules will be at the front
|
||||
// and so will be prioritized. This is important since audio packets may not
|
||||
// be taken into account by the bandwidth estimator, e.g. in FF.
|
||||
for (RtpRtcp* rtp_module : send_modules_list_) {
|
||||
for (RtpRtcpInterface* rtp_module : send_modules_list_) {
|
||||
if (rtp_module->SupportsPadding()) {
|
||||
padding_packets = rtp_module->GeneratePadding(size.bytes());
|
||||
if (!padding_packets.empty()) {
|
||||
|
@ -296,7 +298,7 @@ bool PacketRouter::SendCombinedRtcpPacket(
|
|||
rtc::CritScope cs(&modules_crit_);
|
||||
|
||||
// Prefer send modules.
|
||||
for (RtpRtcp* rtp_module : send_modules_list_) {
|
||||
for (RtpRtcpInterface* rtp_module : send_modules_list_) {
|
||||
if (rtp_module->RTCP() == RtcpMode::kOff) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
namespace webrtc {
|
||||
|
||||
class RtpRtcp;
|
||||
class RtpRtcpInterface;
|
||||
|
||||
// PacketRouter keeps track of rtp send modules to support the pacer.
|
||||
// In addition, it handles feedback messages, which are sent on a send
|
||||
|
@ -47,8 +47,8 @@ class PacketRouter : public RemoteBitrateObserver,
|
|||
explicit PacketRouter(uint16_t start_transport_seq);
|
||||
~PacketRouter() override;
|
||||
|
||||
void AddSendRtpModule(RtpRtcp* rtp_module, bool remb_candidate);
|
||||
void RemoveSendRtpModule(RtpRtcp* rtp_module);
|
||||
void AddSendRtpModule(RtpRtcpInterface* rtp_module, bool remb_candidate);
|
||||
void RemoveSendRtpModule(RtpRtcpInterface* rtp_module);
|
||||
|
||||
void AddReceiveRtpModule(RtcpFeedbackSenderInterface* rtcp_sender,
|
||||
bool remb_candidate);
|
||||
|
@ -89,18 +89,18 @@ class PacketRouter : public RemoteBitrateObserver,
|
|||
bool media_sender) RTC_EXCLUSIVE_LOCKS_REQUIRED(modules_crit_);
|
||||
void UnsetActiveRembModule() RTC_EXCLUSIVE_LOCKS_REQUIRED(modules_crit_);
|
||||
void DetermineActiveRembModule() RTC_EXCLUSIVE_LOCKS_REQUIRED(modules_crit_);
|
||||
void AddSendRtpModuleToMap(RtpRtcp* rtp_module, uint32_t ssrc)
|
||||
void AddSendRtpModuleToMap(RtpRtcpInterface* rtp_module, uint32_t ssrc)
|
||||
RTC_EXCLUSIVE_LOCKS_REQUIRED(modules_crit_);
|
||||
void RemoveSendRtpModuleFromMap(uint32_t ssrc)
|
||||
RTC_EXCLUSIVE_LOCKS_REQUIRED(modules_crit_);
|
||||
|
||||
rtc::CriticalSection modules_crit_;
|
||||
// Ssrc to RtpRtcp module;
|
||||
std::unordered_map<uint32_t, RtpRtcp*> send_modules_map_
|
||||
// Ssrc to RtpRtcpInterface module;
|
||||
std::unordered_map<uint32_t, RtpRtcpInterface*> send_modules_map_
|
||||
RTC_GUARDED_BY(modules_crit_);
|
||||
std::list<RtpRtcp*> send_modules_list_ RTC_GUARDED_BY(modules_crit_);
|
||||
std::list<RtpRtcpInterface*> send_modules_list_ RTC_GUARDED_BY(modules_crit_);
|
||||
// The last module used to send media.
|
||||
RtpRtcp* last_send_module_ RTC_GUARDED_BY(modules_crit_);
|
||||
RtpRtcpInterface* last_send_module_ RTC_GUARDED_BY(modules_crit_);
|
||||
// Rtcp modules of the rtp receivers.
|
||||
std::vector<RtcpFeedbackSenderInterface*> rtcp_feedback_senders_
|
||||
RTC_GUARDED_BY(modules_crit_);
|
||||
|
|
|
@ -101,12 +101,12 @@ TEST_F(PacketRouterTest, GeneratePaddingPrioritizesRtx) {
|
|||
const uint16_t kSsrc1 = 1234;
|
||||
const uint16_t kSsrc2 = 4567;
|
||||
|
||||
NiceMock<MockRtpRtcp> rtp_1;
|
||||
NiceMock<MockRtpRtcpInterface> rtp_1;
|
||||
ON_CALL(rtp_1, RtxSendStatus()).WillByDefault(Return(kRtxRedundantPayloads));
|
||||
ON_CALL(rtp_1, SSRC()).WillByDefault(Return(kSsrc1));
|
||||
ON_CALL(rtp_1, SupportsPadding).WillByDefault(Return(false));
|
||||
|
||||
NiceMock<MockRtpRtcp> rtp_2;
|
||||
NiceMock<MockRtpRtcpInterface> rtp_2;
|
||||
ON_CALL(rtp_2, RtxSendStatus()).WillByDefault(Return(kRtxOff));
|
||||
ON_CALL(rtp_2, SSRC()).WillByDefault(Return(kSsrc2));
|
||||
ON_CALL(rtp_2, SupportsPadding).WillByDefault(Return(true));
|
||||
|
@ -143,13 +143,13 @@ TEST_F(PacketRouterTest, GeneratePaddingPrioritizesVideo) {
|
|||
kExpectedPaddingPackets);
|
||||
};
|
||||
|
||||
NiceMock<MockRtpRtcp> audio_module;
|
||||
NiceMock<MockRtpRtcpInterface> audio_module;
|
||||
ON_CALL(audio_module, RtxSendStatus()).WillByDefault(Return(kRtxOff));
|
||||
ON_CALL(audio_module, SSRC()).WillByDefault(Return(kSsrc1));
|
||||
ON_CALL(audio_module, SupportsPadding).WillByDefault(Return(true));
|
||||
ON_CALL(audio_module, IsAudioConfigured).WillByDefault(Return(true));
|
||||
|
||||
NiceMock<MockRtpRtcp> video_module;
|
||||
NiceMock<MockRtpRtcpInterface> video_module;
|
||||
ON_CALL(video_module, RtxSendStatus()).WillByDefault(Return(kRtxOff));
|
||||
ON_CALL(video_module, SSRC()).WillByDefault(Return(kSsrc2));
|
||||
ON_CALL(video_module, SupportsPadding).WillByDefault(Return(true));
|
||||
|
@ -195,7 +195,7 @@ TEST_F(PacketRouterTest, PadsOnLastActiveMediaStream) {
|
|||
const uint16_t kSsrc3 = 8901;
|
||||
|
||||
// First two rtp modules send media and have rtx.
|
||||
NiceMock<MockRtpRtcp> rtp_1;
|
||||
NiceMock<MockRtpRtcpInterface> rtp_1;
|
||||
EXPECT_CALL(rtp_1, SSRC()).WillRepeatedly(Return(kSsrc1));
|
||||
EXPECT_CALL(rtp_1, SupportsPadding).WillRepeatedly(Return(true));
|
||||
EXPECT_CALL(rtp_1, SupportsRtxPayloadPadding).WillRepeatedly(Return(true));
|
||||
|
@ -206,7 +206,7 @@ TEST_F(PacketRouterTest, PadsOnLastActiveMediaStream) {
|
|||
::testing::Pointee(Property(&RtpPacketToSend::Ssrc, kSsrc1)), _))
|
||||
.WillRepeatedly(Return(true));
|
||||
|
||||
NiceMock<MockRtpRtcp> rtp_2;
|
||||
NiceMock<MockRtpRtcpInterface> rtp_2;
|
||||
EXPECT_CALL(rtp_2, SSRC()).WillRepeatedly(Return(kSsrc2));
|
||||
EXPECT_CALL(rtp_2, SupportsPadding).WillRepeatedly(Return(true));
|
||||
EXPECT_CALL(rtp_2, SupportsRtxPayloadPadding).WillRepeatedly(Return(true));
|
||||
|
@ -218,7 +218,7 @@ TEST_F(PacketRouterTest, PadsOnLastActiveMediaStream) {
|
|||
.WillRepeatedly(Return(true));
|
||||
|
||||
// Third module is sending media, but does not support rtx.
|
||||
NiceMock<MockRtpRtcp> rtp_3;
|
||||
NiceMock<MockRtpRtcpInterface> rtp_3;
|
||||
EXPECT_CALL(rtp_3, SSRC()).WillRepeatedly(Return(kSsrc3));
|
||||
EXPECT_CALL(rtp_3, SupportsPadding).WillRepeatedly(Return(true));
|
||||
EXPECT_CALL(rtp_3, SupportsRtxPayloadPadding).WillRepeatedly(Return(false));
|
||||
|
@ -266,7 +266,7 @@ TEST_F(PacketRouterTest, PadsOnLastActiveMediaStream) {
|
|||
packet_router_.RemoveSendRtpModule(&rtp_2);
|
||||
|
||||
// Send on and then remove all remaining modules.
|
||||
RtpRtcp* last_send_module;
|
||||
RtpRtcpInterface* last_send_module;
|
||||
EXPECT_CALL(rtp_1, GeneratePadding(kPaddingBytes))
|
||||
.Times(1)
|
||||
.WillOnce([&](size_t target_size_bytes) {
|
||||
|
@ -298,7 +298,7 @@ TEST_F(PacketRouterTest, AllocatesTransportSequenceNumbers) {
|
|||
const uint16_t kSsrc1 = 1234;
|
||||
|
||||
PacketRouter packet_router(kStartSeq - 1);
|
||||
NiceMock<MockRtpRtcp> rtp_1;
|
||||
NiceMock<MockRtpRtcpInterface> rtp_1;
|
||||
EXPECT_CALL(rtp_1, SSRC()).WillRepeatedly(Return(kSsrc1));
|
||||
EXPECT_CALL(rtp_1, TrySendPacket).WillRepeatedly(Return(true));
|
||||
packet_router.AddSendRtpModule(&rtp_1, false);
|
||||
|
@ -316,8 +316,8 @@ TEST_F(PacketRouterTest, AllocatesTransportSequenceNumbers) {
|
|||
}
|
||||
|
||||
TEST_F(PacketRouterTest, SendTransportFeedback) {
|
||||
NiceMock<MockRtpRtcp> rtp_1;
|
||||
NiceMock<MockRtpRtcp> rtp_2;
|
||||
NiceMock<MockRtpRtcpInterface> rtp_1;
|
||||
NiceMock<MockRtpRtcpInterface> rtp_2;
|
||||
|
||||
ON_CALL(rtp_1, RTCP()).WillByDefault(Return(RtcpMode::kCompound));
|
||||
ON_CALL(rtp_2, RTCP()).WillByDefault(Return(RtcpMode::kCompound));
|
||||
|
@ -339,7 +339,7 @@ TEST_F(PacketRouterTest, SendTransportFeedback) {
|
|||
|
||||
TEST_F(PacketRouterTest, SendPacketWithoutTransportSequenceNumbers) {
|
||||
const uint16_t kSsrc1 = 1234;
|
||||
NiceMock<MockRtpRtcp> rtp_1;
|
||||
NiceMock<MockRtpRtcpInterface> rtp_1;
|
||||
ON_CALL(rtp_1, SendingMedia).WillByDefault(Return(true));
|
||||
ON_CALL(rtp_1, SSRC).WillByDefault(Return(kSsrc1));
|
||||
packet_router_.AddSendRtpModule(&rtp_1, false);
|
||||
|
@ -362,8 +362,8 @@ TEST_F(PacketRouterTest, SendPacketWithoutTransportSequenceNumbers) {
|
|||
}
|
||||
|
||||
TEST_F(PacketRouterTest, SendPacketAssignsTransportSequenceNumbers) {
|
||||
NiceMock<MockRtpRtcp> rtp_1;
|
||||
NiceMock<MockRtpRtcp> rtp_2;
|
||||
NiceMock<MockRtpRtcpInterface> rtp_1;
|
||||
NiceMock<MockRtpRtcpInterface> rtp_2;
|
||||
|
||||
const uint16_t kSsrc1 = 1234;
|
||||
const uint16_t kSsrc2 = 2345;
|
||||
|
@ -408,7 +408,7 @@ TEST_F(PacketRouterTest, SendPacketAssignsTransportSequenceNumbers) {
|
|||
#if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)
|
||||
using PacketRouterDeathTest = PacketRouterTest;
|
||||
TEST_F(PacketRouterDeathTest, DoubleRegistrationOfSendModuleDisallowed) {
|
||||
NiceMock<MockRtpRtcp> module;
|
||||
NiceMock<MockRtpRtcpInterface> module;
|
||||
|
||||
constexpr bool remb_candidate = false; // Value irrelevant.
|
||||
packet_router_.AddSendRtpModule(&module, remb_candidate);
|
||||
|
@ -419,7 +419,7 @@ TEST_F(PacketRouterDeathTest, DoubleRegistrationOfSendModuleDisallowed) {
|
|||
}
|
||||
|
||||
TEST_F(PacketRouterDeathTest, DoubleRegistrationOfReceiveModuleDisallowed) {
|
||||
NiceMock<MockRtpRtcp> module;
|
||||
NiceMock<MockRtpRtcpInterface> module;
|
||||
|
||||
constexpr bool remb_candidate = false; // Value irrelevant.
|
||||
packet_router_.AddReceiveRtpModule(&module, remb_candidate);
|
||||
|
@ -430,13 +430,13 @@ TEST_F(PacketRouterDeathTest, DoubleRegistrationOfReceiveModuleDisallowed) {
|
|||
}
|
||||
|
||||
TEST_F(PacketRouterDeathTest, RemovalOfNeverAddedSendModuleDisallowed) {
|
||||
NiceMock<MockRtpRtcp> module;
|
||||
NiceMock<MockRtpRtcpInterface> module;
|
||||
|
||||
EXPECT_DEATH(packet_router_.RemoveSendRtpModule(&module), "");
|
||||
}
|
||||
|
||||
TEST_F(PacketRouterDeathTest, RemovalOfNeverAddedReceiveModuleDisallowed) {
|
||||
NiceMock<MockRtpRtcp> module;
|
||||
NiceMock<MockRtpRtcpInterface> module;
|
||||
|
||||
EXPECT_DEATH(packet_router_.RemoveReceiveRtpModule(&module), "");
|
||||
}
|
||||
|
@ -444,7 +444,7 @@ TEST_F(PacketRouterDeathTest, RemovalOfNeverAddedReceiveModuleDisallowed) {
|
|||
|
||||
TEST(PacketRouterRembTest, LowerEstimateToSendRemb) {
|
||||
rtc::ScopedFakeClock clock;
|
||||
NiceMock<MockRtpRtcp> rtp;
|
||||
NiceMock<MockRtpRtcpInterface> rtp;
|
||||
PacketRouter packet_router;
|
||||
|
||||
packet_router.AddSendRtpModule(&rtp, true);
|
||||
|
@ -470,7 +470,7 @@ TEST(PacketRouterRembTest, LowerEstimateToSendRemb) {
|
|||
|
||||
TEST(PacketRouterRembTest, VerifyIncreasingAndDecreasing) {
|
||||
rtc::ScopedFakeClock clock;
|
||||
NiceMock<MockRtpRtcp> rtp;
|
||||
NiceMock<MockRtpRtcpInterface> rtp;
|
||||
PacketRouter packet_router;
|
||||
packet_router.AddSendRtpModule(&rtp, true);
|
||||
|
||||
|
@ -495,7 +495,7 @@ TEST(PacketRouterRembTest, VerifyIncreasingAndDecreasing) {
|
|||
|
||||
TEST(PacketRouterRembTest, NoRembForIncreasedBitrate) {
|
||||
rtc::ScopedFakeClock clock;
|
||||
NiceMock<MockRtpRtcp> rtp;
|
||||
NiceMock<MockRtpRtcpInterface> rtp;
|
||||
PacketRouter packet_router;
|
||||
packet_router.AddSendRtpModule(&rtp, true);
|
||||
|
||||
|
@ -523,8 +523,8 @@ TEST(PacketRouterRembTest, NoRembForIncreasedBitrate) {
|
|||
|
||||
TEST(PacketRouterRembTest, ChangeSendRtpModule) {
|
||||
rtc::ScopedFakeClock clock;
|
||||
NiceMock<MockRtpRtcp> rtp_send;
|
||||
NiceMock<MockRtpRtcp> rtp_recv;
|
||||
NiceMock<MockRtpRtcpInterface> rtp_send;
|
||||
NiceMock<MockRtpRtcpInterface> rtp_recv;
|
||||
PacketRouter packet_router;
|
||||
packet_router.AddSendRtpModule(&rtp_send, true);
|
||||
packet_router.AddReceiveRtpModule(&rtp_recv, true);
|
||||
|
@ -558,7 +558,7 @@ TEST(PacketRouterRembTest, ChangeSendRtpModule) {
|
|||
|
||||
TEST(PacketRouterRembTest, OnlyOneRembForRepeatedOnReceiveBitrateChanged) {
|
||||
rtc::ScopedFakeClock clock;
|
||||
NiceMock<MockRtpRtcp> rtp;
|
||||
NiceMock<MockRtpRtcpInterface> rtp;
|
||||
PacketRouter packet_router;
|
||||
packet_router.AddSendRtpModule(&rtp, true);
|
||||
|
||||
|
@ -587,7 +587,7 @@ TEST(PacketRouterRembTest, SetMaxDesiredReceiveBitrateLimitsSetRemb) {
|
|||
rtc::ScopedFakeClock clock;
|
||||
PacketRouter packet_router;
|
||||
clock.AdvanceTime(TimeDelta::Millis(1000));
|
||||
NiceMock<MockRtpRtcp> remb_sender;
|
||||
NiceMock<MockRtpRtcpInterface> remb_sender;
|
||||
constexpr bool remb_candidate = true;
|
||||
packet_router.AddSendRtpModule(&remb_sender, remb_candidate);
|
||||
|
||||
|
@ -610,7 +610,7 @@ TEST(PacketRouterRembTest,
|
|||
rtc::ScopedFakeClock clock;
|
||||
PacketRouter packet_router;
|
||||
clock.AdvanceTime(TimeDelta::Millis(1000));
|
||||
NiceMock<MockRtpRtcp> remb_sender;
|
||||
NiceMock<MockRtpRtcpInterface> remb_sender;
|
||||
constexpr bool remb_candidate = true;
|
||||
packet_router.AddSendRtpModule(&remb_sender, remb_candidate);
|
||||
|
||||
|
@ -632,7 +632,7 @@ TEST(PacketRouterRembTest,
|
|||
rtc::ScopedFakeClock clock;
|
||||
PacketRouter packet_router;
|
||||
clock.AdvanceTime(TimeDelta::Millis(1000));
|
||||
NiceMock<MockRtpRtcp> remb_sender;
|
||||
NiceMock<MockRtpRtcpInterface> remb_sender;
|
||||
constexpr bool remb_candidate = true;
|
||||
packet_router.AddSendRtpModule(&remb_sender, remb_candidate);
|
||||
|
||||
|
@ -654,7 +654,7 @@ TEST(PacketRouterRembTest,
|
|||
rtc::ScopedFakeClock clock;
|
||||
PacketRouter packet_router;
|
||||
clock.AdvanceTime(TimeDelta::Millis(1000));
|
||||
NiceMock<MockRtpRtcp> remb_sender;
|
||||
NiceMock<MockRtpRtcpInterface> remb_sender;
|
||||
constexpr bool remb_candidate = true;
|
||||
packet_router.AddSendRtpModule(&remb_sender, remb_candidate);
|
||||
|
||||
|
@ -676,7 +676,7 @@ TEST(PacketRouterRembTest,
|
|||
rtc::ScopedFakeClock clock;
|
||||
PacketRouter packet_router;
|
||||
clock.AdvanceTime(TimeDelta::Millis(1000));
|
||||
NiceMock<MockRtpRtcp> remb_sender;
|
||||
NiceMock<MockRtpRtcpInterface> remb_sender;
|
||||
constexpr bool remb_candidate = true;
|
||||
packet_router.AddSendRtpModule(&remb_sender, remb_candidate);
|
||||
|
||||
|
@ -699,7 +699,7 @@ TEST(PacketRouterRembTest,
|
|||
rtc::ScopedFakeClock clock;
|
||||
PacketRouter packet_router;
|
||||
clock.AdvanceTime(TimeDelta::Millis(1000));
|
||||
NiceMock<MockRtpRtcp> remb_sender;
|
||||
NiceMock<MockRtpRtcpInterface> remb_sender;
|
||||
constexpr bool remb_candidate = true;
|
||||
packet_router.AddSendRtpModule(&remb_sender, remb_candidate);
|
||||
|
||||
|
@ -721,7 +721,7 @@ TEST(PacketRouterRembTest,
|
|||
// packet on this one.
|
||||
TEST(PacketRouterRembTest, NoSendingRtpModule) {
|
||||
rtc::ScopedFakeClock clock;
|
||||
NiceMock<MockRtpRtcp> rtp;
|
||||
NiceMock<MockRtpRtcpInterface> rtp;
|
||||
PacketRouter packet_router;
|
||||
|
||||
packet_router.AddReceiveRtpModule(&rtp, true);
|
||||
|
@ -747,7 +747,7 @@ TEST(PacketRouterRembTest, NoSendingRtpModule) {
|
|||
TEST(PacketRouterRembTest, NonCandidateSendRtpModuleNotUsedForRemb) {
|
||||
rtc::ScopedFakeClock clock;
|
||||
PacketRouter packet_router;
|
||||
NiceMock<MockRtpRtcp> module;
|
||||
NiceMock<MockRtpRtcpInterface> module;
|
||||
|
||||
constexpr bool remb_candidate = false;
|
||||
|
||||
|
@ -766,7 +766,7 @@ TEST(PacketRouterRembTest, NonCandidateSendRtpModuleNotUsedForRemb) {
|
|||
TEST(PacketRouterRembTest, CandidateSendRtpModuleUsedForRemb) {
|
||||
rtc::ScopedFakeClock clock;
|
||||
PacketRouter packet_router;
|
||||
NiceMock<MockRtpRtcp> module;
|
||||
NiceMock<MockRtpRtcpInterface> module;
|
||||
|
||||
constexpr bool remb_candidate = true;
|
||||
|
||||
|
@ -785,7 +785,7 @@ TEST(PacketRouterRembTest, CandidateSendRtpModuleUsedForRemb) {
|
|||
TEST(PacketRouterRembTest, NonCandidateReceiveRtpModuleNotUsedForRemb) {
|
||||
rtc::ScopedFakeClock clock;
|
||||
PacketRouter packet_router;
|
||||
NiceMock<MockRtpRtcp> module;
|
||||
NiceMock<MockRtpRtcpInterface> module;
|
||||
|
||||
constexpr bool remb_candidate = false;
|
||||
|
||||
|
@ -804,7 +804,7 @@ TEST(PacketRouterRembTest, NonCandidateReceiveRtpModuleNotUsedForRemb) {
|
|||
TEST(PacketRouterRembTest, CandidateReceiveRtpModuleUsedForRemb) {
|
||||
rtc::ScopedFakeClock clock;
|
||||
PacketRouter packet_router;
|
||||
NiceMock<MockRtpRtcp> module;
|
||||
NiceMock<MockRtpRtcpInterface> module;
|
||||
|
||||
constexpr bool remb_candidate = true;
|
||||
|
||||
|
@ -824,8 +824,8 @@ TEST(PacketRouterRembTest,
|
|||
SendCandidatePreferredOverReceiveCandidate_SendModuleAddedFirst) {
|
||||
rtc::ScopedFakeClock clock;
|
||||
PacketRouter packet_router;
|
||||
NiceMock<MockRtpRtcp> send_module;
|
||||
NiceMock<MockRtpRtcp> receive_module;
|
||||
NiceMock<MockRtpRtcpInterface> send_module;
|
||||
NiceMock<MockRtpRtcpInterface> receive_module;
|
||||
|
||||
constexpr bool remb_candidate = true;
|
||||
|
||||
|
@ -852,8 +852,8 @@ TEST(PacketRouterRembTest,
|
|||
SendCandidatePreferredOverReceiveCandidate_ReceiveModuleAddedFirst) {
|
||||
rtc::ScopedFakeClock clock;
|
||||
PacketRouter packet_router;
|
||||
NiceMock<MockRtpRtcp> send_module;
|
||||
NiceMock<MockRtpRtcp> receive_module;
|
||||
NiceMock<MockRtpRtcpInterface> send_module;
|
||||
NiceMock<MockRtpRtcpInterface> receive_module;
|
||||
|
||||
constexpr bool remb_candidate = true;
|
||||
|
||||
|
@ -879,8 +879,8 @@ TEST(PacketRouterRembTest,
|
|||
TEST(PacketRouterRembTest, ReceiveModuleTakesOverWhenLastSendModuleRemoved) {
|
||||
rtc::ScopedFakeClock clock;
|
||||
PacketRouter packet_router;
|
||||
NiceMock<MockRtpRtcp> send_module;
|
||||
NiceMock<MockRtpRtcp> receive_module;
|
||||
NiceMock<MockRtpRtcpInterface> send_module;
|
||||
NiceMock<MockRtpRtcpInterface> receive_module;
|
||||
|
||||
constexpr bool remb_candidate = true;
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ rtc_library("rtp_rtcp") {
|
|||
"include/flexfec_sender.h",
|
||||
"include/receive_statistics.h",
|
||||
"include/remote_ntp_time_estimator.h",
|
||||
"include/rtp_rtcp.h",
|
||||
"include/rtp_rtcp.h", # deprecated
|
||||
"include/ulpfec_receiver.h",
|
||||
"source/absolute_capture_time_receiver.cc",
|
||||
"source/absolute_capture_time_receiver.h",
|
||||
|
@ -188,6 +188,7 @@ rtc_library("rtp_rtcp") {
|
|||
"source/rtp_rtcp_impl.h",
|
||||
"source/rtp_rtcp_impl2.cc",
|
||||
"source/rtp_rtcp_impl2.h",
|
||||
"source/rtp_rtcp_interface.h",
|
||||
"source/rtp_sender.cc",
|
||||
"source/rtp_sender.h",
|
||||
"source/rtp_sender_audio.cc",
|
||||
|
|
|
@ -12,155 +12,19 @@
|
|||
#define MODULES_RTP_RTCP_INCLUDE_RTP_RTCP_H_
|
||||
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/frame_transformer_interface.h"
|
||||
#include "api/scoped_refptr.h"
|
||||
#include "api/transport/webrtc_key_value_config.h"
|
||||
#include "api/video/video_bitrate_allocation.h"
|
||||
#include "modules/include/module.h"
|
||||
#include "modules/rtp_rtcp/include/receive_statistics.h"
|
||||
#include "modules/rtp_rtcp/include/report_block_data.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_packet_sender.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_sequence_number_map.h"
|
||||
#include "modules/rtp_rtcp/source/video_fec_generator.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
|
||||
#include "rtc_base/deprecation.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// Forward declarations.
|
||||
class FrameEncryptorInterface;
|
||||
class RateLimiter;
|
||||
class ReceiveStatisticsProvider;
|
||||
class RemoteBitrateEstimator;
|
||||
class RtcEventLog;
|
||||
class RTPSender;
|
||||
class Transport;
|
||||
class VideoBitrateAllocationObserver;
|
||||
|
||||
namespace rtcp {
|
||||
class TransportFeedback;
|
||||
}
|
||||
|
||||
// TODO(tommi): See if we can remove Module.
|
||||
class RtpRtcp : public Module, public RtcpFeedbackSenderInterface {
|
||||
// DEPRECATED. Do not use.
|
||||
class RtpRtcp : public Module, public RtpRtcpInterface {
|
||||
public:
|
||||
struct Configuration {
|
||||
Configuration() = default;
|
||||
Configuration(Configuration&& rhs) = default;
|
||||
|
||||
// True for a audio version of the RTP/RTCP module object false will create
|
||||
// a video version.
|
||||
bool audio = false;
|
||||
bool receiver_only = false;
|
||||
|
||||
// The clock to use to read time. If nullptr then system clock will be used.
|
||||
Clock* clock = nullptr;
|
||||
|
||||
ReceiveStatisticsProvider* receive_statistics = nullptr;
|
||||
|
||||
// Transport object that will be called when packets are ready to be sent
|
||||
// out on the network.
|
||||
Transport* outgoing_transport = nullptr;
|
||||
|
||||
// Called when the receiver requests an intra frame.
|
||||
RtcpIntraFrameObserver* intra_frame_callback = nullptr;
|
||||
|
||||
// Called when the receiver sends a loss notification.
|
||||
RtcpLossNotificationObserver* rtcp_loss_notification_observer = nullptr;
|
||||
|
||||
// Called when we receive a changed estimate from the receiver of out
|
||||
// stream.
|
||||
RtcpBandwidthObserver* bandwidth_callback = nullptr;
|
||||
|
||||
NetworkStateEstimateObserver* network_state_estimate_observer = nullptr;
|
||||
TransportFeedbackObserver* transport_feedback_callback = nullptr;
|
||||
VideoBitrateAllocationObserver* bitrate_allocation_observer = nullptr;
|
||||
RtcpRttStats* rtt_stats = nullptr;
|
||||
RtcpPacketTypeCounterObserver* rtcp_packet_type_counter_observer = nullptr;
|
||||
// Called on receipt of RTCP report block from remote side.
|
||||
// TODO(bugs.webrtc.org/10678): Remove RtcpStatisticsCallback in
|
||||
// favor of ReportBlockDataObserver.
|
||||
// TODO(bugs.webrtc.org/10679): Consider whether we want to use
|
||||
// only getters or only callbacks. If we decide on getters, the
|
||||
// ReportBlockDataObserver should also be removed in favor of
|
||||
// GetLatestReportBlockData().
|
||||
RtcpStatisticsCallback* rtcp_statistics_callback = nullptr;
|
||||
RtcpCnameCallback* rtcp_cname_callback = nullptr;
|
||||
ReportBlockDataObserver* report_block_data_observer = nullptr;
|
||||
|
||||
// Estimates the bandwidth available for a set of streams from the same
|
||||
// client.
|
||||
RemoteBitrateEstimator* remote_bitrate_estimator = nullptr;
|
||||
|
||||
// Spread any bursts of packets into smaller bursts to minimize packet loss.
|
||||
RtpPacketSender* paced_sender = nullptr;
|
||||
|
||||
// Generates FEC packets.
|
||||
// TODO(sprang): Wire up to RtpSenderEgress.
|
||||
VideoFecGenerator* fec_generator = nullptr;
|
||||
|
||||
BitrateStatisticsObserver* send_bitrate_observer = nullptr;
|
||||
SendSideDelayObserver* send_side_delay_observer = nullptr;
|
||||
RtcEventLog* event_log = nullptr;
|
||||
SendPacketObserver* send_packet_observer = nullptr;
|
||||
RateLimiter* retransmission_rate_limiter = nullptr;
|
||||
StreamDataCountersCallback* rtp_stats_callback = nullptr;
|
||||
|
||||
int rtcp_report_interval_ms = 0;
|
||||
|
||||
// Update network2 instead of pacer_exit field of video timing extension.
|
||||
bool populate_network2_timestamp = false;
|
||||
|
||||
rtc::scoped_refptr<FrameTransformerInterface> frame_transformer;
|
||||
|
||||
// E2EE Custom Video Frame Encryption
|
||||
FrameEncryptorInterface* frame_encryptor = nullptr;
|
||||
// Require all outgoing frames to be encrypted with a FrameEncryptor.
|
||||
bool require_frame_encryption = false;
|
||||
|
||||
// Corresponds to extmap-allow-mixed in SDP negotiation.
|
||||
bool extmap_allow_mixed = false;
|
||||
|
||||
// If true, the RTP sender will always annotate outgoing packets with
|
||||
// MID and RID header extensions, if provided and negotiated.
|
||||
// If false, the RTP sender will stop sending MID and RID header extensions,
|
||||
// when it knows that the receiver is ready to demux based on SSRC. This is
|
||||
// done by RTCP RR acking.
|
||||
bool always_send_mid_and_rid = false;
|
||||
|
||||
// If set, field trials are read from |field_trials|, otherwise
|
||||
// defaults to webrtc::FieldTrialBasedConfig.
|
||||
const WebRtcKeyValueConfig* field_trials = nullptr;
|
||||
|
||||
// SSRCs for media and retransmission, respectively.
|
||||
// FlexFec SSRC is fetched from |flexfec_sender|.
|
||||
uint32_t local_media_ssrc = 0;
|
||||
absl::optional<uint32_t> rtx_send_ssrc;
|
||||
|
||||
bool need_rtp_packet_infos = false;
|
||||
|
||||
// If true, the RTP packet history will select RTX packets based on
|
||||
// heuristics such as send time, retransmission count etc, in order to
|
||||
// make padding potentially more useful.
|
||||
// If false, the last packet will always be picked. This may reduce CPU
|
||||
// overhead.
|
||||
bool enable_rtx_padding_prioritization = true;
|
||||
|
||||
private:
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(Configuration);
|
||||
};
|
||||
|
||||
// DEPRECATED. Do not use. Currently instantiates a deprecated version of the
|
||||
// RtpRtcp module.
|
||||
// Instantiates a deprecated version of the RtpRtcp module.
|
||||
static std::unique_ptr<RtpRtcp> RTC_DEPRECATED
|
||||
Create(const Configuration& configuration) {
|
||||
return DEPRECATED_Create(configuration);
|
||||
|
@ -169,307 +33,17 @@ class RtpRtcp : public Module, public RtcpFeedbackSenderInterface {
|
|||
static std::unique_ptr<RtpRtcp> DEPRECATED_Create(
|
||||
const Configuration& configuration);
|
||||
|
||||
// **************************************************************************
|
||||
// Receiver functions
|
||||
// **************************************************************************
|
||||
|
||||
virtual void IncomingRtcpPacket(const uint8_t* incoming_packet,
|
||||
size_t incoming_packet_length) = 0;
|
||||
|
||||
virtual void SetRemoteSSRC(uint32_t ssrc) = 0;
|
||||
|
||||
// **************************************************************************
|
||||
// Sender
|
||||
// **************************************************************************
|
||||
|
||||
// Sets the maximum size of an RTP packet, including RTP headers.
|
||||
virtual void SetMaxRtpPacketSize(size_t size) = 0;
|
||||
|
||||
// Returns max RTP packet size. Takes into account RTP headers and
|
||||
// FEC/ULP/RED overhead (when FEC is enabled).
|
||||
virtual size_t MaxRtpPacketSize() const = 0;
|
||||
|
||||
virtual void RegisterSendPayloadFrequency(int payload_type,
|
||||
int payload_frequency) = 0;
|
||||
|
||||
// Unregisters a send payload.
|
||||
// |payload_type| - payload type of codec
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t DeRegisterSendPayload(int8_t payload_type) = 0;
|
||||
|
||||
virtual void SetExtmapAllowMixed(bool extmap_allow_mixed) = 0;
|
||||
|
||||
// (De)registers RTP header extension type and id.
|
||||
// Returns -1 on failure else 0.
|
||||
RTC_DEPRECATED virtual int32_t RegisterSendRtpHeaderExtension(
|
||||
RTPExtensionType type,
|
||||
uint8_t id) = 0;
|
||||
// Register extension by uri, triggers CHECK on falure.
|
||||
virtual void RegisterRtpHeaderExtension(absl::string_view uri, int id) = 0;
|
||||
|
||||
virtual int32_t DeregisterSendRtpHeaderExtension(RTPExtensionType type) = 0;
|
||||
virtual void DeregisterSendRtpHeaderExtension(absl::string_view uri) = 0;
|
||||
|
||||
// Returns true if RTP module is send media, and any of the extensions
|
||||
// required for bandwidth estimation is registered.
|
||||
virtual bool SupportsPadding() const = 0;
|
||||
// Same as SupportsPadding(), but additionally requires that
|
||||
// SetRtxSendStatus() has been called with the kRtxRedundantPayloads option
|
||||
// enabled.
|
||||
virtual bool SupportsRtxPayloadPadding() const = 0;
|
||||
|
||||
// Returns start timestamp.
|
||||
virtual uint32_t StartTimestamp() const = 0;
|
||||
|
||||
// Sets start timestamp. Start timestamp is set to a random value if this
|
||||
// function is never called.
|
||||
virtual void SetStartTimestamp(uint32_t timestamp) = 0;
|
||||
|
||||
// Returns SequenceNumber.
|
||||
virtual uint16_t SequenceNumber() const = 0;
|
||||
|
||||
// Sets SequenceNumber, default is a random number.
|
||||
virtual void SetSequenceNumber(uint16_t seq) = 0;
|
||||
|
||||
virtual void SetRtpState(const RtpState& rtp_state) = 0;
|
||||
virtual void SetRtxState(const RtpState& rtp_state) = 0;
|
||||
virtual RtpState GetRtpState() const = 0;
|
||||
virtual RtpState GetRtxState() const = 0;
|
||||
|
||||
// Returns SSRC.
|
||||
virtual uint32_t SSRC() const = 0;
|
||||
|
||||
// Sets the value for sending in the RID (and Repaired) RTP header extension.
|
||||
// RIDs are used to identify an RTP stream if SSRCs are not negotiated.
|
||||
// If the RID and Repaired RID extensions are not registered, the RID will
|
||||
// not be sent.
|
||||
virtual void SetRid(const std::string& rid) = 0;
|
||||
|
||||
// Sets the value for sending in the MID RTP header extension.
|
||||
// The MID RTP header extension should be registered for this to do anything.
|
||||
// Once set, this value can not be changed or removed.
|
||||
virtual void SetMid(const std::string& mid) = 0;
|
||||
|
||||
// Sets CSRC.
|
||||
// |csrcs| - vector of CSRCs
|
||||
virtual void SetCsrcs(const std::vector<uint32_t>& csrcs) = 0;
|
||||
|
||||
// Turns on/off sending RTX (RFC 4588). The modes can be set as a combination
|
||||
// of values of the enumerator RtxMode.
|
||||
virtual void SetRtxSendStatus(int modes) = 0;
|
||||
|
||||
// Returns status of sending RTX (RFC 4588). The returned value can be
|
||||
// a combination of values of the enumerator RtxMode.
|
||||
virtual int RtxSendStatus() const = 0;
|
||||
|
||||
// Returns the SSRC used for RTX if set, otherwise a nullopt.
|
||||
virtual absl::optional<uint32_t> RtxSsrc() const = 0;
|
||||
|
||||
// Sets the payload type to use when sending RTX packets. Note that this
|
||||
// doesn't enable RTX, only the payload type is set.
|
||||
virtual void SetRtxSendPayloadType(int payload_type,
|
||||
int associated_payload_type) = 0;
|
||||
|
||||
// Returns the FlexFEC SSRC, if there is one.
|
||||
virtual absl::optional<uint32_t> FlexfecSsrc() const = 0;
|
||||
|
||||
// Sets sending status. Sends kRtcpByeCode when going from true to false.
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t SetSendingStatus(bool sending) = 0;
|
||||
|
||||
// Returns current sending status.
|
||||
virtual bool Sending() const = 0;
|
||||
|
||||
// Starts/Stops media packets. On by default.
|
||||
virtual void SetSendingMediaStatus(bool sending) = 0;
|
||||
|
||||
// Returns current media sending status.
|
||||
virtual bool SendingMedia() const = 0;
|
||||
|
||||
// Returns whether audio is configured (i.e. Configuration::audio = true).
|
||||
virtual bool IsAudioConfigured() const = 0;
|
||||
|
||||
// Indicate that the packets sent by this module should be counted towards the
|
||||
// bitrate estimate since the stream participates in the bitrate allocation.
|
||||
virtual void SetAsPartOfAllocation(bool part_of_allocation) = 0;
|
||||
|
||||
// TODO(sprang): Remove when all call sites have been moved to
|
||||
// GetSendRates(). Fetches the current send bitrates in bits/s.
|
||||
virtual void BitrateSent(uint32_t* total_rate,
|
||||
uint32_t* video_rate,
|
||||
uint32_t* fec_rate,
|
||||
uint32_t* nack_rate) const = 0;
|
||||
|
||||
// Returns bitrate sent (post-pacing) per packet type.
|
||||
virtual RtpSendRates GetSendRates() const = 0;
|
||||
|
||||
virtual RTPSender* RtpSender() = 0;
|
||||
virtual const RTPSender* RtpSender() const = 0;
|
||||
|
||||
// Record that a frame is about to be sent. Returns true on success, and false
|
||||
// if the module isn't ready to send.
|
||||
virtual bool OnSendingRtpFrame(uint32_t timestamp,
|
||||
int64_t capture_time_ms,
|
||||
int payload_type,
|
||||
bool force_sender_report) = 0;
|
||||
|
||||
// Try to send the provided packet. Returns true iff packet matches any of
|
||||
// the SSRCs for this module (media/rtx/fec etc) and was forwarded to the
|
||||
// transport.
|
||||
virtual bool TrySendPacket(RtpPacketToSend* packet,
|
||||
const PacedPacketInfo& pacing_info) = 0;
|
||||
|
||||
virtual void OnPacketsAcknowledged(
|
||||
rtc::ArrayView<const uint16_t> sequence_numbers) = 0;
|
||||
|
||||
virtual std::vector<std::unique_ptr<RtpPacketToSend>> GeneratePadding(
|
||||
size_t target_size_bytes) = 0;
|
||||
|
||||
virtual std::vector<RtpSequenceNumberMap::Info> GetSentRtpPacketInfos(
|
||||
rtc::ArrayView<const uint16_t> sequence_numbers) const = 0;
|
||||
|
||||
// Returns an expected per packet overhead representing the main RTP header,
|
||||
// any CSRCs, and the registered header extensions that are expected on all
|
||||
// packets (i.e. disregarding things like abs capture time which is only
|
||||
// populated on a subset of packets, but counting MID/RID type extensions
|
||||
// when we expect to send them).
|
||||
virtual size_t ExpectedPerPacketOverhead() const = 0;
|
||||
|
||||
// **************************************************************************
|
||||
// RTCP
|
||||
// **************************************************************************
|
||||
|
||||
// Returns RTCP status.
|
||||
virtual RtcpMode RTCP() const = 0;
|
||||
|
||||
// Sets RTCP status i.e on(compound or non-compound)/off.
|
||||
// |method| - RTCP method to use.
|
||||
virtual void SetRTCPStatus(RtcpMode method) = 0;
|
||||
|
||||
// Sets RTCP CName (i.e unique identifier).
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t SetCNAME(const char* cname) = 0;
|
||||
|
||||
// Returns remote CName.
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t RemoteCNAME(uint32_t remote_ssrc,
|
||||
char cname[RTCP_CNAME_SIZE]) const = 0;
|
||||
|
||||
// Returns remote NTP.
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t RemoteNTP(uint32_t* received_ntp_secs,
|
||||
uint32_t* received_ntp_frac,
|
||||
uint32_t* rtcp_arrival_time_secs,
|
||||
uint32_t* rtcp_arrival_time_frac,
|
||||
uint32_t* rtcp_timestamp) const = 0;
|
||||
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t AddMixedCNAME(uint32_t ssrc, const char* cname) = 0;
|
||||
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t RemoveMixedCNAME(uint32_t ssrc) = 0;
|
||||
|
||||
// Returns current RTT (round-trip time) estimate.
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t RTT(uint32_t remote_ssrc,
|
||||
int64_t* rtt,
|
||||
int64_t* avg_rtt,
|
||||
int64_t* min_rtt,
|
||||
int64_t* max_rtt) const = 0;
|
||||
|
||||
// Returns the estimated RTT, with fallback to a default value.
|
||||
virtual int64_t ExpectedRetransmissionTimeMs() const = 0;
|
||||
|
||||
// Forces a send of a RTCP packet. Periodic SR and RR are triggered via the
|
||||
// process function.
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t SendRTCP(RTCPPacketType rtcp_packet_type) = 0;
|
||||
|
||||
// Returns statistics of the amount of data sent.
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t DataCountersRTP(size_t* bytes_sent,
|
||||
uint32_t* packets_sent) const = 0;
|
||||
|
||||
// Returns send statistics for the RTP and RTX stream.
|
||||
virtual void GetSendStreamDataCounters(
|
||||
StreamDataCounters* rtp_counters,
|
||||
StreamDataCounters* rtx_counters) const = 0;
|
||||
|
||||
// Returns received RTCP report block.
|
||||
// Returns -1 on failure else 0.
|
||||
// TODO(https://crbug.com/webrtc/10678): Remove this in favor of
|
||||
// GetLatestReportBlockData().
|
||||
virtual int32_t RemoteRTCPStat(
|
||||
std::vector<RTCPReportBlock>* receive_blocks) const = 0;
|
||||
// A snapshot of Report Blocks with additional data of interest to statistics.
|
||||
// Within this list, the sender-source SSRC pair is unique and per-pair the
|
||||
// ReportBlockData represents the latest Report Block that was received for
|
||||
// that pair.
|
||||
virtual std::vector<ReportBlockData> GetLatestReportBlockData() const = 0;
|
||||
|
||||
// (APP) Sets application specific data.
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t SetRTCPApplicationSpecificData(uint8_t sub_type,
|
||||
uint32_t name,
|
||||
const uint8_t* data,
|
||||
uint16_t length) = 0;
|
||||
// (XR) Sets Receiver Reference Time Report (RTTR) status.
|
||||
virtual void SetRtcpXrRrtrStatus(bool enable) = 0;
|
||||
|
||||
// Returns current Receiver Reference Time Report (RTTR) status.
|
||||
virtual bool RtcpXrRrtrStatus() const = 0;
|
||||
|
||||
// (REMB) Receiver Estimated Max Bitrate.
|
||||
// Schedules sending REMB on next and following sender/receiver reports.
|
||||
void SetRemb(int64_t bitrate_bps, std::vector<uint32_t> ssrcs) override = 0;
|
||||
// Stops sending REMB on next and following sender/receiver reports.
|
||||
void UnsetRemb() override = 0;
|
||||
|
||||
// (TMMBR) Temporary Max Media Bit Rate
|
||||
virtual bool TMMBR() const = 0;
|
||||
|
||||
virtual void SetTMMBRStatus(bool enable) = 0;
|
||||
|
||||
// (NACK)
|
||||
|
||||
// Sends a Negative acknowledgement packet.
|
||||
// Returns -1 on failure else 0.
|
||||
// TODO(philipel): Deprecate this and start using SendNack instead, mostly
|
||||
// because we want a function that actually send NACK for the specified
|
||||
// packets.
|
||||
virtual int32_t SendNACK(const uint16_t* nack_list, uint16_t size) = 0;
|
||||
|
||||
// Sends NACK for the packets specified.
|
||||
// Note: This assumes the caller keeps track of timing and doesn't rely on
|
||||
// the RTP module to do this.
|
||||
virtual void SendNack(const std::vector<uint16_t>& sequence_numbers) = 0;
|
||||
|
||||
// Store the sent packets, needed to answer to a Negative acknowledgment
|
||||
// requests.
|
||||
virtual void SetStorePacketsStatus(bool enable, uint16_t numberToStore) = 0;
|
||||
|
||||
// Returns true if the module is configured to store packets.
|
||||
virtual bool StorePackets() const = 0;
|
||||
|
||||
virtual void SetVideoBitrateAllocation(
|
||||
const VideoBitrateAllocation& bitrate) = 0;
|
||||
|
||||
// **************************************************************************
|
||||
// Video
|
||||
// **************************************************************************
|
||||
|
||||
// Requests new key frame.
|
||||
// using PLI, https://tools.ietf.org/html/rfc4585#section-6.3.1.1
|
||||
void SendPictureLossIndication() { SendRTCP(kRtcpPli); }
|
||||
// using FIR, https://tools.ietf.org/html/rfc5104#section-4.3.1.2
|
||||
void SendFullIntraRequest() { SendRTCP(kRtcpFir); }
|
||||
|
||||
// Sends a LossNotification RTCP message.
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t SendLossNotification(uint16_t last_decoded_seq_num,
|
||||
uint16_t last_received_seq_num,
|
||||
bool decodability_flag,
|
||||
bool buffering_allowed) = 0;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -20,14 +20,14 @@
|
|||
#include "absl/types/optional.h"
|
||||
#include "api/video/video_bitrate_allocation.h"
|
||||
#include "modules/include/module.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
|
||||
#include "test/gmock.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class MockRtpRtcp : public RtpRtcp {
|
||||
class MockRtpRtcpInterface : public RtpRtcpInterface {
|
||||
public:
|
||||
MOCK_METHOD(void,
|
||||
IncomingRtcpPacket,
|
||||
|
@ -45,10 +45,6 @@ class MockRtpRtcp : public RtpRtcp {
|
|||
(int8_t payload_type),
|
||||
(override));
|
||||
MOCK_METHOD(void, SetExtmapAllowMixed, (bool extmap_allow_mixed), (override));
|
||||
MOCK_METHOD(int32_t,
|
||||
RegisterSendRtpHeaderExtension,
|
||||
(RTPExtensionType type, uint8_t id),
|
||||
(override));
|
||||
MOCK_METHOD(void,
|
||||
RegisterRtpHeaderExtension,
|
||||
(absl::string_view uri, int id),
|
||||
|
@ -202,20 +198,12 @@ class MockRtpRtcp : public RtpRtcp {
|
|||
bool decodability_flag,
|
||||
bool buffering_allowed),
|
||||
(override));
|
||||
MOCK_METHOD(void, Process, (), (override));
|
||||
MOCK_METHOD(void,
|
||||
SetVideoBitrateAllocation,
|
||||
(const VideoBitrateAllocation&),
|
||||
(override));
|
||||
MOCK_METHOD(RTPSender*, RtpSender, (), (override));
|
||||
MOCK_METHOD(const RTPSender*, RtpSender, (), (const, override));
|
||||
|
||||
private:
|
||||
// Mocking this method is currently not required and having a default
|
||||
// implementation like
|
||||
// MOCK_METHOD(int64_t, TimeUntilNextProcess, (), (override))
|
||||
// can be dangerous since it can cause a tight loop on a process thread.
|
||||
int64_t TimeUntilNextProcess() override { return 0xffffffff; }
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -63,7 +63,9 @@ class RtxLoopBackTransport : public webrtc::Transport {
|
|||
count_rtx_ssrc_(0),
|
||||
module_(NULL) {}
|
||||
|
||||
void SetSendModule(RtpRtcp* rtpRtcpModule) { module_ = rtpRtcpModule; }
|
||||
void SetSendModule(RtpRtcpInterface* rtpRtcpModule) {
|
||||
module_ = rtpRtcpModule;
|
||||
}
|
||||
|
||||
void DropEveryNthPacket(int n) { packet_loss_ = n; }
|
||||
|
||||
|
@ -109,7 +111,7 @@ class RtxLoopBackTransport : public webrtc::Transport {
|
|||
int consecutive_drop_end_;
|
||||
uint32_t rtx_ssrc_;
|
||||
int count_rtx_ssrc_;
|
||||
RtpRtcp* module_;
|
||||
RtpRtcpInterface* module_;
|
||||
RtpStreamReceiverController stream_receiver_controller_;
|
||||
std::set<uint16_t> expected_sequence_numbers_;
|
||||
};
|
||||
|
@ -125,7 +127,7 @@ class RtpRtcpRtxNackTest : public ::testing::Test {
|
|||
~RtpRtcpRtxNackTest() override {}
|
||||
|
||||
void SetUp() override {
|
||||
RtpRtcp::Configuration configuration;
|
||||
RtpRtcpInterface::Configuration configuration;
|
||||
configuration.audio = false;
|
||||
configuration.clock = &fake_clock;
|
||||
receive_statistics_ = ReceiveStatistics::Create(&fake_clock);
|
||||
|
@ -224,7 +226,7 @@ class RtpRtcpRtxNackTest : public ::testing::Test {
|
|||
}
|
||||
|
||||
std::unique_ptr<ReceiveStatistics> receive_statistics_;
|
||||
std::unique_ptr<RtpRtcp> rtp_rtcp_module_;
|
||||
std::unique_ptr<ModuleRtpRtcpImpl2> rtp_rtcp_module_;
|
||||
std::unique_ptr<RTPSenderVideo> rtp_sender_video_;
|
||||
RtxLoopBackTransport transport_;
|
||||
const std::map<int, int> rtx_associated_payload_types_ = {
|
||||
|
|
|
@ -66,7 +66,8 @@ const size_t kMaxNumberOfStoredRrtrs = 300;
|
|||
constexpr int32_t kDefaultVideoReportInterval = 1000;
|
||||
constexpr int32_t kDefaultAudioReportInterval = 5000;
|
||||
|
||||
std::set<uint32_t> GetRegisteredSsrcs(const RtpRtcp::Configuration& config) {
|
||||
std::set<uint32_t> GetRegisteredSsrcs(
|
||||
const RtpRtcpInterface::Configuration& config) {
|
||||
std::set<uint32_t> ssrcs;
|
||||
ssrcs.insert(config.local_media_ssrc);
|
||||
if (config.rtx_send_ssrc) {
|
||||
|
@ -136,7 +137,7 @@ struct RTCPReceiver::LastFirStatus {
|
|||
uint8_t sequence_number;
|
||||
};
|
||||
|
||||
RTCPReceiver::RTCPReceiver(const RtpRtcp::Configuration& config,
|
||||
RTCPReceiver::RTCPReceiver(const RtpRtcpInterface::Configuration& config,
|
||||
ModuleRtpRtcp* owner)
|
||||
: clock_(config.clock),
|
||||
receiver_only_(config.receiver_only),
|
||||
|
|
|
@ -20,10 +20,10 @@
|
|||
#include "api/array_view.h"
|
||||
#include "modules/rtp_rtcp/include/report_block_data.h"
|
||||
#include "modules/rtp_rtcp/include/rtcp_statistics.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_nack_stats.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet/dlrr.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
|
||||
#include "rtc_base/critical_section.h"
|
||||
#include "rtc_base/thread_annotations.h"
|
||||
#include "system_wrappers/include/ntp_time.h"
|
||||
|
@ -53,7 +53,8 @@ class RTCPReceiver final {
|
|||
virtual ~ModuleRtpRtcp() = default;
|
||||
};
|
||||
|
||||
RTCPReceiver(const RtpRtcp::Configuration& config, ModuleRtpRtcp* owner);
|
||||
RTCPReceiver(const RtpRtcpInterface::Configuration& config,
|
||||
ModuleRtpRtcp* owner);
|
||||
~RTCPReceiver();
|
||||
|
||||
void IncomingPacket(const uint8_t* packet, size_t packet_size) {
|
||||
|
|
|
@ -161,8 +161,8 @@ struct ReceiverMocks {
|
|||
StrictMock<MockModuleRtpRtcp> rtp_rtcp_impl;
|
||||
};
|
||||
|
||||
RtpRtcp::Configuration DefaultConfiguration(ReceiverMocks* mocks) {
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration DefaultConfiguration(ReceiverMocks* mocks) {
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &mocks->clock;
|
||||
config.receiver_only = false;
|
||||
config.rtcp_packet_type_counter_observer =
|
||||
|
@ -636,7 +636,7 @@ TEST(RtcpReceiverTest, InjectApp) {
|
|||
TEST(RtcpReceiverTest, InjectSdesWithOneChunk) {
|
||||
ReceiverMocks mocks;
|
||||
MockCnameCallbackImpl callback;
|
||||
RtpRtcp::Configuration config = DefaultConfiguration(&mocks);
|
||||
RtpRtcpInterface::Configuration config = DefaultConfiguration(&mocks);
|
||||
config.rtcp_cname_callback = &callback;
|
||||
RTCPReceiver receiver(config, &mocks.rtp_rtcp_impl);
|
||||
receiver.SetRemoteSSRC(kSenderSsrc);
|
||||
|
@ -1310,7 +1310,7 @@ TEST(RtcpReceiverTest, TmmbrThreeConstraintsTimeOut) {
|
|||
TEST(RtcpReceiverTest, Callbacks) {
|
||||
ReceiverMocks mocks;
|
||||
MockRtcpCallbackImpl callback;
|
||||
RtpRtcp::Configuration config = DefaultConfiguration(&mocks);
|
||||
RtpRtcpInterface::Configuration config = DefaultConfiguration(&mocks);
|
||||
config.rtcp_statistics_callback = &callback;
|
||||
RTCPReceiver receiver(config, &mocks.rtp_rtcp_impl);
|
||||
receiver.SetRemoteSSRC(kSenderSsrc);
|
||||
|
@ -1348,7 +1348,7 @@ TEST(RtcpReceiverTest,
|
|||
VerifyBlockAndTimestampObtainedFromReportBlockDataObserver) {
|
||||
ReceiverMocks mocks;
|
||||
MockReportBlockDataObserverImpl observer;
|
||||
RtpRtcp::Configuration config = DefaultConfiguration(&mocks);
|
||||
RtpRtcpInterface::Configuration config = DefaultConfiguration(&mocks);
|
||||
config.report_block_data_observer = &observer;
|
||||
RTCPReceiver receiver(config, &mocks.rtp_rtcp_impl);
|
||||
receiver.SetRemoteSSRC(kSenderSsrc);
|
||||
|
@ -1397,7 +1397,7 @@ TEST(RtcpReceiverTest,
|
|||
TEST(RtcpReceiverTest, VerifyRttObtainedFromReportBlockDataObserver) {
|
||||
ReceiverMocks mocks;
|
||||
MockReportBlockDataObserverImpl observer;
|
||||
RtpRtcp::Configuration config = DefaultConfiguration(&mocks);
|
||||
RtpRtcpInterface::Configuration config = DefaultConfiguration(&mocks);
|
||||
config.report_block_data_observer = &observer;
|
||||
RTCPReceiver receiver(config, &mocks.rtp_rtcp_impl);
|
||||
receiver.SetRemoteSSRC(kSenderSsrc);
|
||||
|
|
|
@ -148,7 +148,7 @@ class RTCPSender::RtcpContext {
|
|||
const int64_t now_us_;
|
||||
};
|
||||
|
||||
RTCPSender::RTCPSender(const RtpRtcp::Configuration& config)
|
||||
RTCPSender::RTCPSender(const RtpRtcpInterface::Configuration& config)
|
||||
: audio_(config.audio),
|
||||
ssrc_(config.local_media_ssrc),
|
||||
clock_(config.clock),
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "modules/remote_bitrate_estimator/include/bwe_defines.h"
|
||||
#include "modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
|
||||
#include "modules/rtp_rtcp/include/receive_statistics.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_nack_stats.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet.h"
|
||||
|
@ -31,6 +30,7 @@
|
|||
#include "modules/rtp_rtcp/source/rtcp_packet/dlrr.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet/report_block.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet/tmmb_item.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/critical_section.h"
|
||||
#include "rtc_base/random.h"
|
||||
|
@ -64,7 +64,7 @@ class RTCPSender final {
|
|||
RTCPReceiver* receiver;
|
||||
};
|
||||
|
||||
explicit RTCPSender(const RtpRtcp::Configuration& config);
|
||||
explicit RTCPSender(const RtpRtcpInterface::Configuration& config);
|
||||
virtual ~RTCPSender();
|
||||
|
||||
RtcpMode Status() const RTC_LOCKS_EXCLUDED(critical_section_rtcp_sender_);
|
||||
|
|
|
@ -76,7 +76,7 @@ class RtcpSenderTest : public ::testing::Test {
|
|||
: clock_(1335900000),
|
||||
receive_statistics_(ReceiveStatistics::Create(&clock_)),
|
||||
retransmission_rate_limiter_(&clock_, 1000) {
|
||||
RtpRtcp::Configuration configuration = GetDefaultConfig();
|
||||
RtpRtcpInterface::Configuration configuration = GetDefaultConfig();
|
||||
rtp_rtcp_impl_.reset(new ModuleRtpRtcpImpl2(configuration));
|
||||
rtcp_sender_.reset(new RTCPSender(configuration));
|
||||
rtcp_sender_->SetRemoteSSRC(kRemoteSsrc);
|
||||
|
@ -85,8 +85,8 @@ class RtcpSenderTest : public ::testing::Test {
|
|||
/*payload_type=*/0);
|
||||
}
|
||||
|
||||
RtpRtcp::Configuration GetDefaultConfig() {
|
||||
RtpRtcp::Configuration configuration;
|
||||
RtpRtcpInterface::Configuration GetDefaultConfig() {
|
||||
RtpRtcpInterface::Configuration configuration;
|
||||
configuration.audio = false;
|
||||
configuration.clock = &clock_;
|
||||
configuration.outgoing_transport = &test_transport_;
|
||||
|
@ -191,7 +191,7 @@ TEST_F(RtcpSenderTest, SendConsecutiveSrWithExactSlope) {
|
|||
}
|
||||
|
||||
TEST_F(RtcpSenderTest, DoNotSendSrBeforeRtp) {
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &clock_;
|
||||
config.receive_statistics = receive_statistics_.get();
|
||||
config.outgoing_transport = &test_transport_;
|
||||
|
@ -213,7 +213,7 @@ TEST_F(RtcpSenderTest, DoNotSendSrBeforeRtp) {
|
|||
}
|
||||
|
||||
TEST_F(RtcpSenderTest, DoNotSendCompundBeforeRtp) {
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &clock_;
|
||||
config.receive_statistics = receive_statistics_.get();
|
||||
config.outgoing_transport = &test_transport_;
|
||||
|
@ -563,7 +563,7 @@ TEST_F(RtcpSenderTest, TestNoXrRrtrSentIfNotEnabled) {
|
|||
|
||||
TEST_F(RtcpSenderTest, TestRegisterRtcpPacketTypeObserver) {
|
||||
RtcpPacketTypeCounterObserverImpl observer;
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &clock_;
|
||||
config.receive_statistics = receive_statistics_.get();
|
||||
config.outgoing_transport = &test_transport_;
|
||||
|
@ -691,7 +691,7 @@ TEST_F(RtcpSenderTest, ByeMustBeLast) {
|
|||
}));
|
||||
|
||||
// Re-configure rtcp_sender_ with mock_transport_
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &clock_;
|
||||
config.receive_statistics = receive_statistics_.get();
|
||||
config.outgoing_transport = &mock_transport;
|
||||
|
|
|
@ -39,7 +39,7 @@ const int64_t kDefaultExpectedRetransmissionTimeMs = 125;
|
|||
} // namespace
|
||||
|
||||
ModuleRtpRtcpImpl::RtpSenderContext::RtpSenderContext(
|
||||
const RtpRtcp::Configuration& config)
|
||||
const RtpRtcpInterface::Configuration& config)
|
||||
: packet_history(config.clock, config.enable_rtx_padding_prioritization),
|
||||
packet_sender(config, &packet_history),
|
||||
non_paced_sender(&packet_sender),
|
||||
|
|
|
@ -45,7 +45,8 @@ struct RTPVideoHeader;
|
|||
// DEPRECATED.
|
||||
class ModuleRtpRtcpImpl : public RtpRtcp, public RTCPReceiver::ModuleRtpRtcp {
|
||||
public:
|
||||
explicit ModuleRtpRtcpImpl(const RtpRtcp::Configuration& configuration);
|
||||
explicit ModuleRtpRtcpImpl(
|
||||
const RtpRtcpInterface::Configuration& configuration);
|
||||
~ModuleRtpRtcpImpl() override;
|
||||
|
||||
// Returns the number of milliseconds until the module want a worker thread to
|
||||
|
@ -304,7 +305,7 @@ class ModuleRtpRtcpImpl : public RtpRtcp, public RTCPReceiver::ModuleRtpRtcp {
|
|||
FRIEND_TEST_ALL_PREFIXES(RtpRtcpImplTest, RttForReceiverOnly);
|
||||
|
||||
struct RtpSenderContext {
|
||||
explicit RtpSenderContext(const RtpRtcp::Configuration& config);
|
||||
explicit RtpSenderContext(const RtpRtcpInterface::Configuration& config);
|
||||
// Storage of packets, for retransmissions and padding, if applicable.
|
||||
RtpPacketHistory packet_history;
|
||||
// Handles final time timestamping/stats/etc and handover to Transport.
|
||||
|
|
|
@ -39,7 +39,7 @@ const int64_t kDefaultExpectedRetransmissionTimeMs = 125;
|
|||
} // namespace
|
||||
|
||||
ModuleRtpRtcpImpl2::RtpSenderContext::RtpSenderContext(
|
||||
const RtpRtcp::Configuration& config)
|
||||
const RtpRtcpInterface::Configuration& config)
|
||||
: packet_history(config.clock, config.enable_rtx_padding_prioritization),
|
||||
packet_sender(config, &packet_history),
|
||||
non_paced_sender(&packet_sender),
|
||||
|
@ -82,7 +82,7 @@ ModuleRtpRtcpImpl2::~ModuleRtpRtcpImpl2() {
|
|||
}
|
||||
|
||||
// static
|
||||
std::unique_ptr<RtpRtcp> ModuleRtpRtcpImpl2::Create(
|
||||
std::unique_ptr<ModuleRtpRtcpImpl2> ModuleRtpRtcpImpl2::Create(
|
||||
const Configuration& configuration) {
|
||||
RTC_DCHECK(configuration.clock);
|
||||
RTC_DCHECK(TaskQueueBase::Current());
|
||||
|
@ -595,12 +595,6 @@ void ModuleRtpRtcpImpl2::SetExtmapAllowMixed(bool extmap_allow_mixed) {
|
|||
rtp_sender_->packet_generator.SetExtmapAllowMixed(extmap_allow_mixed);
|
||||
}
|
||||
|
||||
int32_t ModuleRtpRtcpImpl2::RegisterSendRtpHeaderExtension(
|
||||
const RTPExtensionType type,
|
||||
const uint8_t id) {
|
||||
return rtp_sender_->packet_generator.RegisterRtpHeaderExtension(type, id);
|
||||
}
|
||||
|
||||
void ModuleRtpRtcpImpl2::RegisterRtpHeaderExtension(absl::string_view uri,
|
||||
int id) {
|
||||
bool registered =
|
||||
|
|
|
@ -43,17 +43,20 @@ class Clock;
|
|||
struct PacedPacketInfo;
|
||||
struct RTPVideoHeader;
|
||||
|
||||
class ModuleRtpRtcpImpl2 final : public RtpRtcp,
|
||||
class ModuleRtpRtcpImpl2 final : public RtpRtcpInterface,
|
||||
public Module,
|
||||
public RTCPReceiver::ModuleRtpRtcp {
|
||||
public:
|
||||
explicit ModuleRtpRtcpImpl2(const RtpRtcp::Configuration& configuration);
|
||||
explicit ModuleRtpRtcpImpl2(
|
||||
const RtpRtcpInterface::Configuration& configuration);
|
||||
~ModuleRtpRtcpImpl2() override;
|
||||
|
||||
// This method is provided to easy with migrating away from the
|
||||
// RtpRtcp::Create factory method. Since this is an internal implementation
|
||||
// detail though, creating an instance of ModuleRtpRtcpImpl2 directly should
|
||||
// be fine.
|
||||
static std::unique_ptr<RtpRtcp> Create(const Configuration& configuration);
|
||||
static std::unique_ptr<ModuleRtpRtcpImpl2> Create(
|
||||
const Configuration& configuration);
|
||||
|
||||
// TODO(tommi): Make implementation private?
|
||||
|
||||
|
@ -80,9 +83,6 @@ class ModuleRtpRtcpImpl2 final : public RtpRtcp,
|
|||
|
||||
void SetExtmapAllowMixed(bool extmap_allow_mixed) override;
|
||||
|
||||
// Register RTP header extension.
|
||||
int32_t RegisterSendRtpHeaderExtension(RTPExtensionType type,
|
||||
uint8_t id) override;
|
||||
void RegisterRtpHeaderExtension(absl::string_view uri, int id) override;
|
||||
int32_t DeregisterSendRtpHeaderExtension(RTPExtensionType type) override;
|
||||
void DeregisterSendRtpHeaderExtension(absl::string_view uri) override;
|
||||
|
@ -313,7 +313,7 @@ class ModuleRtpRtcpImpl2 final : public RtpRtcp,
|
|||
FRIEND_TEST_ALL_PREFIXES(RtpRtcpImpl2Test, RttForReceiverOnly);
|
||||
|
||||
struct RtpSenderContext {
|
||||
explicit RtpSenderContext(const RtpRtcp::Configuration& config);
|
||||
explicit RtpSenderContext(const RtpRtcpInterface::Configuration& config);
|
||||
// Storage of packets, for retransmissions and padding, if applicable.
|
||||
RtpPacketHistory packet_history;
|
||||
// Handles final time timestamping/stats/etc and handover to Transport.
|
||||
|
|
|
@ -143,7 +143,7 @@ class RtpRtcpModule : public RtcpPacketTypeCounterObserver {
|
|||
|
||||
private:
|
||||
void CreateModuleImpl() {
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.audio = false;
|
||||
config.clock = clock_;
|
||||
config.outgoing_transport = &transport_;
|
||||
|
|
|
@ -143,7 +143,7 @@ class RtpRtcpModule : public RtcpPacketTypeCounterObserver {
|
|||
|
||||
private:
|
||||
void CreateModuleImpl() {
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.audio = false;
|
||||
config.clock = clock_;
|
||||
config.outgoing_transport = &transport_;
|
||||
|
|
451
modules/rtp_rtcp/source/rtp_rtcp_interface.h
Normal file
451
modules/rtp_rtcp/source/rtp_rtcp_interface.h
Normal file
|
@ -0,0 +1,451 @@
|
|||
/*
|
||||
* Copyright (c) 2020 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef MODULES_RTP_RTCP_SOURCE_RTP_RTCP_INTERFACE_H_
|
||||
#define MODULES_RTP_RTCP_SOURCE_RTP_RTCP_INTERFACE_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/frame_transformer_interface.h"
|
||||
#include "api/scoped_refptr.h"
|
||||
#include "api/transport/webrtc_key_value_config.h"
|
||||
#include "api/video/video_bitrate_allocation.h"
|
||||
#include "modules/rtp_rtcp/include/receive_statistics.h"
|
||||
#include "modules/rtp_rtcp/include/report_block_data.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_packet_sender.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_sequence_number_map.h"
|
||||
#include "modules/rtp_rtcp/source/video_fec_generator.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// Forward declarations.
|
||||
class FrameEncryptorInterface;
|
||||
class RateLimiter;
|
||||
class RemoteBitrateEstimator;
|
||||
class RtcEventLog;
|
||||
class RTPSender;
|
||||
class Transport;
|
||||
class VideoBitrateAllocationObserver;
|
||||
|
||||
class RtpRtcpInterface : public RtcpFeedbackSenderInterface {
|
||||
public:
|
||||
struct Configuration {
|
||||
Configuration() = default;
|
||||
Configuration(Configuration&& rhs) = default;
|
||||
|
||||
// True for a audio version of the RTP/RTCP module object false will create
|
||||
// a video version.
|
||||
bool audio = false;
|
||||
bool receiver_only = false;
|
||||
|
||||
// The clock to use to read time. If nullptr then system clock will be used.
|
||||
Clock* clock = nullptr;
|
||||
|
||||
ReceiveStatisticsProvider* receive_statistics = nullptr;
|
||||
|
||||
// Transport object that will be called when packets are ready to be sent
|
||||
// out on the network.
|
||||
Transport* outgoing_transport = nullptr;
|
||||
|
||||
// Called when the receiver requests an intra frame.
|
||||
RtcpIntraFrameObserver* intra_frame_callback = nullptr;
|
||||
|
||||
// Called when the receiver sends a loss notification.
|
||||
RtcpLossNotificationObserver* rtcp_loss_notification_observer = nullptr;
|
||||
|
||||
// Called when we receive a changed estimate from the receiver of out
|
||||
// stream.
|
||||
RtcpBandwidthObserver* bandwidth_callback = nullptr;
|
||||
|
||||
NetworkStateEstimateObserver* network_state_estimate_observer = nullptr;
|
||||
TransportFeedbackObserver* transport_feedback_callback = nullptr;
|
||||
VideoBitrateAllocationObserver* bitrate_allocation_observer = nullptr;
|
||||
RtcpRttStats* rtt_stats = nullptr;
|
||||
RtcpPacketTypeCounterObserver* rtcp_packet_type_counter_observer = nullptr;
|
||||
// Called on receipt of RTCP report block from remote side.
|
||||
// TODO(bugs.webrtc.org/10678): Remove RtcpStatisticsCallback in
|
||||
// favor of ReportBlockDataObserver.
|
||||
// TODO(bugs.webrtc.org/10679): Consider whether we want to use
|
||||
// only getters or only callbacks. If we decide on getters, the
|
||||
// ReportBlockDataObserver should also be removed in favor of
|
||||
// GetLatestReportBlockData().
|
||||
RtcpStatisticsCallback* rtcp_statistics_callback = nullptr;
|
||||
RtcpCnameCallback* rtcp_cname_callback = nullptr;
|
||||
ReportBlockDataObserver* report_block_data_observer = nullptr;
|
||||
|
||||
// Estimates the bandwidth available for a set of streams from the same
|
||||
// client.
|
||||
RemoteBitrateEstimator* remote_bitrate_estimator = nullptr;
|
||||
|
||||
// Spread any bursts of packets into smaller bursts to minimize packet loss.
|
||||
RtpPacketSender* paced_sender = nullptr;
|
||||
|
||||
// Generates FEC packets.
|
||||
// TODO(sprang): Wire up to RtpSenderEgress.
|
||||
VideoFecGenerator* fec_generator = nullptr;
|
||||
|
||||
BitrateStatisticsObserver* send_bitrate_observer = nullptr;
|
||||
SendSideDelayObserver* send_side_delay_observer = nullptr;
|
||||
RtcEventLog* event_log = nullptr;
|
||||
SendPacketObserver* send_packet_observer = nullptr;
|
||||
RateLimiter* retransmission_rate_limiter = nullptr;
|
||||
StreamDataCountersCallback* rtp_stats_callback = nullptr;
|
||||
|
||||
int rtcp_report_interval_ms = 0;
|
||||
|
||||
// Update network2 instead of pacer_exit field of video timing extension.
|
||||
bool populate_network2_timestamp = false;
|
||||
|
||||
rtc::scoped_refptr<FrameTransformerInterface> frame_transformer;
|
||||
|
||||
// E2EE Custom Video Frame Encryption
|
||||
FrameEncryptorInterface* frame_encryptor = nullptr;
|
||||
// Require all outgoing frames to be encrypted with a FrameEncryptor.
|
||||
bool require_frame_encryption = false;
|
||||
|
||||
// Corresponds to extmap-allow-mixed in SDP negotiation.
|
||||
bool extmap_allow_mixed = false;
|
||||
|
||||
// If true, the RTP sender will always annotate outgoing packets with
|
||||
// MID and RID header extensions, if provided and negotiated.
|
||||
// If false, the RTP sender will stop sending MID and RID header extensions,
|
||||
// when it knows that the receiver is ready to demux based on SSRC. This is
|
||||
// done by RTCP RR acking.
|
||||
bool always_send_mid_and_rid = false;
|
||||
|
||||
// If set, field trials are read from |field_trials|, otherwise
|
||||
// defaults to webrtc::FieldTrialBasedConfig.
|
||||
const WebRtcKeyValueConfig* field_trials = nullptr;
|
||||
|
||||
// SSRCs for media and retransmission, respectively.
|
||||
// FlexFec SSRC is fetched from |flexfec_sender|.
|
||||
uint32_t local_media_ssrc = 0;
|
||||
absl::optional<uint32_t> rtx_send_ssrc;
|
||||
|
||||
bool need_rtp_packet_infos = false;
|
||||
|
||||
// If true, the RTP packet history will select RTX packets based on
|
||||
// heuristics such as send time, retransmission count etc, in order to
|
||||
// make padding potentially more useful.
|
||||
// If false, the last packet will always be picked. This may reduce CPU
|
||||
// overhead.
|
||||
bool enable_rtx_padding_prioritization = true;
|
||||
|
||||
private:
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(Configuration);
|
||||
};
|
||||
|
||||
// **************************************************************************
|
||||
// Receiver functions
|
||||
// **************************************************************************
|
||||
|
||||
virtual void IncomingRtcpPacket(const uint8_t* incoming_packet,
|
||||
size_t incoming_packet_length) = 0;
|
||||
|
||||
virtual void SetRemoteSSRC(uint32_t ssrc) = 0;
|
||||
|
||||
// **************************************************************************
|
||||
// Sender
|
||||
// **************************************************************************
|
||||
|
||||
// Sets the maximum size of an RTP packet, including RTP headers.
|
||||
virtual void SetMaxRtpPacketSize(size_t size) = 0;
|
||||
|
||||
// Returns max RTP packet size. Takes into account RTP headers and
|
||||
// FEC/ULP/RED overhead (when FEC is enabled).
|
||||
virtual size_t MaxRtpPacketSize() const = 0;
|
||||
|
||||
virtual void RegisterSendPayloadFrequency(int payload_type,
|
||||
int payload_frequency) = 0;
|
||||
|
||||
// Unregisters a send payload.
|
||||
// |payload_type| - payload type of codec
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t DeRegisterSendPayload(int8_t payload_type) = 0;
|
||||
|
||||
virtual void SetExtmapAllowMixed(bool extmap_allow_mixed) = 0;
|
||||
|
||||
// Register extension by uri, triggers CHECK on falure.
|
||||
virtual void RegisterRtpHeaderExtension(absl::string_view uri, int id) = 0;
|
||||
|
||||
virtual int32_t DeregisterSendRtpHeaderExtension(RTPExtensionType type) = 0;
|
||||
virtual void DeregisterSendRtpHeaderExtension(absl::string_view uri) = 0;
|
||||
|
||||
// Returns true if RTP module is send media, and any of the extensions
|
||||
// required for bandwidth estimation is registered.
|
||||
virtual bool SupportsPadding() const = 0;
|
||||
// Same as SupportsPadding(), but additionally requires that
|
||||
// SetRtxSendStatus() has been called with the kRtxRedundantPayloads option
|
||||
// enabled.
|
||||
virtual bool SupportsRtxPayloadPadding() const = 0;
|
||||
|
||||
// Returns start timestamp.
|
||||
virtual uint32_t StartTimestamp() const = 0;
|
||||
|
||||
// Sets start timestamp. Start timestamp is set to a random value if this
|
||||
// function is never called.
|
||||
virtual void SetStartTimestamp(uint32_t timestamp) = 0;
|
||||
|
||||
// Returns SequenceNumber.
|
||||
virtual uint16_t SequenceNumber() const = 0;
|
||||
|
||||
// Sets SequenceNumber, default is a random number.
|
||||
virtual void SetSequenceNumber(uint16_t seq) = 0;
|
||||
|
||||
virtual void SetRtpState(const RtpState& rtp_state) = 0;
|
||||
virtual void SetRtxState(const RtpState& rtp_state) = 0;
|
||||
virtual RtpState GetRtpState() const = 0;
|
||||
virtual RtpState GetRtxState() const = 0;
|
||||
|
||||
// Returns SSRC.
|
||||
virtual uint32_t SSRC() const = 0;
|
||||
|
||||
// Sets the value for sending in the RID (and Repaired) RTP header extension.
|
||||
// RIDs are used to identify an RTP stream if SSRCs are not negotiated.
|
||||
// If the RID and Repaired RID extensions are not registered, the RID will
|
||||
// not be sent.
|
||||
virtual void SetRid(const std::string& rid) = 0;
|
||||
|
||||
// Sets the value for sending in the MID RTP header extension.
|
||||
// The MID RTP header extension should be registered for this to do anything.
|
||||
// Once set, this value can not be changed or removed.
|
||||
virtual void SetMid(const std::string& mid) = 0;
|
||||
|
||||
// Sets CSRC.
|
||||
// |csrcs| - vector of CSRCs
|
||||
virtual void SetCsrcs(const std::vector<uint32_t>& csrcs) = 0;
|
||||
|
||||
// Turns on/off sending RTX (RFC 4588). The modes can be set as a combination
|
||||
// of values of the enumerator RtxMode.
|
||||
virtual void SetRtxSendStatus(int modes) = 0;
|
||||
|
||||
// Returns status of sending RTX (RFC 4588). The returned value can be
|
||||
// a combination of values of the enumerator RtxMode.
|
||||
virtual int RtxSendStatus() const = 0;
|
||||
|
||||
// Returns the SSRC used for RTX if set, otherwise a nullopt.
|
||||
virtual absl::optional<uint32_t> RtxSsrc() const = 0;
|
||||
|
||||
// Sets the payload type to use when sending RTX packets. Note that this
|
||||
// doesn't enable RTX, only the payload type is set.
|
||||
virtual void SetRtxSendPayloadType(int payload_type,
|
||||
int associated_payload_type) = 0;
|
||||
|
||||
// Returns the FlexFEC SSRC, if there is one.
|
||||
virtual absl::optional<uint32_t> FlexfecSsrc() const = 0;
|
||||
|
||||
// Sets sending status. Sends kRtcpByeCode when going from true to false.
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t SetSendingStatus(bool sending) = 0;
|
||||
|
||||
// Returns current sending status.
|
||||
virtual bool Sending() const = 0;
|
||||
|
||||
// Starts/Stops media packets. On by default.
|
||||
virtual void SetSendingMediaStatus(bool sending) = 0;
|
||||
|
||||
// Returns current media sending status.
|
||||
virtual bool SendingMedia() const = 0;
|
||||
|
||||
// Returns whether audio is configured (i.e. Configuration::audio = true).
|
||||
virtual bool IsAudioConfigured() const = 0;
|
||||
|
||||
// Indicate that the packets sent by this module should be counted towards the
|
||||
// bitrate estimate since the stream participates in the bitrate allocation.
|
||||
virtual void SetAsPartOfAllocation(bool part_of_allocation) = 0;
|
||||
|
||||
// TODO(sprang): Remove when all call sites have been moved to
|
||||
// GetSendRates(). Fetches the current send bitrates in bits/s.
|
||||
virtual void BitrateSent(uint32_t* total_rate,
|
||||
uint32_t* video_rate,
|
||||
uint32_t* fec_rate,
|
||||
uint32_t* nack_rate) const = 0;
|
||||
|
||||
// Returns bitrate sent (post-pacing) per packet type.
|
||||
virtual RtpSendRates GetSendRates() const = 0;
|
||||
|
||||
virtual RTPSender* RtpSender() = 0;
|
||||
virtual const RTPSender* RtpSender() const = 0;
|
||||
|
||||
// Record that a frame is about to be sent. Returns true on success, and false
|
||||
// if the module isn't ready to send.
|
||||
virtual bool OnSendingRtpFrame(uint32_t timestamp,
|
||||
int64_t capture_time_ms,
|
||||
int payload_type,
|
||||
bool force_sender_report) = 0;
|
||||
|
||||
// Try to send the provided packet. Returns true iff packet matches any of
|
||||
// the SSRCs for this module (media/rtx/fec etc) and was forwarded to the
|
||||
// transport.
|
||||
virtual bool TrySendPacket(RtpPacketToSend* packet,
|
||||
const PacedPacketInfo& pacing_info) = 0;
|
||||
|
||||
virtual void OnPacketsAcknowledged(
|
||||
rtc::ArrayView<const uint16_t> sequence_numbers) = 0;
|
||||
|
||||
virtual std::vector<std::unique_ptr<RtpPacketToSend>> GeneratePadding(
|
||||
size_t target_size_bytes) = 0;
|
||||
|
||||
virtual std::vector<RtpSequenceNumberMap::Info> GetSentRtpPacketInfos(
|
||||
rtc::ArrayView<const uint16_t> sequence_numbers) const = 0;
|
||||
|
||||
// Returns an expected per packet overhead representing the main RTP header,
|
||||
// any CSRCs, and the registered header extensions that are expected on all
|
||||
// packets (i.e. disregarding things like abs capture time which is only
|
||||
// populated on a subset of packets, but counting MID/RID type extensions
|
||||
// when we expect to send them).
|
||||
virtual size_t ExpectedPerPacketOverhead() const = 0;
|
||||
|
||||
// **************************************************************************
|
||||
// RTCP
|
||||
// **************************************************************************
|
||||
|
||||
// Returns RTCP status.
|
||||
virtual RtcpMode RTCP() const = 0;
|
||||
|
||||
// Sets RTCP status i.e on(compound or non-compound)/off.
|
||||
// |method| - RTCP method to use.
|
||||
virtual void SetRTCPStatus(RtcpMode method) = 0;
|
||||
|
||||
// Sets RTCP CName (i.e unique identifier).
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t SetCNAME(const char* cname) = 0;
|
||||
|
||||
// Returns remote CName.
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t RemoteCNAME(uint32_t remote_ssrc,
|
||||
char cname[RTCP_CNAME_SIZE]) const = 0;
|
||||
|
||||
// Returns remote NTP.
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t RemoteNTP(uint32_t* received_ntp_secs,
|
||||
uint32_t* received_ntp_frac,
|
||||
uint32_t* rtcp_arrival_time_secs,
|
||||
uint32_t* rtcp_arrival_time_frac,
|
||||
uint32_t* rtcp_timestamp) const = 0;
|
||||
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t AddMixedCNAME(uint32_t ssrc, const char* cname) = 0;
|
||||
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t RemoveMixedCNAME(uint32_t ssrc) = 0;
|
||||
|
||||
// Returns current RTT (round-trip time) estimate.
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t RTT(uint32_t remote_ssrc,
|
||||
int64_t* rtt,
|
||||
int64_t* avg_rtt,
|
||||
int64_t* min_rtt,
|
||||
int64_t* max_rtt) const = 0;
|
||||
|
||||
// Returns the estimated RTT, with fallback to a default value.
|
||||
virtual int64_t ExpectedRetransmissionTimeMs() const = 0;
|
||||
|
||||
// Forces a send of a RTCP packet. Periodic SR and RR are triggered via the
|
||||
// process function.
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t SendRTCP(RTCPPacketType rtcp_packet_type) = 0;
|
||||
|
||||
// Returns statistics of the amount of data sent.
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t DataCountersRTP(size_t* bytes_sent,
|
||||
uint32_t* packets_sent) const = 0;
|
||||
|
||||
// Returns send statistics for the RTP and RTX stream.
|
||||
virtual void GetSendStreamDataCounters(
|
||||
StreamDataCounters* rtp_counters,
|
||||
StreamDataCounters* rtx_counters) const = 0;
|
||||
|
||||
// Returns received RTCP report block.
|
||||
// Returns -1 on failure else 0.
|
||||
// TODO(https://crbug.com/webrtc/10678): Remove this in favor of
|
||||
// GetLatestReportBlockData().
|
||||
virtual int32_t RemoteRTCPStat(
|
||||
std::vector<RTCPReportBlock>* receive_blocks) const = 0;
|
||||
// A snapshot of Report Blocks with additional data of interest to statistics.
|
||||
// Within this list, the sender-source SSRC pair is unique and per-pair the
|
||||
// ReportBlockData represents the latest Report Block that was received for
|
||||
// that pair.
|
||||
virtual std::vector<ReportBlockData> GetLatestReportBlockData() const = 0;
|
||||
|
||||
// (APP) Sets application specific data.
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t SetRTCPApplicationSpecificData(uint8_t sub_type,
|
||||
uint32_t name,
|
||||
const uint8_t* data,
|
||||
uint16_t length) = 0;
|
||||
// (XR) Sets Receiver Reference Time Report (RTTR) status.
|
||||
virtual void SetRtcpXrRrtrStatus(bool enable) = 0;
|
||||
|
||||
// Returns current Receiver Reference Time Report (RTTR) status.
|
||||
virtual bool RtcpXrRrtrStatus() const = 0;
|
||||
|
||||
// (REMB) Receiver Estimated Max Bitrate.
|
||||
// Schedules sending REMB on next and following sender/receiver reports.
|
||||
void SetRemb(int64_t bitrate_bps, std::vector<uint32_t> ssrcs) override = 0;
|
||||
// Stops sending REMB on next and following sender/receiver reports.
|
||||
void UnsetRemb() override = 0;
|
||||
|
||||
// (TMMBR) Temporary Max Media Bit Rate
|
||||
virtual bool TMMBR() const = 0;
|
||||
|
||||
virtual void SetTMMBRStatus(bool enable) = 0;
|
||||
|
||||
// (NACK)
|
||||
|
||||
// Sends a Negative acknowledgement packet.
|
||||
// Returns -1 on failure else 0.
|
||||
// TODO(philipel): Deprecate this and start using SendNack instead, mostly
|
||||
// because we want a function that actually send NACK for the specified
|
||||
// packets.
|
||||
virtual int32_t SendNACK(const uint16_t* nack_list, uint16_t size) = 0;
|
||||
|
||||
// Sends NACK for the packets specified.
|
||||
// Note: This assumes the caller keeps track of timing and doesn't rely on
|
||||
// the RTP module to do this.
|
||||
virtual void SendNack(const std::vector<uint16_t>& sequence_numbers) = 0;
|
||||
|
||||
// Store the sent packets, needed to answer to a Negative acknowledgment
|
||||
// requests.
|
||||
virtual void SetStorePacketsStatus(bool enable, uint16_t numberToStore) = 0;
|
||||
|
||||
// Returns true if the module is configured to store packets.
|
||||
virtual bool StorePackets() const = 0;
|
||||
|
||||
virtual void SetVideoBitrateAllocation(
|
||||
const VideoBitrateAllocation& bitrate) = 0;
|
||||
|
||||
// **************************************************************************
|
||||
// Video
|
||||
// **************************************************************************
|
||||
|
||||
// Requests new key frame.
|
||||
// using PLI, https://tools.ietf.org/html/rfc4585#section-6.3.1.1
|
||||
void SendPictureLossIndication() { SendRTCP(kRtcpPli); }
|
||||
// using FIR, https://tools.ietf.org/html/rfc5104#section-4.3.1.2
|
||||
void SendFullIntraRequest() { SendRTCP(kRtcpFir); }
|
||||
|
||||
// Sends a LossNotification RTCP message.
|
||||
// Returns -1 on failure else 0.
|
||||
virtual int32_t SendLossNotification(uint16_t last_decoded_seq_num,
|
||||
uint16_t last_received_seq_num,
|
||||
bool decodability_flag,
|
||||
bool buffering_allowed) = 0;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // MODULES_RTP_RTCP_SOURCE_RTP_RTCP_INTERFACE_H_
|
|
@ -154,7 +154,7 @@ double GetMaxPaddingSizeFactor(const WebRtcKeyValueConfig* field_trials) {
|
|||
|
||||
} // namespace
|
||||
|
||||
RTPSender::RTPSender(const RtpRtcp::Configuration& config,
|
||||
RTPSender::RTPSender(const RtpRtcpInterface::Configuration& config,
|
||||
RtpPacketHistory* packet_history,
|
||||
RtpPacketSender* packet_sender)
|
||||
: clock_(config.clock),
|
||||
|
|
|
@ -25,10 +25,10 @@
|
|||
#include "modules/rtp_rtcp/include/flexfec_sender.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_header_extension_map.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_packet_sender.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_packet_history.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_config.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/critical_section.h"
|
||||
#include "rtc_base/deprecation.h"
|
||||
|
@ -45,7 +45,7 @@ class RtpPacketToSend;
|
|||
|
||||
class RTPSender {
|
||||
public:
|
||||
RTPSender(const RtpRtcp::Configuration& config,
|
||||
RTPSender(const RtpRtcpInterface::Configuration& config,
|
||||
RtpPacketHistory* packet_history,
|
||||
RtpPacketSender* packet_sender);
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ class RtpSenderAudioTest : public ::testing::Test {
|
|||
RtpSenderAudioTest()
|
||||
: fake_clock_(kStartTime),
|
||||
rtp_module_(ModuleRtpRtcpImpl2::Create([&] {
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.audio = true;
|
||||
config.clock = &fake_clock_;
|
||||
config.outgoing_transport = &transport_;
|
||||
|
@ -82,7 +82,7 @@ class RtpSenderAudioTest : public ::testing::Test {
|
|||
|
||||
SimulatedClock fake_clock_;
|
||||
LoopbackTransportTest transport_;
|
||||
std::unique_ptr<RtpRtcp> rtp_module_;
|
||||
std::unique_ptr<ModuleRtpRtcpImpl2> rtp_module_;
|
||||
RTPSenderAudio rtp_sender_audio_;
|
||||
};
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ void RtpSenderEgress::NonPacedPacketSender::EnqueuePackets(
|
|||
}
|
||||
}
|
||||
|
||||
RtpSenderEgress::RtpSenderEgress(const RtpRtcp::Configuration& config,
|
||||
RtpSenderEgress::RtpSenderEgress(const RtpRtcpInterface::Configuration& config,
|
||||
RtpPacketHistory* packet_history)
|
||||
: ssrc_(config.local_media_ssrc),
|
||||
rtx_ssrc_(config.rtx_send_ssrc),
|
||||
|
|
|
@ -19,10 +19,10 @@
|
|||
#include "api/call/transport.h"
|
||||
#include "api/rtc_event_log/rtc_event_log.h"
|
||||
#include "api/units/data_rate.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_packet_history.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_sequence_number_map.h"
|
||||
#include "rtc_base/critical_section.h"
|
||||
#include "rtc_base/rate_statistics.h"
|
||||
|
@ -47,7 +47,7 @@ class RtpSenderEgress {
|
|||
RtpSenderEgress* const sender_;
|
||||
};
|
||||
|
||||
RtpSenderEgress(const RtpRtcp::Configuration& config,
|
||||
RtpSenderEgress(const RtpRtcpInterface::Configuration& config,
|
||||
RtpPacketHistory* packet_history);
|
||||
~RtpSenderEgress() = default;
|
||||
|
||||
|
|
|
@ -212,7 +212,7 @@ class StreamDataTestCallback : public StreamDataCountersCallback {
|
|||
// TODO(sprang): Split up unit tests and test these components individually
|
||||
// wherever possible.
|
||||
struct RtpSenderContext {
|
||||
explicit RtpSenderContext(const RtpRtcp::Configuration& config)
|
||||
explicit RtpSenderContext(const RtpRtcpInterface::Configuration& config)
|
||||
: packet_history_(config.clock, config.enable_rtx_padding_prioritization),
|
||||
packet_sender_(config, &packet_history_),
|
||||
non_paced_sender_(&packet_sender_),
|
||||
|
@ -285,7 +285,7 @@ class RtpSenderTest : public ::testing::TestWithParam<TestConfig> {
|
|||
void SetUpRtpSender(bool pacer,
|
||||
bool populate_network2,
|
||||
bool always_send_mid_and_rid) {
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &fake_clock_;
|
||||
config.outgoing_transport = &transport_;
|
||||
config.local_media_ssrc = kSsrc;
|
||||
|
@ -481,7 +481,7 @@ TEST_P(RtpSenderTestWithoutPacer, AssignSequenceNumberMayAllowPaddingOnVideo) {
|
|||
|
||||
TEST_P(RtpSenderTest, AssignSequenceNumberAllowsPaddingOnAudio) {
|
||||
MockTransport transport;
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.audio = true;
|
||||
config.clock = &fake_clock_;
|
||||
config.outgoing_transport = &transport;
|
||||
|
@ -531,7 +531,7 @@ TEST_P(RtpSenderTestWithoutPacer,
|
|||
TransportFeedbackObserverGetsCorrectByteCount) {
|
||||
constexpr size_t kRtpOverheadBytesPerPacket = 12 + 8;
|
||||
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &fake_clock_;
|
||||
config.outgoing_transport = &transport_;
|
||||
config.local_media_ssrc = kSsrc;
|
||||
|
@ -566,7 +566,7 @@ TEST_P(RtpSenderTestWithoutPacer,
|
|||
}
|
||||
|
||||
TEST_P(RtpSenderTestWithoutPacer, SendsPacketsWithTransportSequenceNumber) {
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &fake_clock_;
|
||||
config.outgoing_transport = &transport_;
|
||||
config.local_media_ssrc = kSsrc;
|
||||
|
@ -605,7 +605,7 @@ TEST_P(RtpSenderTestWithoutPacer, SendsPacketsWithTransportSequenceNumber) {
|
|||
}
|
||||
|
||||
TEST_P(RtpSenderTestWithoutPacer, PacketOptionsNoRetransmission) {
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &fake_clock_;
|
||||
config.outgoing_transport = &transport_;
|
||||
config.local_media_ssrc = kSsrc;
|
||||
|
@ -660,7 +660,7 @@ TEST_P(RtpSenderTestWithoutPacer, DoesnSetIncludedInAllocationByDefault) {
|
|||
TEST_P(RtpSenderTestWithoutPacer, OnSendSideDelayUpdated) {
|
||||
StrictMock<MockSendSideDelayObserver> send_side_delay_observer_;
|
||||
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &fake_clock_;
|
||||
config.outgoing_transport = &transport_;
|
||||
config.local_media_ssrc = kSsrc;
|
||||
|
@ -747,7 +747,7 @@ TEST_P(RtpSenderTestWithoutPacer, OnSendPacketUpdated) {
|
|||
}
|
||||
|
||||
TEST_P(RtpSenderTest, SendsPacketsWithTransportSequenceNumber) {
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &fake_clock_;
|
||||
config.outgoing_transport = &transport_;
|
||||
config.paced_sender = &mock_paced_sender_;
|
||||
|
@ -1239,7 +1239,7 @@ TEST_P(RtpSenderTest, SendFlexfecPackets) {
|
|||
nullptr /* rtp_state */, &fake_clock_);
|
||||
|
||||
// Reset |rtp_sender_| to use FlexFEC.
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &fake_clock_;
|
||||
config.outgoing_transport = &transport_;
|
||||
config.paced_sender = &mock_paced_sender_;
|
||||
|
@ -1328,7 +1328,7 @@ TEST_P(RtpSenderTestWithoutPacer, SendFlexfecPackets) {
|
|||
nullptr /* rtp_state */, &fake_clock_);
|
||||
|
||||
// Reset |rtp_sender_| to use FlexFEC.
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &fake_clock_;
|
||||
config.outgoing_transport = &transport_;
|
||||
config.local_media_ssrc = kSsrc;
|
||||
|
@ -1661,7 +1661,7 @@ TEST_P(RtpSenderTest, FecOverheadRate) {
|
|||
nullptr /* rtp_state */, &fake_clock_);
|
||||
|
||||
// Reset |rtp_sender_| to use FlexFEC.
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &fake_clock_;
|
||||
config.outgoing_transport = &transport_;
|
||||
config.paced_sender = &mock_paced_sender_;
|
||||
|
@ -1742,7 +1742,7 @@ TEST_P(RtpSenderTest, BitrateCallbacks) {
|
|||
uint32_t retransmit_bitrate_;
|
||||
} callback;
|
||||
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &fake_clock_;
|
||||
config.outgoing_transport = &transport_;
|
||||
config.local_media_ssrc = kSsrc;
|
||||
|
@ -1970,7 +1970,7 @@ TEST_P(RtpSenderTestWithoutPacer, RespectsNackBitrateLimit) {
|
|||
}
|
||||
|
||||
TEST_P(RtpSenderTest, UpdatingCsrcsUpdatedOverhead) {
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &fake_clock_;
|
||||
config.outgoing_transport = &transport_;
|
||||
config.local_media_ssrc = kSsrc;
|
||||
|
@ -1986,7 +1986,7 @@ TEST_P(RtpSenderTest, UpdatingCsrcsUpdatedOverhead) {
|
|||
}
|
||||
|
||||
TEST_P(RtpSenderTest, OnOverheadChanged) {
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &fake_clock_;
|
||||
config.outgoing_transport = &transport_;
|
||||
config.local_media_ssrc = kSsrc;
|
||||
|
@ -2005,7 +2005,7 @@ TEST_P(RtpSenderTest, OnOverheadChanged) {
|
|||
}
|
||||
|
||||
TEST_P(RtpSenderTest, CountMidOnlyUntilAcked) {
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &fake_clock_;
|
||||
config.outgoing_transport = &transport_;
|
||||
config.local_media_ssrc = kSsrc;
|
||||
|
@ -2032,7 +2032,7 @@ TEST_P(RtpSenderTest, CountMidOnlyUntilAcked) {
|
|||
}
|
||||
|
||||
TEST_P(RtpSenderTest, DontCountVolatileExtensionsIntoOverhead) {
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &fake_clock_;
|
||||
config.outgoing_transport = &transport_;
|
||||
config.local_media_ssrc = kSsrc;
|
||||
|
@ -2250,7 +2250,7 @@ TEST_P(RtpSenderTest, SendPacketUpdatesStats) {
|
|||
|
||||
StrictMock<MockSendSideDelayObserver> send_side_delay_observer;
|
||||
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &fake_clock_;
|
||||
config.outgoing_transport = &transport_;
|
||||
config.local_media_ssrc = kSsrc;
|
||||
|
|
|
@ -170,7 +170,7 @@ class RtpSenderVideoTest : public ::testing::TestWithParam<bool> {
|
|||
fake_clock_(kStartTime),
|
||||
retransmission_rate_limiter_(&fake_clock_, 1000),
|
||||
rtp_module_(ModuleRtpRtcpImpl2::Create([&] {
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &fake_clock_;
|
||||
config.outgoing_transport = &transport_;
|
||||
config.retransmission_rate_limiter = &retransmission_rate_limiter_;
|
||||
|
@ -190,12 +190,12 @@ class RtpSenderVideoTest : public ::testing::TestWithParam<bool> {
|
|||
int version);
|
||||
|
||||
protected:
|
||||
const RtpRtcp::Configuration config_;
|
||||
const RtpRtcpInterface::Configuration config_;
|
||||
FieldTrials field_trials_;
|
||||
SimulatedClock fake_clock_;
|
||||
LoopbackTransportTest transport_;
|
||||
RateLimiter retransmission_rate_limiter_;
|
||||
std::unique_ptr<RtpRtcp> rtp_module_;
|
||||
std::unique_ptr<ModuleRtpRtcpImpl2> rtp_module_;
|
||||
TestRtpSenderVideo rtp_sender_video_;
|
||||
};
|
||||
|
||||
|
@ -921,7 +921,7 @@ class RtpSenderVideoWithFrameTransformerTest : public ::testing::Test {
|
|||
: fake_clock_(kStartTime),
|
||||
retransmission_rate_limiter_(&fake_clock_, 1000),
|
||||
rtp_module_(ModuleRtpRtcpImpl2::Create([&] {
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &fake_clock_;
|
||||
config.outgoing_transport = &transport_;
|
||||
config.retransmission_rate_limiter = &retransmission_rate_limiter_;
|
||||
|
@ -948,7 +948,7 @@ class RtpSenderVideoWithFrameTransformerTest : public ::testing::Test {
|
|||
SimulatedClock fake_clock_;
|
||||
LoopbackTransportTest transport_;
|
||||
RateLimiter retransmission_rate_limiter_;
|
||||
std::unique_ptr<RtpRtcp> rtp_module_;
|
||||
std::unique_ptr<ModuleRtpRtcpImpl2> rtp_module_;
|
||||
};
|
||||
|
||||
std::unique_ptr<EncodedImage> CreateDefaultEncodedImage() {
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
#include "modules/pacing/paced_sender.h"
|
||||
#include "modules/pacing/packet_router.h"
|
||||
#include "modules/remote_bitrate_estimator/include/bwe_defines.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet/common_header.h"
|
||||
|
@ -54,6 +53,7 @@
|
|||
#include "modules/rtp_rtcp/source/rtcp_packet/sender_report.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_header_extensions.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_utility.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/format_macros.h"
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet/tmmb_item.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_receiver.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "system_wrappers/include/clock.h"
|
||||
|
||||
|
@ -40,7 +40,7 @@ void FuzzOneInput(const uint8_t* data, size_t size) {
|
|||
NullModuleRtpRtcp rtp_rtcp_module;
|
||||
SimulatedClock clock(1234);
|
||||
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = &clock;
|
||||
config.rtcp_report_interval_ms = kRtcpIntervalMs;
|
||||
config.local_media_ssrc = 1;
|
||||
|
|
|
@ -238,7 +238,7 @@ TEST_F(BandwidthEndToEndTest, RembWithSendSideBwe) {
|
|||
encoder_config->max_bitrate_bps = 2000000;
|
||||
|
||||
ASSERT_EQ(1u, receive_configs->size());
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.receiver_only = true;
|
||||
config.clock = clock_;
|
||||
config.outgoing_transport = receive_transport_;
|
||||
|
@ -303,7 +303,7 @@ TEST_F(BandwidthEndToEndTest, RembWithSendSideBwe) {
|
|||
Clock* const clock_;
|
||||
uint32_t sender_ssrc_;
|
||||
int remb_bitrate_bps_;
|
||||
std::unique_ptr<RtpRtcp> rtp_rtcp_;
|
||||
std::unique_ptr<ModuleRtpRtcpImpl2> rtp_rtcp_;
|
||||
test::PacketTransport* receive_transport_;
|
||||
TestState state_;
|
||||
RateLimiter retransmission_rate_limiter_;
|
||||
|
|
|
@ -782,10 +782,10 @@ void ReceiveStatisticsProxy::RtcpPacketTypesCounterUpdated(
|
|||
return;
|
||||
|
||||
if (!IsCurrentTaskQueueOrThread(worker_thread_)) {
|
||||
// RtpRtcp::Configuration has a single RtcpPacketTypeCounterObserver and
|
||||
// that same configuration may be used for both receiver and sender
|
||||
// (see ModuleRtpRtcpImpl::ModuleRtpRtcpImpl).
|
||||
// The RTCPSender implementation currently makes calls to this function on a
|
||||
// RtpRtcpInterface::Configuration has a single
|
||||
// RtcpPacketTypeCounterObserver and that same configuration may be used for
|
||||
// both receiver and sender (see ModuleRtpRtcpImpl::ModuleRtpRtcpImpl). The
|
||||
// RTCPSender implementation currently makes calls to this function on a
|
||||
// process thread whereas the RTCPReceiver implementation calls back on the
|
||||
// [main] worker thread.
|
||||
// So until the sender implementation has been updated, we work around this
|
||||
|
|
|
@ -85,7 +85,7 @@ std::unique_ptr<RtpRtcp> CreateRtpRtcpModule(
|
|||
RtcpPacketTypeCounterObserver* rtcp_packet_type_counter_observer,
|
||||
RtcpCnameCallback* rtcp_cname_callback,
|
||||
uint32_t local_ssrc) {
|
||||
RtpRtcp::Configuration configuration;
|
||||
RtpRtcpInterface::Configuration configuration;
|
||||
configuration.clock = clock;
|
||||
configuration.audio = false;
|
||||
configuration.receiver_only = true;
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include "modules/rtp_rtcp/source/rtp_header_extensions.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_packet_received.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_config.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_impl2.h"
|
||||
#include "modules/rtp_rtcp/source/video_rtp_depacketizer.h"
|
||||
#include "modules/rtp_rtcp/source/video_rtp_depacketizer_raw.h"
|
||||
#include "modules/utility/include/process_thread.h"
|
||||
|
@ -77,7 +76,7 @@ int PacketBufferMaxSize() {
|
|||
return packet_buffer_max_size;
|
||||
}
|
||||
|
||||
std::unique_ptr<RtpRtcp> CreateRtpRtcpModule(
|
||||
std::unique_ptr<ModuleRtpRtcpImpl2> CreateRtpRtcpModule(
|
||||
Clock* clock,
|
||||
ReceiveStatistics* receive_statistics,
|
||||
Transport* outgoing_transport,
|
||||
|
@ -85,7 +84,7 @@ std::unique_ptr<RtpRtcp> CreateRtpRtcpModule(
|
|||
RtcpPacketTypeCounterObserver* rtcp_packet_type_counter_observer,
|
||||
RtcpCnameCallback* rtcp_cname_callback,
|
||||
uint32_t local_ssrc) {
|
||||
RtpRtcp::Configuration configuration;
|
||||
RtpRtcpInterface::Configuration configuration;
|
||||
configuration.clock = clock;
|
||||
configuration.audio = false;
|
||||
configuration.receiver_only = true;
|
||||
|
@ -97,7 +96,8 @@ std::unique_ptr<RtpRtcp> CreateRtpRtcpModule(
|
|||
configuration.rtcp_cname_callback = rtcp_cname_callback;
|
||||
configuration.local_media_ssrc = local_ssrc;
|
||||
|
||||
std::unique_ptr<RtpRtcp> rtp_rtcp = ModuleRtpRtcpImpl2::Create(configuration);
|
||||
std::unique_ptr<ModuleRtpRtcpImpl2> rtp_rtcp =
|
||||
ModuleRtpRtcpImpl2::Create(configuration);
|
||||
rtp_rtcp->SetRTCPStatus(RtcpMode::kCompound);
|
||||
|
||||
return rtp_rtcp;
|
||||
|
|
|
@ -26,11 +26,12 @@
|
|||
#include "modules/rtp_rtcp/include/receive_statistics.h"
|
||||
#include "modules/rtp_rtcp/include/remote_ntp_time_estimator.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_header_extension_map.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "modules/rtp_rtcp/source/absolute_capture_time_receiver.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_dependency_descriptor_extension.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_packet_received.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_impl2.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_video_header.h"
|
||||
#include "modules/rtp_rtcp/source/video_rtp_depacketizer.h"
|
||||
#include "modules/video_coding/h264_sps_pps_tracker.h"
|
||||
|
@ -289,7 +290,7 @@ class RtpVideoStreamReceiver2 : public LossNotificationSender,
|
|||
bool receiving_ RTC_GUARDED_BY(worker_task_checker_);
|
||||
int64_t last_packet_log_ms_ RTC_GUARDED_BY(worker_task_checker_);
|
||||
|
||||
const std::unique_ptr<RtpRtcp> rtp_rtcp_;
|
||||
const std::unique_ptr<ModuleRtpRtcpImpl2> rtp_rtcp_;
|
||||
|
||||
video_coding::OnCompleteFrameCallback* complete_frame_callback_;
|
||||
KeyFrameRequestSender* const keyframe_request_sender_;
|
||||
|
|
|
@ -948,7 +948,7 @@ void VideoSendStreamTest::TestNackRetransmission(
|
|||
non_padding_sequence_numbers_.end() - kNackedPacketsAtOnceCount,
|
||||
non_padding_sequence_numbers_.end());
|
||||
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = Clock::GetRealTimeClock();
|
||||
config.outgoing_transport = transport_adapter_.get();
|
||||
config.rtcp_report_interval_ms = kRtcpIntervalMs;
|
||||
|
@ -1164,7 +1164,7 @@ void VideoSendStreamTest::TestPacketFragmentationSize(VideoFormat format,
|
|||
kVideoSendSsrcs[0], rtp_packet.SequenceNumber(),
|
||||
packets_lost_, // Cumulative lost.
|
||||
loss_ratio); // Loss percent.
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = Clock::GetRealTimeClock();
|
||||
config.receive_statistics = &lossy_receive_stats;
|
||||
config.outgoing_transport = transport_adapter_.get();
|
||||
|
@ -1416,7 +1416,7 @@ TEST_F(VideoSendStreamTest, SuspendBelowMinBitrate) {
|
|||
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_) {
|
||||
FakeReceiveStatistics receive_stats(kVideoSendSsrcs[0],
|
||||
last_sequence_number_, rtp_count_, 0);
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = clock_;
|
||||
config.receive_statistics = &receive_stats;
|
||||
config.outgoing_transport = transport_adapter_.get();
|
||||
|
@ -1673,7 +1673,7 @@ TEST_F(VideoSendStreamTest, MinTransmitBitrateRespectsRemb) {
|
|||
VideoSendStream* send_stream,
|
||||
const std::vector<VideoReceiveStream*>& receive_streams) override {
|
||||
stream_ = send_stream;
|
||||
RtpRtcp::Configuration config;
|
||||
RtpRtcpInterface::Configuration config;
|
||||
config.clock = Clock::GetRealTimeClock();
|
||||
config.outgoing_transport = feedback_transport_.get();
|
||||
config.retransmission_rate_limiter = &retranmission_rate_limiter_;
|
||||
|
@ -1697,7 +1697,7 @@ TEST_F(VideoSendStreamTest, MinTransmitBitrateRespectsRemb) {
|
|||
}
|
||||
|
||||
TaskQueueBase* const task_queue_;
|
||||
std::unique_ptr<RtpRtcp> rtp_rtcp_;
|
||||
std::unique_ptr<ModuleRtpRtcpImpl2> rtp_rtcp_;
|
||||
std::unique_ptr<internal::TransportAdapter> feedback_transport_;
|
||||
RateLimiter retranmission_rate_limiter_;
|
||||
VideoSendStream* stream_;
|
||||
|
|
Loading…
Reference in a new issue