summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/rtc_base/test_client.h
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/libwebrtc/rtc_base/test_client.h')
-rw-r--r--third_party/libwebrtc/rtc_base/test_client.h25
1 files changed, 10 insertions, 15 deletions
diff --git a/third_party/libwebrtc/rtc_base/test_client.h b/third_party/libwebrtc/rtc_base/test_client.h
index dd91d37ab9..6fe6fd5b83 100644
--- a/third_party/libwebrtc/rtc_base/test_client.h
+++ b/third_party/libwebrtc/rtc_base/test_client.h
@@ -14,8 +14,11 @@
#include <memory>
#include <vector>
+#include "api/units/timestamp.h"
#include "rtc_base/async_udp_socket.h"
+#include "rtc_base/buffer.h"
#include "rtc_base/fake_clock.h"
+#include "rtc_base/network/received_packet.h"
#include "rtc_base/synchronization/mutex.h"
namespace rtc {
@@ -26,17 +29,12 @@ class TestClient : public sigslot::has_slots<> {
public:
// Records the contents of a packet that was received.
struct Packet {
- Packet(const SocketAddress& a,
- const char* b,
- size_t s,
- int64_t packet_time_us);
+ Packet(const rtc::ReceivedPacket& received_packet);
Packet(const Packet& p);
- virtual ~Packet();
SocketAddress addr;
- char* buf;
- size_t size;
- int64_t packet_time_us;
+ Buffer buf;
+ absl::optional<webrtc::Timestamp> packet_time;
};
// Default timeout for NextPacket reads.
@@ -96,14 +94,11 @@ class TestClient : public sigslot::has_slots<> {
static const int kNoPacketTimeoutMs = 1000;
// Workaround for the fact that AsyncPacketSocket::GetConnState doesn't exist.
Socket::ConnState GetState();
- // Slot for packets read on the socket.
+
void OnPacket(AsyncPacketSocket* socket,
- const char* buf,
- size_t len,
- const SocketAddress& remote_addr,
- const int64_t& packet_time_us);
+ const rtc::ReceivedPacket& received_packet);
void OnReadyToSend(AsyncPacketSocket* socket);
- bool CheckTimestamp(int64_t packet_timestamp);
+ bool CheckTimestamp(absl::optional<webrtc::Timestamp> packet_timestamp);
void AdvanceTime(int ms);
ThreadProcessingFakeClock* fake_clock_ = nullptr;
@@ -111,7 +106,7 @@ class TestClient : public sigslot::has_slots<> {
std::unique_ptr<AsyncPacketSocket> socket_;
std::vector<std::unique_ptr<Packet>> packets_;
int ready_to_send_count_ = 0;
- int64_t prev_packet_timestamp_;
+ absl::optional<webrtc::Timestamp> prev_packet_timestamp_;
};
} // namespace rtc