#include "modules/rtp_rtcp/source/rtp_sender_video.h"
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <limits>
#include <memory>
#include <string>
#include <utility>
#include "absl/algorithm/container.h"
#include "absl/memory/memory.h"
#include "absl/strings/match.h"
#include "api/crypto/frame_encryptor_interface.h"
#include "api/transport/rtp/dependency_descriptor.h"
#include "api/units/frequency.h"
#include "api/units/time_delta.h"
#include "api/units/timestamp.h"
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "modules/rtp_rtcp/source/absolute_capture_time_sender.h"
#include "modules/rtp_rtcp/source/byte_io.h"
#include "modules/rtp_rtcp/source/ntp_time_util.h"
#include "modules/rtp_rtcp/source/rtp_dependency_descriptor_extension.h"
#include "modules/rtp_rtcp/source/rtp_descriptor_authentication.h"
#include "modules/rtp_rtcp/source/rtp_format.h"
#include "modules/rtp_rtcp/source/rtp_generic_frame_descriptor_extension.h"
#include "modules/rtp_rtcp/source/rtp_header_extensions.h"
#include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
#include "modules/rtp_rtcp/source/rtp_video_layers_allocation_extension.h"
#include "rtc_base/checks.h"
#include "rtc_base/experiments/field_trial_parser.h"
#include "rtc_base/logging.h"
namespace webrtc {
namespace {
constexpr size_t kRedForFecHeaderLength = …;
constexpr TimeDelta kMaxUnretransmittableFrameInterval = …;
void BuildRedPayload(const RtpPacketToSend& media_packet,
RtpPacketToSend* red_packet) { … }
bool MinimizeDescriptor(RTPVideoHeader* video_header) { … }
bool IsBaseLayer(const RTPVideoHeader& video_header) { … }
absl::optional<VideoPlayoutDelay> LoadVideoPlayoutDelayOverride(
const FieldTrialsView* key_value_config) { … }
bool PacketWillLikelyBeRequestedForRestransmissionIfLost(
const RTPVideoHeader& video_header) { … }
}
RTPSenderVideo::RTPSenderVideo(const Config& config)
: … { … }
RTPSenderVideo::~RTPSenderVideo() { … }
void RTPSenderVideo::LogAndSendToNetwork(
std::vector<std::unique_ptr<RtpPacketToSend>> packets,
size_t encoder_output_size) { … }
size_t RTPSenderVideo::FecPacketOverhead() const { … }
void RTPSenderVideo::SetRetransmissionSetting(int32_t retransmission_settings) { … }
void RTPSenderVideo::SetVideoStructure(
const FrameDependencyStructure* video_structure) { … }
void RTPSenderVideo::SetVideoStructureAfterTransformation(
const FrameDependencyStructure* video_structure) { … }
void RTPSenderVideo::SetVideoStructureInternal(
const FrameDependencyStructure* video_structure) { … }
void RTPSenderVideo::SetVideoLayersAllocation(
VideoLayersAllocation allocation) { … }
void RTPSenderVideo::SetVideoLayersAllocationAfterTransformation(
VideoLayersAllocation allocation) { … }
void RTPSenderVideo::SetVideoLayersAllocationInternal(
VideoLayersAllocation allocation) { … }
void RTPSenderVideo::AddRtpHeaderExtensions(const RTPVideoHeader& video_header,
bool first_packet,
bool last_packet,
RtpPacketToSend* packet) const { … }
bool RTPSenderVideo::SendVideo(int payload_type,
absl::optional<VideoCodecType> codec_type,
uint32_t rtp_timestamp,
Timestamp capture_time,
rtc::ArrayView<const uint8_t> payload,
size_t encoder_output_size,
RTPVideoHeader video_header,
TimeDelta expected_retransmission_time,
std::vector<uint32_t> csrcs) { … }
bool RTPSenderVideo::SendEncodedImage(int payload_type,
absl::optional<VideoCodecType> codec_type,
uint32_t rtp_timestamp,
const EncodedImage& encoded_image,
RTPVideoHeader video_header,
TimeDelta expected_retransmission_time) { … }
DataRate RTPSenderVideo::PostEncodeOverhead() const { … }
bool RTPSenderVideo::AllowRetransmission(
uint8_t temporal_id,
int32_t retransmission_settings,
TimeDelta expected_retransmission_time) { … }
uint8_t RTPSenderVideo::GetTemporalId(const RTPVideoHeader& header) { … }
bool RTPSenderVideo::UpdateConditionalRetransmit(
uint8_t temporal_id,
TimeDelta expected_retransmission_time) { … }
void RTPSenderVideo::MaybeUpdateCurrentPlayoutDelay(
const RTPVideoHeader& header) { … }
}