From 156d11ddd93902a7bbbfe8f5ce04d9bc17b8da57 Mon Sep 17 00:00:00 2001 From: Sebastian Jansson Date: Fri, 28 Sep 2018 17:21:34 +0200 Subject: [PATCH] Adds packet_size to rtc::SentPacket in testing code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:9796 Change-Id: Id67bb02858164dba696474b1b60ebfa1597a2577 Reviewed-on: https://webrtc-review.googlesource.com/102685 Commit-Queue: Sebastian Jansson Reviewed-by: Erik Språng Cr-Commit-Position: refs/heads/master@{#24901} --- call/degraded_call.cc | 10 ++++++---- test/direct_transport.cc | 2 ++ test/scenario/network_node.cc | 12 +++++++++--- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/call/degraded_call.cc b/call/degraded_call.cc index fd289ebb9a..df9869729a 100644 --- a/call/degraded_call.cc +++ b/call/degraded_call.cc @@ -181,10 +181,12 @@ bool DegradedCall::SendRtp(const uint8_t* packet, // been sent, so that the bandwidth estimator sees the delay we add. send_pipe_->SendRtp(packet, length, options); if (options.packet_id != -1) { - rtc::SentPacket packet_info; - packet_info.packet_id = options.packet_id; - packet_info.send_time_ms = clock_->TimeInMilliseconds(); - call_->OnSentPacket(packet_info); + rtc::SentPacket sent_packet; + sent_packet.packet_id = options.packet_id; + sent_packet.send_time_ms = clock_->TimeInMilliseconds(); + sent_packet.info.packet_size_bytes = length; + sent_packet.info.packet_type = rtc::PacketType::kData; + call_->OnSentPacket(sent_packet); } return true; } diff --git a/test/direct_transport.cc b/test/direct_transport.cc index 0ae0730d82..6aa8c9158f 100644 --- a/test/direct_transport.cc +++ b/test/direct_transport.cc @@ -72,6 +72,8 @@ bool DirectTransport::SendRtp(const uint8_t* data, if (send_call_) { rtc::SentPacket sent_packet(options.packet_id, clock_->TimeInMilliseconds()); + sent_packet.info.packet_size_bytes = length; + sent_packet.info.packet_type = rtc::PacketType::kData; send_call_->OnSentPacket(sent_packet); } SendPacket(data, length); diff --git a/test/scenario/network_node.cc b/test/scenario/network_node.cc index eb215aa63c..6fec9eb659 100644 --- a/test/scenario/network_node.cc +++ b/test/scenario/network_node.cc @@ -182,9 +182,15 @@ NetworkNodeTransport::~NetworkNodeTransport() = default; bool NetworkNodeTransport::SendRtp(const uint8_t* packet, size_t length, const PacketOptions& options) { - sender_->call_->OnSentPacket(rtc::SentPacket( - options.packet_id, sender_->clock_->TimeInMilliseconds())); - Timestamp send_time = Timestamp::ms(sender_->clock_->TimeInMilliseconds()); + int64_t send_time_ms = sender_->clock_->TimeInMilliseconds(); + rtc::SentPacket sent_packet; + sent_packet.packet_id = options.packet_id; + sent_packet.send_time_ms = send_time_ms; + sent_packet.info.packet_size_bytes = length; + sent_packet.info.packet_type = rtc::PacketType::kData; + sender_->call_->OnSentPacket(sent_packet); + + Timestamp send_time = Timestamp::ms(send_time_ms); rtc::CopyOnWriteBuffer buffer(packet, length, length + packet_overhead_.bytes()); buffer.SetSize(length + packet_overhead_.bytes());