Avoid using legacy rtp parser in neteq test::Packet

Bug: None
Change-Id: I9184954d9c99f0a34ae335d03843171864071e5d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222648
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34316}
This commit is contained in:
Danil Chapovalov
2021-06-16 14:23:22 +02:00
committed by WebRTC LUCI CQ
parent 35b21ba8d4
commit b4100ad06a
7 changed files with 117 additions and 121 deletions

View File

@ -62,12 +62,9 @@ std::unique_ptr<Packet> RtpFileSource::NextPacket() {
// Read the next one.
continue;
}
std::unique_ptr<uint8_t[]> packet_memory(new uint8_t[temp_packet.length]);
memcpy(packet_memory.get(), temp_packet.data, temp_packet.length);
RtpUtility::RtpHeaderParser parser(packet_memory.get(), temp_packet.length);
auto packet = std::make_unique<Packet>(
packet_memory.release(), temp_packet.length,
temp_packet.original_length, temp_packet.time_ms, parser,
rtc::CopyOnWriteBuffer(temp_packet.data, temp_packet.length),
temp_packet.original_length, temp_packet.time_ms,
&rtp_header_extension_map_);
if (!packet->valid_header()) {
continue;