Adds packet_size to rtc::SentPacket in testing code.

Bug: webrtc:9796
Change-Id: Id67bb02858164dba696474b1b60ebfa1597a2577
Reviewed-on: https://webrtc-review.googlesource.com/102685
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24901}
This commit is contained in:
Sebastian Jansson
2018-09-28 17:21:34 +02:00
committed by Commit Bot
parent 9eeff94860
commit 156d11ddd9
3 changed files with 17 additions and 7 deletions

View File

@ -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;
}

View File

@ -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);

View File

@ -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());