Add stats for frequency offset when converting RTP timestamp to NTP time.
- Add histogram: "WebRTC.Video.RtpToNtpFreqOffsetInKhz"
The absolute value of the difference between the estimated frequency during RTP timestamp to NTP time conversion and the actual value (i.e. 90 kHz) is measured per received video frame. The max offset during 40 second intervals is stored. The average of these stored offsets per received video stream is recorded when a stream is removed.
Updated rtp_to_ntp.cc:
- Add validation for only inserting newer RTCP sender reports to the rtcp list.
- Move calculation of frequency/offset (from RTP/NTP timestamp pairs) to UpdateRtcpList. Calculated when a new RTCP SR in inserted (and not in RtpToNtpMs per packet).
BUG=webrtc:6579
Review-Url: https://codereview.webrtc.org/2385763002
Cr-Commit-Position: refs/heads/master@{#14891}
diff --git a/webrtc/video/rtp_streams_synchronizer.h b/webrtc/video/rtp_streams_synchronizer.h
index 082bec7..bc24d6f 100644
--- a/webrtc/video/rtp_streams_synchronizer.h
+++ b/webrtc/video/rtp_streams_synchronizer.h
@@ -46,8 +46,11 @@
// Gets the sync offset between the current played out audio frame and the
// video |frame|. Returns true on success, false otherwise.
+ // The estimated frequency is the frequency used in the RTP to NTP timestamp
+ // conversion.
bool GetStreamSyncOffsetInMs(const VideoFrame& frame,
- int64_t* stream_offset_ms) const;
+ int64_t* stream_offset_ms,
+ double* estimated_freq_khz) const;
private:
Clock* const clock_;