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 --- third_party/libwebrtc/rtc_base/network/BUILD.gn | 1 + third_party/libwebrtc/rtc_base/network/received_packet.cc | 6 ++---- third_party/libwebrtc/rtc_base/network/received_packet.h | 9 +++++++++ 3 files changed, 12 insertions(+), 4 deletions(-) (limited to 'third_party/libwebrtc/rtc_base/network') diff --git a/third_party/libwebrtc/rtc_base/network/BUILD.gn b/third_party/libwebrtc/rtc_base/network/BUILD.gn index 7e9cf7ab68..2be484e1e0 100644 --- a/third_party/libwebrtc/rtc_base/network/BUILD.gn +++ b/third_party/libwebrtc/rtc_base/network/BUILD.gn @@ -18,6 +18,7 @@ rtc_library("sent_packet") { } rtc_library("received_packet") { + visibility = [ "*" ] sources = [ "received_packet.cc", "received_packet.h", diff --git a/third_party/libwebrtc/rtc_base/network/received_packet.cc b/third_party/libwebrtc/rtc_base/network/received_packet.cc index 40d6e1142c..95f5e22d3b 100644 --- a/third_party/libwebrtc/rtc_base/network/received_packet.cc +++ b/third_party/libwebrtc/rtc_base/network/received_packet.cc @@ -25,14 +25,12 @@ ReceivedPacket::ReceivedPacket(rtc::ArrayView payload, // static ReceivedPacket ReceivedPacket::CreateFromLegacy( - const char* data, + const uint8_t* data, size_t size, int64_t packet_time_us, const rtc::SocketAddress& source_address) { RTC_DCHECK(packet_time_us == -1 || packet_time_us >= 0); - return ReceivedPacket(rtc::reinterpret_array_view( - rtc::MakeArrayView(data, size)), - source_address, + return ReceivedPacket(rtc::MakeArrayView(data, size), source_address, (packet_time_us >= 0) ? absl::optional( webrtc::Timestamp::Micros(packet_time_us)) diff --git a/third_party/libwebrtc/rtc_base/network/received_packet.h b/third_party/libwebrtc/rtc_base/network/received_packet.h index e33361ca29..d898ccb2e9 100644 --- a/third_party/libwebrtc/rtc_base/network/received_packet.h +++ b/third_party/libwebrtc/rtc_base/network/received_packet.h @@ -47,6 +47,15 @@ class RTC_EXPORT ReceivedPacket { const char* data, size_t size, int64_t packet_time_us, + const rtc::SocketAddress& addr = rtc::SocketAddress()) { + return CreateFromLegacy(reinterpret_cast(data), size, + packet_time_us, addr); + } + + static ReceivedPacket CreateFromLegacy( + const uint8_t* data, + size_t size, + int64_t packet_time_us, const rtc::SocketAddress& = rtc::SocketAddress()); private: -- cgit v1.2.3