#include "modules/pacing/packet_router.h"
#include <algorithm>
#include <cstdint>
#include <limits>
#include <memory>
#include <utility>
#include "absl/functional/any_invocable.h"
#include "absl/types/optional.h"
#include "api/transport/network_types.h"
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "modules/rtp_rtcp/source/rtcp_packet.h"
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "rtc_base/system/unused.h"
#include "rtc_base/trace_event.h"
namespace webrtc {
PacketRouter::PacketRouter()
: … { … }
PacketRouter::~PacketRouter() { … }
void PacketRouter::AddSendRtpModule(RtpRtcpInterface* rtp_module,
bool remb_candidate) { … }
bool PacketRouter::SupportsRtxPayloadPadding() const { … }
void PacketRouter::RegisterNotifyBweCallback(
absl::AnyInvocable<void(const RtpPacketToSend& packet,
const PacedPacketInfo& pacing_info)> callback) { … }
void PacketRouter::AddSendRtpModuleToMap(RtpRtcpInterface* rtp_module,
uint32_t ssrc) { … }
void PacketRouter::RemoveSendRtpModuleFromMap(uint32_t ssrc) { … }
void PacketRouter::RemoveSendRtpModule(RtpRtcpInterface* rtp_module) { … }
void PacketRouter::AddReceiveRtpModule(RtcpFeedbackSenderInterface* rtcp_sender,
bool remb_candidate) { … }
void PacketRouter::RemoveReceiveRtpModule(
RtcpFeedbackSenderInterface* rtcp_sender) { … }
void PacketRouter::SendPacket(std::unique_ptr<RtpPacketToSend> packet,
const PacedPacketInfo& cluster_info) { … }
void PacketRouter::OnBatchComplete() { … }
std::vector<std::unique_ptr<RtpPacketToSend>> PacketRouter::FetchFec() { … }
std::vector<std::unique_ptr<RtpPacketToSend>> PacketRouter::GeneratePadding(
DataSize size) { … }
void PacketRouter::OnAbortedRetransmissions(
uint32_t ssrc,
rtc::ArrayView<const uint16_t> sequence_numbers) { … }
absl::optional<uint32_t> PacketRouter::GetRtxSsrcForMedia(uint32_t ssrc) const { … }
void PacketRouter::SendRemb(int64_t bitrate_bps, std::vector<uint32_t> ssrcs) { … }
void PacketRouter::SendCombinedRtcpPacket(
std::vector<std::unique_ptr<rtcp::RtcpPacket>> packets) { … }
void PacketRouter::AddRembModuleCandidate(
RtcpFeedbackSenderInterface* candidate_module,
bool media_sender) { … }
void PacketRouter::MaybeRemoveRembModuleCandidate(
RtcpFeedbackSenderInterface* candidate_module,
bool media_sender) { … }
void PacketRouter::UnsetActiveRembModule() { … }
void PacketRouter::DetermineActiveRembModule() { … }
}