Re: [webrtc-stats] When are RTP streams destroyed? (#668)

I don't want to depend on `RTCP BYE` for deletion because I don't think memory leaks should happen if the remote endpoint disappears without sending you a special packet. A participant abruptly disconnecting is not an excuse to cache SSRCs indefinitely. Also I think it is perfectly sensible to inactivate an `RTCRtpTransceiver` using `direction` rather than `stop()`, and this should count as the RTP stream not existing from a stats perspective.

I'm leaning towards RTP stats deletion happening...
- When negotiation makes the sender or receiver inactive, reconfiguring these objects to ignore these ssrcs.
- If a codec change happens such that the "active ssrc" is swapped out.

In both cases, it's perfectly legal for an inactive ssrc to become active again later in the session. In this case I think we should create a new RTP stats object with a unique stats ID. E.g. the first time you used ssrc=x and the second time you used ssrc=x are different stats objects, because whenever you stop using an ssrc that is when we delete all counters and information about that ssrc's history.

-- 
GitHub Notification of comment by henbos
Please view or discuss this issue at https://github.com/w3c/webrtc-stats/issues/668#issuecomment-1239041773 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 7 September 2022 07:56:38 UTC