Skip to content

Media pipeline rework

The aim of this MR is manyfold:

Currently there are a couple of issues with the way we setup and use the media pipelines: We roll a dice to get a random port for RTP and set it as the port we want to listen on (hoping that it's not actually in use). The port for RTCP is hardcoded to RTP+1 (this is done for legacy reasons and cannot be guaranteed anyway in the face of NATs). RTCP did not use same hole punching scheme as we employ for RTP. We cannot request a new pipeline to switch to a different codec or change connection IPs. Receive or send only pipelines not supported (could be useful for early media).

Instead we want to prepare pipelines in advance and query their allocated ports for RTP/RTCP and use them in our SDP. This requires that we setup a skeleton receiver pipeline and set it to playing briefly so that sockets get allocated by the OS. We need to be able to delay setting codec information until later (currently set during object construction and relied on for pipeline init).

Plan of action is roughly (subject to change):

  • Split initialization per pipeline, carve out codec specific bits into separate function (just mechanical change)
  • Change initialization to not depend on codecs being set and add API to set it later
  • Start skeleton receive pipeline to get sockets allocated, get rid of setter functions for local ports and adjust to changes in the rest of the SIP codebase
  • CallsSipMediaManager should manage CallsSipMediaPipelines and hand them out when a CallsSipCall requests a pipeline.
Edited by Evangelos Ribeiro Tzaras

Merge request reports