From 7c7885c01671e9ff54c682beef1e69991ec0833f Mon Sep 17 00:00:00 2001 From: philipel Date: Fri, 12 Mar 2021 14:33:46 +0100 Subject: [PATCH] Remove NTP timestamp from PacketBuffer::Packet. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:12579 Change-Id: I64ca0ddb6f5c20bef5e9503955e0e4b4c484a1e7 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211662 Commit-Queue: Philip Eliasson Reviewed-by: Erik Språng Reviewed-by: Sam Zackrisson Reviewed-by: Danil Chapovalov Cr-Commit-Position: refs/heads/master@{#33448} --- modules/video_coding/packet_buffer.cc | 2 -- modules/video_coding/packet_buffer.h | 3 --- test/fuzzers/packet_buffer_fuzzer.cc | 1 - video/rtp_video_stream_receiver.cc | 35 +++++++++++++-------------- video/rtp_video_stream_receiver2.cc | 35 +++++++++++++-------------- 5 files changed, 34 insertions(+), 42 deletions(-) diff --git a/modules/video_coding/packet_buffer.cc b/modules/video_coding/packet_buffer.cc index d2a2bcfb47..cc4b8c1466 100644 --- a/modules/video_coding/packet_buffer.cc +++ b/modules/video_coding/packet_buffer.cc @@ -37,13 +37,11 @@ namespace video_coding { PacketBuffer::Packet::Packet(const RtpPacketReceived& rtp_packet, const RTPVideoHeader& video_header, - int64_t ntp_time_ms, int64_t receive_time_ms) : marker_bit(rtp_packet.Marker()), payload_type(rtp_packet.PayloadType()), seq_num(rtp_packet.SequenceNumber()), timestamp(rtp_packet.Timestamp()), - ntp_time_ms(ntp_time_ms), times_nacked(-1), video_header(video_header), packet_info(rtp_packet.Ssrc(), diff --git a/modules/video_coding/packet_buffer.h b/modules/video_coding/packet_buffer.h index e34f7040b5..35dcf82edc 100644 --- a/modules/video_coding/packet_buffer.h +++ b/modules/video_coding/packet_buffer.h @@ -36,7 +36,6 @@ class PacketBuffer { Packet() = default; Packet(const RtpPacketReceived& rtp_packet, const RTPVideoHeader& video_header, - int64_t ntp_time_ms, int64_t receive_time_ms); Packet(const Packet&) = delete; Packet(Packet&&) = delete; @@ -62,8 +61,6 @@ class PacketBuffer { uint8_t payload_type = 0; uint16_t seq_num = 0; uint32_t timestamp = 0; - // NTP time of the capture time in local timebase in milliseconds. - int64_t ntp_time_ms = -1; int times_nacked = -1; rtc::CopyOnWriteBuffer video_payload; diff --git a/test/fuzzers/packet_buffer_fuzzer.cc b/test/fuzzers/packet_buffer_fuzzer.cc index 30f452c9b7..f1872e3bfd 100644 --- a/test/fuzzers/packet_buffer_fuzzer.cc +++ b/test/fuzzers/packet_buffer_fuzzer.cc @@ -35,7 +35,6 @@ void FuzzOneInput(const uint8_t* data, size_t size) { helper.CopyTo(&packet->payload_type); helper.CopyTo(&packet->seq_num); helper.CopyTo(&packet->timestamp); - helper.CopyTo(&packet->ntp_time_ms); helper.CopyTo(&packet->times_nacked); // Fuzz non-POD member of the packet. diff --git a/video/rtp_video_stream_receiver.cc b/video/rtp_video_stream_receiver.cc index 0d12b7f02c..d6a7b41577 100644 --- a/video/rtp_video_stream_receiver.cc +++ b/video/rtp_video_stream_receiver.cc @@ -505,8 +505,7 @@ void RtpVideoStreamReceiver::OnReceivedPayloadData( const RTPVideoHeader& video) { RTC_DCHECK_RUN_ON(&worker_task_checker_); auto packet = std::make_unique( - rtp_packet, video, ntp_estimator_.Estimate(rtp_packet.Timestamp()), - clock_->TimeInMilliseconds()); + rtp_packet, video, clock_->TimeInMilliseconds()); // Try to extrapolate absolute capture time if it is missing. packet->packet_info.set_absolute_capture_time( @@ -795,22 +794,22 @@ void RtpVideoStreamReceiver::OnInsertedPacket( const video_coding::PacketBuffer::Packet& last_packet = *packet; OnAssembledFrame(std::make_unique( - first_packet->seq_num, // - last_packet.seq_num, // - last_packet.marker_bit, // - max_nack_count, // - min_recv_time, // - max_recv_time, // - first_packet->timestamp, // - first_packet->ntp_time_ms, // - last_packet.video_header.video_timing, // - first_packet->payload_type, // - first_packet->codec(), // - last_packet.video_header.rotation, // - last_packet.video_header.content_type, // - first_packet->video_header, // - last_packet.video_header.color_space, // - RtpPacketInfos(std::move(packet_infos)), // + first_packet->seq_num, // + last_packet.seq_num, // + last_packet.marker_bit, // + max_nack_count, // + min_recv_time, // + max_recv_time, // + first_packet->timestamp, // + ntp_estimator_.Estimate(first_packet->timestamp), // + last_packet.video_header.video_timing, // + first_packet->payload_type, // + first_packet->codec(), // + last_packet.video_header.rotation, // + last_packet.video_header.content_type, // + first_packet->video_header, // + last_packet.video_header.color_space, // + RtpPacketInfos(std::move(packet_infos)), // std::move(bitstream))); } } diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc index 3601d1da84..1e175a3b86 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc @@ -472,8 +472,7 @@ void RtpVideoStreamReceiver2::OnReceivedPayloadData( const RTPVideoHeader& video) { RTC_DCHECK_RUN_ON(&worker_task_checker_); auto packet = std::make_unique( - rtp_packet, video, ntp_estimator_.Estimate(rtp_packet.Timestamp()), - clock_->TimeInMilliseconds()); + rtp_packet, video, clock_->TimeInMilliseconds()); // Try to extrapolate absolute capture time if it is missing. packet->packet_info.set_absolute_capture_time( @@ -765,22 +764,22 @@ void RtpVideoStreamReceiver2::OnInsertedPacket( const video_coding::PacketBuffer::Packet& last_packet = *packet; OnAssembledFrame(std::make_unique( - first_packet->seq_num, // - last_packet.seq_num, // - last_packet.marker_bit, // - max_nack_count, // - min_recv_time, // - max_recv_time, // - first_packet->timestamp, // - first_packet->ntp_time_ms, // - last_packet.video_header.video_timing, // - first_packet->payload_type, // - first_packet->codec(), // - last_packet.video_header.rotation, // - last_packet.video_header.content_type, // - first_packet->video_header, // - last_packet.video_header.color_space, // - RtpPacketInfos(std::move(packet_infos)), // + first_packet->seq_num, // + last_packet.seq_num, // + last_packet.marker_bit, // + max_nack_count, // + min_recv_time, // + max_recv_time, // + first_packet->timestamp, // + ntp_estimator_.Estimate(first_packet->timestamp), // + last_packet.video_header.video_timing, // + first_packet->payload_type, // + first_packet->codec(), // + last_packet.video_header.rotation, // + last_packet.video_header.content_type, // + first_packet->video_header, // + last_packet.video_header.color_space, // + RtpPacketInfos(std::move(packet_infos)), // std::move(bitstream))); } }