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/pc/test/rtp_transport_test_util.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/pc/test/rtp_transport_test_util.h')
-rw-r--r-- | third_party/libwebrtc/pc/test/rtp_transport_test_util.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/third_party/libwebrtc/pc/test/rtp_transport_test_util.h b/third_party/libwebrtc/pc/test/rtp_transport_test_util.h index 593ee002c9..563014f94a 100644 --- a/third_party/libwebrtc/pc/test/rtp_transport_test_util.h +++ b/third_party/libwebrtc/pc/test/rtp_transport_test_util.h @@ -33,9 +33,14 @@ class TransportObserver : public RtpPacketSinkInterface { rtp_transport->SubscribeReadyToSend( this, [this](bool arg) { OnReadyToSend(arg); }); rtp_transport->SetUnDemuxableRtpPacketReceivedHandler( - [this](webrtc::RtpPacketReceived& packet) { - OnUndemuxableRtpPacket(packet); - }); + [this](RtpPacketReceived& packet) { OnUndemuxableRtpPacket(packet); }); + rtp_transport->SubscribeSentPacket(this, + [this](const rtc::SentPacket& packet) { + sent_packet_count_++; + if (action_on_sent_packet_) { + action_on_sent_packet_(); + } + }); } // RtpPacketInterface override. @@ -57,6 +62,7 @@ class TransportObserver : public RtpPacketSinkInterface { int rtp_count() const { return rtp_count_; } int un_demuxable_rtp_count() const { return un_demuxable_rtp_count_; } int rtcp_count() const { return rtcp_count_; } + int sent_packet_count() const { return sent_packet_count_; } rtc::CopyOnWriteBuffer last_recv_rtp_packet() { return last_recv_rtp_packet_; @@ -81,16 +87,21 @@ class TransportObserver : public RtpPacketSinkInterface { void SetActionOnReadyToSend(absl::AnyInvocable<void(bool)> action) { action_on_ready_to_send_ = std::move(action); } + void SetActionOnSentPacket(absl::AnyInvocable<void()> action) { + action_on_sent_packet_ = std::move(action); + } private: bool ready_to_send_ = false; int rtp_count_ = 0; int un_demuxable_rtp_count_ = 0; int rtcp_count_ = 0; + int sent_packet_count_ = 0; int ready_to_send_signal_count_ = 0; rtc::CopyOnWriteBuffer last_recv_rtp_packet_; rtc::CopyOnWriteBuffer last_recv_rtcp_packet_; absl::AnyInvocable<void(bool)> action_on_ready_to_send_; + absl::AnyInvocable<void()> action_on_sent_packet_; }; } // namespace webrtc |