Convert to NTP time using the real clock.
Bug: webrtc:11327 Change-Id: I523b111c72569580b8b27d47ad648e7887bea872 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219793 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Paul Hallak <phallak@google.com> Cr-Commit-Position: refs/heads/master@{#34082}
This commit is contained in:

committed by
WebRTC LUCI CQ

parent
a6b0d53dc2
commit
46fbefa302
@ -397,6 +397,7 @@ if (!build_with_chromium) {
|
|||||||
"../rtc_base:rtc_base_approved",
|
"../rtc_base:rtc_base_approved",
|
||||||
"../rtc_base:rtc_numerics",
|
"../rtc_base:rtc_numerics",
|
||||||
"../rtc_base:stringutils",
|
"../rtc_base:stringutils",
|
||||||
|
"../system_wrappers",
|
||||||
"../test:explicit_key_value_config",
|
"../test:explicit_key_value_config",
|
||||||
]
|
]
|
||||||
absl_deps = [
|
absl_deps = [
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "logging/rtc_event_log/rtc_event_processor.h"
|
#include "logging/rtc_event_log/rtc_event_processor.h"
|
||||||
#include "modules/rtp_rtcp/source/time_util.h"
|
#include "modules/rtp_rtcp/source/time_util.h"
|
||||||
|
#include "system_wrappers/include/clock.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
@ -142,11 +143,13 @@ void LogBasedNetworkControllerSimulation::OnReceiverReport(
|
|||||||
HandleStateUpdate(controller_->OnTransportLossReport(msg));
|
HandleStateUpdate(controller_->OnTransportLossReport(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Clock* clock = Clock::GetRealTimeClock();
|
||||||
TimeDelta rtt = TimeDelta::PlusInfinity();
|
TimeDelta rtt = TimeDelta::PlusInfinity();
|
||||||
for (auto& rb : report.rr.report_blocks()) {
|
for (auto& rb : report.rr.report_blocks()) {
|
||||||
if (rb.last_sr()) {
|
if (rb.last_sr()) {
|
||||||
|
Timestamp report_log_time = Timestamp::Micros(report.log_time_us());
|
||||||
uint32_t receive_time_ntp =
|
uint32_t receive_time_ntp =
|
||||||
CompactNtp(TimeMicrosToNtp(report.log_time_us()));
|
CompactNtp(clock->ConvertTimestampToNtpTime(report_log_time));
|
||||||
uint32_t rtt_ntp =
|
uint32_t rtt_ntp =
|
||||||
receive_time_ntp - rb.delay_since_last_sr() - rb.last_sr();
|
receive_time_ntp - rb.delay_since_last_sr() - rb.last_sr();
|
||||||
rtt = std::min(rtt, TimeDelta::Millis(CompactNtpRttToMs(rtt_ntp)));
|
rtt = std::min(rtt, TimeDelta::Millis(CompactNtpRttToMs(rtt_ntp)));
|
||||||
|
Reference in New Issue
Block a user