From d8bbc7858622b6d9c278469aab701ca0b609cddf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:35:49 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- .../api/transport/rtp/dependency_descriptor.h | 21 +++++++++++++++++++++ third_party/libwebrtc/api/transport/stun.cc | 20 +++++++++++--------- 2 files changed, 32 insertions(+), 9 deletions(-) (limited to 'third_party/libwebrtc/api/transport') diff --git a/third_party/libwebrtc/api/transport/rtp/dependency_descriptor.h b/third_party/libwebrtc/api/transport/rtp/dependency_descriptor.h index 0db600918e..f546a0aa3f 100644 --- a/third_party/libwebrtc/api/transport/rtp/dependency_descriptor.h +++ b/third_party/libwebrtc/api/transport/rtp/dependency_descriptor.h @@ -78,6 +78,27 @@ struct FrameDependencyStructure { std::vector templates; }; +class DependencyDescriptorMandatory { + public: + void set_frame_number(int frame_number) { frame_number_ = frame_number; } + int frame_number() const { return frame_number_; } + + void set_template_id(int template_id) { template_id_ = template_id; } + int template_id() const { return template_id_; } + + void set_first_packet_in_frame(bool first) { first_packet_in_frame_ = first; } + bool first_packet_in_frame() const { return first_packet_in_frame_; } + + void set_last_packet_in_frame(bool last) { last_packet_in_frame_ = last; } + bool last_packet_in_frame() const { return last_packet_in_frame_; } + + private: + int frame_number_; + int template_id_; + bool first_packet_in_frame_; + bool last_packet_in_frame_; +}; + struct DependencyDescriptor { static constexpr int kMaxSpatialIds = 4; static constexpr int kMaxTemporalIds = 8; diff --git a/third_party/libwebrtc/api/transport/stun.cc b/third_party/libwebrtc/api/transport/stun.cc index 7ef6852260..ca90515952 100644 --- a/third_party/libwebrtc/api/transport/stun.cc +++ b/third_party/libwebrtc/api/transport/stun.cc @@ -587,7 +587,7 @@ bool StunMessage::AddFingerprint() { bool StunMessage::Read(ByteBufferReader* buf) { // Keep a copy of the buffer data around for later verification. - buffer_.assign(buf->Data(), buf->Length()); + buffer_.assign(reinterpret_cast(buf->Data()), buf->Length()); if (!buf->ReadUInt16(&type_)) { return false; @@ -603,8 +603,8 @@ bool StunMessage::Read(ByteBufferReader* buf) { return false; } - std::string magic_cookie; - if (!buf->ReadString(&magic_cookie, kStunMagicCookieLength)) { + absl::string_view magic_cookie; + if (!buf->ReadStringView(&magic_cookie, kStunMagicCookieLength)) { return false; } @@ -814,7 +814,7 @@ void StunAttribute::ConsumePadding(ByteBufferReader* buf) const { void StunAttribute::WritePadding(ByteBufferWriter* buf) const { int remainder = length_ % 4; if (remainder > 0) { - char zeroes[4] = {0}; + uint8_t zeroes[4] = {0}; buf->WriteBytes(zeroes, 4 - remainder); } } @@ -949,12 +949,12 @@ bool StunAddressAttribute::Write(ByteBufferWriter* buf) const { switch (address_.family()) { case AF_INET: { in_addr v4addr = address_.ipaddr().ipv4_address(); - buf->WriteBytes(reinterpret_cast(&v4addr), sizeof(v4addr)); + buf->WriteBytes(reinterpret_cast(&v4addr), sizeof(v4addr)); break; } case AF_INET6: { in6_addr v6addr = address_.ipaddr().ipv6_address(); - buf->WriteBytes(reinterpret_cast(&v6addr), sizeof(v6addr)); + buf->WriteBytes(reinterpret_cast(&v6addr), sizeof(v6addr)); break; } } @@ -1039,12 +1039,14 @@ bool StunXorAddressAttribute::Write(ByteBufferWriter* buf) const { switch (xored_ip.family()) { case AF_INET: { in_addr v4addr = xored_ip.ipv4_address(); - buf->WriteBytes(reinterpret_cast(&v4addr), sizeof(v4addr)); + buf->WriteBytes(reinterpret_cast(&v4addr), + sizeof(v4addr)); break; } case AF_INET6: { in6_addr v6addr = xored_ip.ipv6_address(); - buf->WriteBytes(reinterpret_cast(&v6addr), sizeof(v6addr)); + buf->WriteBytes(reinterpret_cast(&v6addr), + sizeof(v6addr)); break; } } @@ -1170,7 +1172,7 @@ bool StunByteStringAttribute::Write(ByteBufferWriter* buf) const { if (!LengthValid(type(), length())) { return false; } - buf->WriteBytes(reinterpret_cast(bytes_), length()); + buf->WriteBytes(bytes_, length()); WritePadding(buf); return true; } -- cgit v1.2.3