summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/pc/test/rtp_transport_test_util.h
diff options
context:
space:
mode:
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.h17
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