diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /third_party/libwebrtc/rtc_base/network/received_packet.h | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/rtc_base/network/received_packet.h')
-rw-r--r-- | third_party/libwebrtc/rtc_base/network/received_packet.h | 18 |
1 files changed, 15 insertions, 3 deletions
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 |