Class FECTransformEngine

    • Field Detail

      • INITIAL_BUFFER_SIZE

        public static final int INITIAL_BUFFER_SIZE
        Initial size for newly allocated byte arrays.
        See Also:
        Constant Field Values
    • Constructor Detail

      • FECTransformEngine

        public FECTransformEngine​(FECTransformEngine.FecType fecType,
                                  byte incomingPT,
                                  byte outgoingPT,
                                  MediaStream mediaStream)
        Initializes a new FECTransformEngine instance.
        Parameters:
        incomingPT - the RTP payload type number for incoming ulpfec packet.
        outgoingPT - the RTP payload type number for outgoing ulpfec packet.
    • Method Detail

      • reverseTransform

        public RawPacket[] reverseTransform​(RawPacket[] pkts)
        Reverse-transforms each packet in an array of packets. Null values must be ignored. Assumes that all packets in pkts have the same SSRC. Reverse- transforms using the AbstractFECReceiver for the SSRC found in pkts.
        Specified by:
        reverseTransform in interface PacketTransformer
        Parameters:
        pkts - the transformed packets to be restored.
        Returns:
        the restored packets.
      • transform

        public RawPacket[] transform​(RawPacket[] pkts)
        Transforms each packet in an array of packets. Null values must be ignored. Adds ulpfec packets to the stream (one ulpfec packet after every fecRate media packets.
        Specified by:
        transform in interface PacketTransformer
        Parameters:
        pkts - the packets to be transformed
        Returns:
        the transformed packets
      • close

        public void close()
        Closes this PacketTransformer i.e. releases the resources allocated by it and prepares it for garbage collection.
        Specified by:
        close in interface PacketTransformer
      • setIncomingPT

        public void setIncomingPT​(byte incomingPT)
        Sets the payload type for incoming ulpfec packets.
        Parameters:
        incomingPT - the payload type to set
      • setOutgoingPT

        public void setOutgoingPT​(byte outgoingPT)
        Sets the payload type for outgoing ulpfec packets.
        Parameters:
        outgoingPT - the payload type to set
      • setFecRate

        public void setFecRate​(int fecRate)
        Sets the rate at which ulpfec packets will be generated and added to the stream by this PacketTransformer.
        Parameters:
        fecRate - the rate to set, should be in [0, 16]
      • getFecRate

        public int getFecRate()
        Get the rate at which ulpfec packets will be generated and added to the stream by this PacketTransformer.
        Returns:
        the rate at which ulpfec packets will be generated and added to the stream by this PacketTransformer.