diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
commit | 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch) | |
tree | a4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /third_party/libwebrtc/rtc_base/network | |
parent | Adding debian version 124.0.1-1. (diff) | |
download | firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/rtc_base/network')
4 files changed, 37 insertions, 9 deletions
diff --git a/third_party/libwebrtc/rtc_base/network/BUILD.gn b/third_party/libwebrtc/rtc_base/network/BUILD.gn index a42745a4c0..7e9cf7ab68 100644 --- a/third_party/libwebrtc/rtc_base/network/BUILD.gn +++ b/third_party/libwebrtc/rtc_base/network/BUILD.gn @@ -23,8 +23,10 @@ rtc_library("received_packet") { "received_packet.h", ] deps = [ + "..:socket_address", "../../api:array_view", "../../api/units:timestamp", + "../system:rtc_export", ] absl_deps = [ "//third_party/abseil-cpp/absl/functional:any_invocable", diff --git a/third_party/libwebrtc/rtc_base/network/received_packet.cc b/third_party/libwebrtc/rtc_base/network/received_packet.cc index 9612c3dab4..40d6e1142c 100644 --- a/third_party/libwebrtc/rtc_base/network/received_packet.cc +++ b/third_party/libwebrtc/rtc_base/network/received_packet.cc @@ -17,7 +17,26 @@ namespace rtc { ReceivedPacket::ReceivedPacket(rtc::ArrayView<const uint8_t> payload, + const SocketAddress& source_address, absl::optional<webrtc::Timestamp> arrival_time) - : payload_(payload), arrival_time_(std::move(arrival_time)) {} + : payload_(payload), + arrival_time_(std::move(arrival_time)), + source_address_(source_address) {} + +// static +ReceivedPacket ReceivedPacket::CreateFromLegacy( + const char* 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<const uint8_t>( + rtc::MakeArrayView(data, size)), + source_address, + (packet_time_us >= 0) + ? absl::optional<webrtc::Timestamp>( + webrtc::Timestamp::Micros(packet_time_us)) + : absl::nullopt); +} } // namespace rtc diff --git a/third_party/libwebrtc/rtc_base/network/received_packet.h b/third_party/libwebrtc/rtc_base/network/received_packet.h index 7f8b2f934c..e33361ca29 100644 --- a/third_party/libwebrtc/rtc_base/network/received_packet.h +++ b/third_party/libwebrtc/rtc_base/network/received_packet.h @@ -15,6 +15,8 @@ #include "absl/types/optional.h" #include "api/array_view.h" #include "api/units/timestamp.h" +#include "rtc_base/socket_address.h" +#include "rtc_base/system/rtc_export.h" namespace rtc { @@ -22,14 +24,17 @@ namespace rtc { // It contains a payload and metadata. // ReceivedPacket itself does not put constraints on what payload contains. For // example it may contains STUN, SCTP, SRTP, RTP, RTCP.... etc. -class ReceivedPacket { +class RTC_EXPORT ReceivedPacket { public: - // Caller must keep memory pointed to by payload valid for the lifetime of - // this ReceivedPacket. + // Caller must keep memory pointed to by payload and address valid for the + // lifetime of this ReceivedPacket. ReceivedPacket( rtc::ArrayView<const uint8_t> payload, + const SocketAddress& source_address, absl::optional<webrtc::Timestamp> arrival_time = absl::nullopt); + // Address/port of the packet sender. + const SocketAddress& source_address() const { return source_address_; } rtc::ArrayView<const uint8_t> payload() const { return payload_; } // Timestamp when this packet was received. Not available on all socket @@ -38,9 +43,16 @@ class ReceivedPacket { return arrival_time_; } + static ReceivedPacket CreateFromLegacy( + const char* data, + size_t size, + int64_t packet_time_us, + const rtc::SocketAddress& = rtc::SocketAddress()); + private: rtc::ArrayView<const uint8_t> payload_; absl::optional<webrtc::Timestamp> arrival_time_; + const SocketAddress& source_address_; }; } // namespace rtc diff --git a/third_party/libwebrtc/rtc_base/network/sent_packet_gn/moz.build b/third_party/libwebrtc/rtc_base/network/sent_packet_gn/moz.build index a1276d9a7a..fb580667ce 100644 --- a/third_party/libwebrtc/rtc_base/network/sent_packet_gn/moz.build +++ b/third_party/libwebrtc/rtc_base/network/sent_packet_gn/moz.build @@ -184,7 +184,6 @@ if CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "Linux": if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "arm": OS_LIBS += [ - "android_support", "unwind" ] @@ -194,10 +193,6 @@ if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86": "-msse2" ] - OS_LIBS += [ - "android_support" - ] - if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64": DEFINES["_GNU_SOURCE"] = True |