Surface `local_capture_clock_offset` from `RtpSource`
- Propagating `RtpPacketInfo::local_capture_clock_offset`, an
existing field that is related to the abs-capture-timestamp
header extension field `estimated_capture_clock_offset`
- Propagated through `SourceTracker::SourceEntry`
Bug: webrtc:10739, b/246753278
Change-Id: I21d9841e4f3a35da5f8d7b31582898309421d524
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275241
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38129}
diff --git a/api/rtp_packet_info.h b/api/rtp_packet_info.h
index f9980a1c..bc8784c 100644
--- a/api/rtp_packet_info.h
+++ b/api/rtp_packet_info.h
@@ -17,6 +17,7 @@
#include "absl/types/optional.h"
#include "api/rtp_headers.h"
+#include "api/units/time_delta.h"
#include "api/units/timestamp.h"
#include "rtc_base/system/rtc_export.h"
@@ -92,11 +93,11 @@
return *this;
}
- const absl::optional<int64_t>& local_capture_clock_offset() const {
+ const absl::optional<TimeDelta>& local_capture_clock_offset() const {
return local_capture_clock_offset_;
}
RtpPacketInfo& set_local_capture_clock_offset(
- const absl::optional<int64_t>& value) {
+ absl::optional<TimeDelta> value) {
local_capture_clock_offset_ = value;
return *this;
}
@@ -117,16 +118,14 @@
// Fields from the Absolute Capture Time header extension:
// http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time
- // To not be confused with `local_capture_clock_offset_`, the
- // `estimated_capture_clock_offset` in `absolute_capture_time_` should
- // represent the clock offset between a remote sender and the capturer, and
- // thus equals to the corresponding values in the received RTP packets,
- // subjected to possible interpolations.
absl::optional<AbsoluteCaptureTime> absolute_capture_time_;
- // Clock offset against capturer's clock. Should be derived from the estimated
- // capture clock offset defined in the Absolute Capture Time header extension.
- absl::optional<int64_t> local_capture_clock_offset_;
+ // Clock offset between the local clock and the capturer's clock.
+ // Do not confuse with `AbsoluteCaptureTime::estimated_capture_clock_offset`
+ // which instead represents the clock offset between a remote sender and the
+ // capturer. The following holds:
+ // Capture's NTP Clock = Local NTP Clock + Local-Capture Clock Offset
+ absl::optional<TimeDelta> local_capture_clock_offset_;
};
bool operator==(const RtpPacketInfo& lhs, const RtpPacketInfo& rhs);