From 57dc02a5c268548fde45f68a367d4d9920f82a17 Mon Sep 17 00:00:00 2001 From: Bjorn A Mellem Date: Thu, 30 May 2019 09:15:37 -0700 Subject: [PATCH] Add receive_timestamp to DatagramAcks. Whenever a datagram is acked, the datagram transport will provide the remote peer's receive timestamp in this field. Bug: webrtc:9719 Change-Id: I516b9d602e62179a3deda001e0ee9b484aa20d37 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139440 Reviewed-by: Anton Sukhanov Reviewed-by: Steve Anton Commit-Queue: Bjorn Mellem Cr-Commit-Position: refs/heads/master@{#28114} --- api/BUILD.gn | 1 + api/datagram_transport_interface.h | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/api/BUILD.gn b/api/BUILD.gn index 375cf9d257..4bf0a3b3d3 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -158,6 +158,7 @@ rtc_static_library("libjingle_peerconnection_api") { "transport/media:audio_interfaces", "transport/media:video_interfaces", "units:data_rate", + "units:timestamp", "video:encoded_image", "video:video_frame", "//third_party/abseil-cpp/absl/algorithm:container", diff --git a/api/datagram_transport_interface.h b/api/datagram_transport_interface.h index 84acdfc10f..b1e851c5ca 100644 --- a/api/datagram_transport_interface.h +++ b/api/datagram_transport_interface.h @@ -22,6 +22,7 @@ #include "api/media_transport_interface.h" #include "api/rtc_error.h" #include "api/units/data_rate.h" +#include "api/units/timestamp.h" namespace rtc { class PacketTransportInternal; @@ -31,11 +32,14 @@ namespace webrtc { typedef int64_t DatagramId; -// TODO(mellem): Add receive timestamp. struct DatagramAck { // |datagram_id| is same as passed in // DatagramTransportInterface::SendDatagram. DatagramId datagram_id; + + // The timestamp at which the remote peer received the identified datagram, + // according to that peer's clock. + Timestamp receive_timestamp; }; // All sink methods are called on network thread.