Class FECTransformEngine
- java.lang.Object
-
- org.jitsi.impl.neomedia.transform.fec.FECTransformEngine
-
- All Implemented Interfaces:
PacketTransformer,TransformEngine
public class FECTransformEngine extends Object implements TransformEngine, PacketTransformer
Implements aPacketTransformerandTransformEnginefor RFC5109.- Author:
- Boris Grozev, bbaldino
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFECTransformEngine.FecType
-
Field Summary
Fields Modifier and Type Field Description protected FECTransformEngine.FecTypefecTypeThe fec type this transform engine will instantiatestatic intINITIAL_BUFFER_SIZEInitial size for newly allocated byte arrays.
-
Constructor Summary
Constructors Constructor Description FECTransformEngine(FECTransformEngine.FecType fecType, byte incomingPT, byte outgoingPT, MediaStream mediaStream)Initializes a new FECTransformEngine instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this PacketTransformer i.e.intgetFecRate()Get the rate at which ulpfec packets will be generated and added to the stream by this PacketTransformer.PacketTransformergetRTCPTransformer()Gets the PacketTransformer for RTCP packets.PacketTransformergetRTPTransformer()Gets the PacketTransformer for RTP packets.RawPacket[]reverseTransform(RawPacket[] pkts)Reverse-transforms each packet in an array of packets.voidsetFecRate(int fecRate)Sets the rate at which ulpfec packets will be generated and added to the stream by this PacketTransformer.voidsetIncomingPT(byte incomingPT)Sets the payload type for incoming ulpfec packets.voidsetOutgoingPT(byte outgoingPT)Sets the payload type for outgoing ulpfec packets.RawPacket[]transform(RawPacket[] pkts)Transforms each packet in an array of packets.
-
-
-
Field Detail
-
INITIAL_BUFFER_SIZE
public static final int INITIAL_BUFFER_SIZE
Initial size for newly allocated byte arrays.- See Also:
- Constant Field Values
-
fecType
protected FECTransformEngine.FecType fecType
The fec type this transform engine will instantiate
-
-
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:
reverseTransformin interfacePacketTransformer- 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:
transformin interfacePacketTransformer- 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:
closein interfacePacketTransformer
-
getRTPTransformer
public PacketTransformer getRTPTransformer()
Gets the PacketTransformer for RTP packets.- Specified by:
getRTPTransformerin interfaceTransformEngine- Returns:
- the PacketTransformer for RTP packets
-
getRTCPTransformer
public PacketTransformer getRTCPTransformer()
Gets the PacketTransformer for RTCP packets. We don't touch RTCP.- Specified by:
getRTCPTransformerin interfaceTransformEngine- Returns:
- the PacketTransformer for RTCP packets
-
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.
-
-