Class RtxTransformer

  • All Implemented Interfaces:
    TransformEngine

    public class RtxTransformer
    extends Object
    implements TransformEngine
    Intercepts RTX (RFC-4588) packets coming from an MediaStream, and removes their RTX encapsulation. Intercepts NACKs and retransmits packets to a mediaStream (using the RTX format if the destination supports it).
    Author:
    Boris Grozev, George Politis
    • Field Detail

      • DISABLE_NACK_TERMINATION_PNAME

        public static final String DISABLE_NACK_TERMINATION_PNAME
        The name of the property used to disable NACK termination.
        See Also:
        Constant Field Values
    • Constructor Detail

      • RtxTransformer

        public RtxTransformer​(MediaStreamImpl mediaStream)
        Initializes a new RtxTransformer with a specific MediaStreamImpl.
        Parameters:
        mediaStream - the MediaStreamImpl for the transformer.
    • Method Detail

      • destinationSupportsRtx

        public boolean destinationSupportsRtx()
        Returns a boolean that indicates whether or not the destination endpoint supports RTX.
        Returns:
        true if the destination endpoint supports RTX, otherwise false.
      • onDynamicPayloadTypesChanged

        public void onDynamicPayloadTypesChanged()
        Notifies this instance that the dynamic payload types of the associated MediaStream have changed.
      • sendPadding

        public int sendPadding​(long ssrc,
                               int bytes)
        Sends padding packets with the RTX SSRC associated to the media SSRC that is passed as a parameter. It implements packet triplication.
        Parameters:
        ssrc - the media SSRC to protect.
        bytes - the amount of padding to send in bytes.
        Returns:
        the remaining padding bytes budget.