A controlling agent feeding media into a WebRTC SFU needs to know the SSRC
of the incoming stream before it can bind a receiver to it, and the SFU
needs that SSRC to stay put for the life of the call.
With `fixed egress SSRC` set, rtpengine picks an SSRC for each media at
signalling time and returns the chosen values in the offer or answer
response, one entry per m= section along with its index and media type.
The value is recorded as the ingress entry's `ssrc_map_out`, which is
already the mapping every consumer reads: the egress entry is keyed off it,
RTCP rewriting uses it, and the kernel module is handed it as `ssrc_out`.
Because one egress entry then stands in for every ingress SSRC, it outlives
a change of source, so `seq_diff` carries across on its own. All that is
left is re-basing it once at the changeover, taking the last sequence
number from the counter shared with the kernel module so that it is still
right while the stream is offloaded.
The substitution itself goes in the plain passthrough handler rather than
the SSRC passthrough one, so that it applies to builds without transcoding
support as well. Those builds compile the kernel side regardless, so
leaving the userspace half out would have meant the original SSRC being
forwarded until the stream was offloaded and the fixed one afterwards.
Change-Id: Iad5508c53d29d1e7d54c825da1ab56069cdd89b7
Define types of packetizers, with dedicated init and destroy functions,
and move maintenance of sample stream into encoder
Change-Id: I992f696c2b986485a89582909e299b2f6d462e5b
With the more modern codec handling, there shouldn't be any more need to
unconditionally remove unsupported codecs if some codecs are requested
for transcoding.
Change-Id: Ica931de24ad6042f82e06d2efa69b93b4a7d8dd0
Resolve file name conflicts between different components
Ensure shared log levels are identical across components
Encapsulates lib/*
Change-Id: If848d6fa0e4cd8eac88ce9e63ee77fc5a7a481fd
Add the 'all' keyword for the codec accept option in publish mode:
- 'all': keep all codecs supported for transcoding and their
supplemental codecs, removing only unsupported ones
- 'all' + 'any': keep all codecs from the offer without removing any
Closes#2105
Change-Id: Ic271a5e461703e3b9dba3c0717bfbb9da89a03ca
Add RED (RFC 2198) codec definition to codeclib as a supplemental codec.
Modify codec_store_accept_one() to preserve supplemental codecs whose
clock rate matches the accepted primary codec. Skip supplemental codecs
in codec_store_is_full_answer() since they are optional in SDP answers.
Closes#2100
Change-Id: Ie81f45091c5d3dc55e20896d5a6e7a8361fda2f4
In case of bitstream style codecs which still use an encoder which
operates on fixed frame sizes (e.g. G.726), passing the maximum allowed
frame/packet size to the packetizer is not enough. Instead it needs to
know separately how much data it is expected to return. Add another
argument to pass this information.
This also fixes the incorrect math to adjust the frame duration in case
of chunked output.
Change-Id: I1d57c684ecea055059481de0220f6b6001088605
Instead of taking an average, take the minimum over the last X frames.
This fixes skew calculation in situations where the encoder is expected
to produce burst output (e.g. G.726).
Probably the exception for media playback can also be removed.
Change-Id: I92e03916c04c670f6e8e72ad243a67d675504690
Skip initialisation of seq_out to a random number and track its init
state with a dedicated flag. Initialise it to the first received seq.
Change-Id: Iecdd3d28c5d6fe36d0a7488dd231767ff788942e
Don't blindly take over a source DTMF PT if one is present. Check if the
destination has _some_ DTMF PT, and only then take over the source. This
makes the behaviour more closely match the documentation.
One test is affected and seems to improve its outcome.
Closes#2091
Change-Id: Ibb9c1f79099fa30ac69ec71b4a4c71af0b88b327