Set the local capture clock offset on RtpPacketInfo when depacketizing frames.
Bug: b/150859541
Change-Id: I09f871bef8523cdef31ebd88d1cf25307463f380
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235360
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Paul Hallak <phallak@google.com>
Cr-Commit-Position: refs/heads/main@{#35219}
diff --git a/video/rtp_video_stream_receiver.cc b/video/rtp_video_stream_receiver.cc
index d7be8b3..8f89a6c 100644
--- a/video/rtp_video_stream_receiver.cc
+++ b/video/rtp_video_stream_receiver.cc
@@ -652,13 +652,20 @@
.first->second;
// Try to extrapolate absolute capture time if it is missing.
- packet_info.set_absolute_capture_time(
+ absl::optional<AbsoluteCaptureTime> absolute_capture_time =
absolute_capture_time_interpolator_.OnReceivePacket(
AbsoluteCaptureTimeInterpolator::GetSource(packet_info.ssrc(),
packet_info.csrcs()),
packet_info.rtp_timestamp(),
// Assume frequency is the same one for all video frames.
- kVideoPayloadTypeFrequency, packet_info.absolute_capture_time()));
+ kVideoPayloadTypeFrequency, packet_info.absolute_capture_time());
+ packet_info.set_absolute_capture_time(absolute_capture_time);
+
+ if (absolute_capture_time.has_value()) {
+ packet_info.set_local_capture_clock_offset(
+ capture_clock_offset_updater_.AdjustEstimatedCaptureClockOffset(
+ absolute_capture_time->estimated_capture_clock_offset));
+ }
insert_result = packet_buffer_.InsertPacket(std::move(packet));
}