#include "modules/rtp_rtcp/source/rtp_packet.h"
#include <cstdint>
#include <cstring>
#include <string>
#include <utility>
#include <vector>
#include "api/array_view.h"
#include "api/rtp_parameters.h"
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "modules/rtp_rtcp/source/byte_io.h"
#include "modules/rtp_rtcp/source/rtp_header_extensions.h"
#include "rtc_base/checks.h"
#include "rtc_base/copy_on_write_buffer.h"
#include "rtc_base/logging.h"
#include "rtc_base/numerics/safe_conversions.h"
#include "rtc_base/strings/string_builder.h"
namespace webrtc {
namespace {
constexpr size_t kFixedHeaderSize = …;
constexpr uint8_t kRtpVersion = …;
constexpr uint16_t kOneByteExtensionProfileId = …;
constexpr uint16_t kTwoByteExtensionProfileId = …;
constexpr uint16_t kTwobyteExtensionProfileIdAppBitsFilter = …;
constexpr size_t kOneByteExtensionHeaderLength = …;
constexpr size_t kTwoByteExtensionHeaderLength = …;
constexpr size_t kDefaultPacketSize = …;
}
RtpPacket::RtpPacket() : … { … }
RtpPacket::RtpPacket(const ExtensionManager* extensions)
: … { … }
RtpPacket::RtpPacket(const ExtensionManager* extensions, size_t capacity)
: … { … }
RtpPacket::RtpPacket(const RtpPacket&) = default;
RtpPacket::RtpPacket(RtpPacket&&) = default;
RtpPacket& RtpPacket::operator=(const RtpPacket&) = default;
RtpPacket& RtpPacket::operator=(RtpPacket&&) = default;
RtpPacket::~RtpPacket() = default;
void RtpPacket::IdentifyExtensions(ExtensionManager extensions) { … }
bool RtpPacket::Parse(const uint8_t* buffer, size_t buffer_size) { … }
bool RtpPacket::Parse(rtc::ArrayView<const uint8_t> packet) { … }
bool RtpPacket::Parse(rtc::CopyOnWriteBuffer buffer) { … }
std::vector<uint32_t> RtpPacket::Csrcs() const { … }
void RtpPacket::CopyHeaderFrom(const RtpPacket& packet) { … }
void RtpPacket::SetMarker(bool marker_bit) { … }
void RtpPacket::SetPayloadType(uint8_t payload_type) { … }
void RtpPacket::SetSequenceNumber(uint16_t seq_no) { … }
void RtpPacket::SetTimestamp(uint32_t timestamp) { … }
void RtpPacket::SetSsrc(uint32_t ssrc) { … }
void RtpPacket::ZeroMutableExtensions() { … }
void RtpPacket::SetCsrcs(rtc::ArrayView<const uint32_t> csrcs) { … }
rtc::ArrayView<uint8_t> RtpPacket::AllocateRawExtension(int id, size_t length) { … }
void RtpPacket::PromoteToTwoByteHeaderExtension() { … }
uint16_t RtpPacket::SetExtensionLengthMaybeAddZeroPadding(
size_t extensions_offset) { … }
uint8_t* RtpPacket::AllocatePayload(size_t size_bytes) { … }
uint8_t* RtpPacket::SetPayloadSize(size_t size_bytes) { … }
bool RtpPacket::SetPadding(size_t padding_bytes) { … }
void RtpPacket::Clear() { … }
bool RtpPacket::ParseBuffer(const uint8_t* buffer, size_t size) { … }
const RtpPacket::ExtensionInfo* RtpPacket::FindExtensionInfo(int id) const { … }
RtpPacket::ExtensionInfo& RtpPacket::FindOrCreateExtensionInfo(int id) { … }
rtc::ArrayView<const uint8_t> RtpPacket::FindExtension(
ExtensionType type) const { … }
rtc::ArrayView<uint8_t> RtpPacket::AllocateExtension(ExtensionType type,
size_t length) { … }
bool RtpPacket::HasExtension(ExtensionType type) const { … }
bool RtpPacket::RemoveExtension(ExtensionType type) { … }
std::string RtpPacket::ToString() const { … }
}