Add RTCP support to RTP forwarders #1331
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.
This patch complements the RTCP support added to the Streaming plugin in #1279, and can actually be used whenever there's need for RTCP feedback for RTP forwarders (even though their usage with the Streaming plugin is the main use case that motivated us here).
It's quite easy to use. Whenever you create an RTP forward, you can specify
audio_rtcp_port
andvideo_rtcp_port
as well, e.g.:This configures the remote RTCP ports, just as you configure the remote RTP ports with
audio_port
andvideo_port
. This results in the plugin creating a new socket, binding to a random port, and latching to the remote specified port(s) in order to be able to receive RTCP feedback. This means that, after the forwarder did its latching, it's up to the recipient to figure out the port the forwarder will wait RTCP feedback on, exactly as the Streaming plugin currently does.At the moment, we ignore everything that isn't a PLI/FIR, which means configuring an audio RTCP port is pretty useless. In future commits we can extend this for other RTCP packets: anyway, this already allows me to configure an RTCP port for a Streaming mountpoint, configure a new RTP forwarder to send RTP there and latch to the RTCP port, and make sure that any time a new Streaming plugin viewer opens the mountpoint their keyframe requests are properly relayed to the original source (the VideoRoom publisher).
Tested briefly and it seems to work, so I plan to merge soon. Feedback welcome!