Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

senderReceiverTimeOffset should use remoteOutboundRtpStats.roundTripTime #109

Open
yuanchao0310 opened this issue May 19, 2022 · 1 comment

Comments

@yuanchao0310
Copy link

yuanchao0310 commented May 19, 2022

in https://github.com/w3c/webrtc-extensions/blob/main/explainer.md#api-2-sendercapturetimeoffset

senderReceiverTimeOffset = remoteOutboundRtpStats.timestamp - (remoteOutboundRtpStats.remoteTimestamp + remoteInboundRtpStats.roundTripTime / 2);

if receiver is a recv only endpoint, it cannot get remoteInboundRtpStats.roundTripTime, because remoteInboundRtpStats.roundTripTime use SR and RR to get rtt time, that means the receiver must send RTP to remote peer.

so need use remoteOutboundRtpStats.roundTripTime, which can be calculated by XR RTCP at receiver side.
after update:

stats = peerconnection.getStats();
remoteOutboundRtpStats = getRequiredStats(stats, "remote-outbound-rtp");
senderReceiverTimeOffset = remoteOutboundRtpStats.timestamp - (remoteOutboundRtpStats.remoteTimestamp + remoteOutboundRtpStats.roundTripTime / 2)

@henbos
Copy link
Collaborator

henbos commented May 20, 2022

Makes sense to me, and in terms of implementation, this was implemented in chromium/libwebrtc in M95. However it looks like it was only implemented for the audio case, not the video case. Anyway that's an implementation issue, not a spec issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants