-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add batch interfaces for reading RtpSents and RtpAcks #42
base: main
Are you sure you want to change the base?
Conversation
Looks good, I would even prefer if we only had the batched getters instead of the Another thing I think would be nice to have is a signal that only gets triggered when some receive buffer goes from empty to not empty. Also, what should happen if the application doesn't call the getters fast enough? Do we just silently drop packets? |
I don't feel super strongly, but came to the thought that one either has ~low frequency packets so just event-per-packet is best and easiest, or one has ~high frequency packets (paced to something smooth-ish) so calling
Very good Q... I think we really should do this (and this is an advantage over raw Events which could just clog up the Event Loop ~forever potentially preventing the JS from recovering, as discussed). But do we need to expose that fact to the app, so it knows to speed up if it's not keeping up? |
@tonyherre In WebTransport, we have |
Problem: without the clear signal of attaching event handlers, how does the browser know the app will eventually call readSentNotifications() etc so that it should store RtpSent and RtpAcks objects?
We might need a field in |
This is another reason why I think having only batched getters is better. It makes the API clearer. |
I tend to agree we should have only one API here. Normally, setting event listeners should have no real side effects. |
We can deal with the "is the max number optional?" either in this PR or in a separate one |
|
48df72f
to
405f964
Compare
Done, I think. Adopted the naming scheme from #51. Also removed the comment and examples which had data in the events themselves.
I wasn't sure which way to go with this - what's the default if the app doesn't provide a max, it just gets the entire queue of many (thousands?) of packets in one chunk? Forcing the JS to specify some number feels like it might be good for avoiding surprises and doesn't add too much complexity, or? PTAL all! |
See w3c/webrtc-rtptransport#42 and https://github.com/w3c/webrtc-rtptransport/blob/main/explainer-use-case-2.md. Would be used to allow BWE JS implementations to listen to the actual sent times of RTP packets, for comparison with readReceivedRtpAcks(). All guarded by the blink feature RTCRtpTransport. Bug: 345101934 Change-Id: Icd63a13a7953a0b77fc589f88e739aa869847fc8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5646499 Reviewed-by: Guido Urdaneta <guidou@chromium.org> Commit-Queue: Tony Herre <toprice@chromium.org> Cr-Commit-Position: refs/heads/main@{#1320843}
405f964
to
837800a
Compare
Ping @pthatcher - Are you happy with how this has taken the updated example from #51? |
Add batch methods as discussed in #20.
Currently leaving the Events unchanged, as an alternative.