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

Lifetime of outbound-rtp should start BEFORE first packet is sent #781

Open
henbos opened this issue Jan 29, 2024 · 3 comments
Open

Lifetime of outbound-rtp should start BEFORE first packet is sent #781

henbos opened this issue Jan 29, 2024 · 3 comments

Comments

@henbos
Copy link
Collaborator

henbos commented Jan 29, 2024

This issue is not arguing to change when inbound-rtp is created, because in that case the SSRC is in theory not known until the first packet is received, and we don't know useful things like which codec is used etc until we've gotten something to decode.

But this story is very different for outbound-rtp. As soon as you've negotiated, the RTCRtpSender knows:

  • Which ssrcs and rids to use.
  • How many simulcast layers to use and which ones are active or not.
  • Which codec (codecId) is configured and its scalabilityMode.

The argument for exposing outbound-rtp early is that a) the information is know, and b) it's super confusing in simulcast if we delay creating an RTP stream until the first packet is sent on that SSRC. If you call getStats() after negotiating but before BW has had a chance to ramp up, you might only see one (or two) outbound-rtps.

Most browsers already expose outbound-rtp early so its better to update the spec to make more sense than to update the implementations to make less sense.

@henbos
Copy link
Collaborator Author

henbos commented Jan 29, 2024

@jan-ivar Are you open to the idea to only delaying inbound-rtp creation, not outbound-rtp creation? I'd hate for a 3 layer simulcast stream to show up as singlecast in getStats until BW has ramped up

@fippo
Copy link
Contributor

fippo commented Jan 29, 2024

Didn't we agree on that already in #667?

@henbos
Copy link
Collaborator Author

henbos commented Jan 29, 2024

We did?? Spec currently says:

The lifetime of all RTP monitored objects starts when the RTP stream is first used: When the first RTP packet is sent or received on the SSRC it represents, or when the first RTCP packet is sent or received that refers to the SSRC of the RTP stream.

I would argue that "RTP stream is first used" should not be clarified as first packet sent but that the sender was configured, but I am OK with the inbound side being "first used" as first packet received...

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

No branches or pull requests

2 participants