Correcting payload size to NetEq simulator in RTC event log analyzer.

Bug: webrtc:9171, b/77841364
Change-Id: Ia56b61df1cb824d9d1bf9ec7d93770082803b642
Reviewed-on: https://webrtc-review.googlesource.com/71140
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22948}
This commit is contained in:
Minyue Li
2018-04-19 13:52:36 +02:00
committed by Commit Bot
parent 36b096c38e
commit 4397e4ae9c
2 changed files with 13 additions and 5 deletions

View File

@ -514,8 +514,8 @@ EventLogAnalyzer::EventLogAnalyzer(const ParsedRtcEventLog& log)
}
uint64_t timestamp = parsed_log_.GetTimestamp(i);
StreamId stream(parsed_header.ssrc, direction);
rtp_packets_[stream].push_back(
LoggedRtpPacket(timestamp, parsed_header, total_length));
rtp_packets_[stream].push_back(LoggedRtpPacket(
timestamp, parsed_header, header_length, total_length));
break;
}
case ParsedRtcEventLog::RTCP_EVENT: {
@ -1911,7 +1911,8 @@ class NetEqStreamInput : public test::NetEqInput {
// This is a header-only "dummy" packet. Set the payload to all zeros, with
// length according to the virtual length.
packet_data->payload.SetSize(packet_stream_it_->total_length);
packet_data->payload.SetSize(packet_stream_it_->total_length -
packet_stream_it_->header_length);
std::fill_n(packet_data->payload.data(), packet_data->payload.size(), 0);
++packet_stream_it_;

View File

@ -30,11 +30,18 @@ namespace webrtc {
namespace plotting {
struct LoggedRtpPacket {
LoggedRtpPacket(uint64_t timestamp, RTPHeader header, size_t total_length)
: timestamp(timestamp), header(header), total_length(total_length) {}
LoggedRtpPacket(uint64_t timestamp,
RTPHeader header,
size_t header_length,
size_t total_length)
: timestamp(timestamp),
header(header),
header_length(header_length),
total_length(total_length) {}
uint64_t timestamp;
// TODO(terelius): This allocates space for 15 CSRCs even if none are used.
RTPHeader header;
size_t header_length;
size_t total_length;
};