#include "media/base/rtp_utils.h"
#include <string.h>
#include <cstdint>
#include <vector>
#include "media/base/turn_utils.h"
#include "modules/rtp_rtcp/source/rtp_util.h"
#include "rtc_base/async_packet_socket.h"
#include "rtc_base/byte_order.h"
#include "rtc_base/checks.h"
#include "rtc_base/message_digest.h"
namespace cricket {
static const size_t kRtcpPayloadTypeOffset = …;
static const size_t kRtpExtensionHeaderLen = …;
static const size_t kAbsSendTimeExtensionLen = …;
static const size_t kOneByteExtensionHeaderLen = …;
static const size_t kTwoByteExtensionHeaderLen = …;
namespace {
static const uint8_t kFakeAuthTag[10] = …;
void UpdateAbsSendTimeExtensionValue(uint8_t* extension_data,
size_t length,
uint64_t time_us) { … }
void UpdateRtpAuthTag(uint8_t* rtp,
size_t length,
const rtc::PacketTimeUpdateParams& packet_time_params) { … }
bool GetUint8(const void* data, size_t offset, int* value) { … }
}
bool GetRtcpType(const void* data, size_t len, int* value) { … }
bool GetRtcpSsrc(const void* data, size_t len, uint32_t* value) { … }
bool IsValidRtpPayloadType(int payload_type) { … }
bool IsValidRtpPacketSize(RtpPacketType packet_type, size_t size) { … }
absl::string_view RtpPacketTypeToString(RtpPacketType packet_type) { … }
RtpPacketType InferRtpPacketType(rtc::ArrayView<const uint8_t> packet) { … }
bool ValidateRtpHeader(const uint8_t* rtp,
size_t length,
size_t* header_length) { … }
bool UpdateRtpAbsSendTimeExtension(uint8_t* rtp,
size_t length,
int extension_id,
uint64_t time_us) { … }
bool ApplyPacketOptions(uint8_t* data,
size_t length,
const rtc::PacketTimeUpdateParams& packet_time_params,
uint64_t time_us) { … }
}