Configuration of outgoing RTX streams #607
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Makes
RTCRtpSender
capable of configuring RTX streams.Incoming RTX streams are already handled at the SDP/SDES layer and then processed by
RTCRtpReceiver::receive_for_rtx
. This means interceptors can bind to remote RTX streams. This PR aims to do the same for local streams. This is related to, but not a full fix for #295 since it doesn't implement the retransmission, but it allows the separate RTX SSRCs to be configured, negotiated, and then bound to interceptors that can do the rest.First, a field is added to
StreamInfo
to pass information about associated streams from the SDP to the interceptor chain. This is populated for both senders and receivers. Typically the interceptor can check if the MIME type is*/rtx
and know that the associated stream is the original stream, but this concept can also used for other RTP extensions.The main commit adds support for establishing RTX streams in
RTCRtpSender
. Since it's easy to unknowingly have*/rtx
codecs configured, this feature is gated behind a newenable_sender_rtx
setting (this can be removed if it's thought safe to always enable). Whenever an encoding is added, the sender checks if the media engine contains a suitable RTX codec. If so, a SSRC is allocated, a flow identificationssrc-group
is added to the SDP, and interceptors are bound for the RTX streams onstart()
.The last commit fixes an issue where
repair_ssrc
is only populated if thea=ssrc-group:FID
line appears before thea=ssid:
lines.Let me know what you think about the approach!