#include "cast/streaming/sender_packet_router.h"
#include <algorithm>
#include <utility>
#include "cast/streaming/impl/packet_util.h"
#include "cast/streaming/public/constants.h"
#include "platform/base/span.h"
#include "util/chrono_helpers.h"
#include "util/osp_logging.h"
#include "util/saturate_cast.h"
#include "util/stringprintf.h"
namespace openscreen::cast {
operator<<;
SenderPacketRouter::SenderPacketRouter(Environment& environment,
int max_burst_bitrate)
: … { … }
SenderPacketRouter::SenderPacketRouter(Environment& environment,
int max_packets_per_burst,
milliseconds burst_interval)
: … { … }
SenderPacketRouter::~SenderPacketRouter() { … }
void SenderPacketRouter::OnSenderCreated(Ssrc receiver_ssrc, Sender* sender) { … }
void SenderPacketRouter::OnSenderDestroyed(Ssrc receiver_ssrc) { … }
void SenderPacketRouter::RequestRtcpSend(Ssrc receiver_ssrc) { … }
void SenderPacketRouter::RequestRtpSend(Ssrc receiver_ssrc) { … }
void SenderPacketRouter::OnReceivedPacket(const IPEndpoint& source,
Clock::time_point arrival_time,
std::vector<uint8_t> packet) { … }
SenderPacketRouter::SenderEntries::iterator SenderPacketRouter::FindEntry(
Ssrc receiver_ssrc) { … }
void SenderPacketRouter::ScheduleNextBurst() { … }
void SenderPacketRouter::SendBurstOfPackets() { … }
int SenderPacketRouter::SendJustTheRtcpPackets(Clock::time_point send_time) { … }
int SenderPacketRouter::SendJustTheRtpPackets(Clock::time_point send_time,
int num_packets_to_send) { … }
namespace {
constexpr int kBitsPerByte = …;
constexpr auto kOneSecondInMilliseconds = …;
}
int SenderPacketRouter::ComputeMaxPacketsPerBurst(int max_burst_bitrate,
int packet_size,
milliseconds burst_interval) { … }
int SenderPacketRouter::ComputeMaxBurstBitrate(int packet_size,
int max_packets_per_burst,
milliseconds burst_interval) { … }
SenderPacketRouter::Sender::~Sender() = default;
constexpr int SenderPacketRouter::kDefaultMaxBurstBitrate;
constexpr milliseconds SenderPacketRouter::kDefaultBurstInterval;
constexpr Clock::time_point SenderPacketRouter::kNever;
}