Class REDTransformEngine
- java.lang.Object
-
- org.jitsi.impl.neomedia.transform.REDTransformEngine
-
- All Implemented Interfaces:
PacketTransformer,TransformEngine
public class REDTransformEngine extends Object implements TransformEngine, PacketTransformer
Implements aPacketTransformerandTransformEnginefor RED (RFC2198).- Author:
- Boris Grozev
-
-
Constructor Summary
Constructors Constructor Description REDTransformEngine()Initializes a new REDTransformEngine instance.REDTransformEngine(byte incomingPT, byte outgoingPT)Initializes a new REDTransformEngine instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this PacketTransformer i.e.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.voidsetIncomingPT(byte incomingPT)Sets the RED payload type for incoming red packets.voidsetOutgoingPT(byte outgoingPT)Sets the RED payload type for outgoing red packets.RawPacket[]transform(RawPacket[] pkts)Transforms each packet in an array of packets.
-
-
-
Constructor Detail
-
REDTransformEngine
public REDTransformEngine(byte incomingPT, byte outgoingPT)Initializes a new REDTransformEngine instance.- Parameters:
incomingPT- the RED payload type number for incoming packets.outgoingPT- the RED payload type number for outgoing packets.
-
REDTransformEngine
public REDTransformEngine()
Initializes a new REDTransformEngine instance.
-
-
Method Detail
-
setIncomingPT
public void setIncomingPT(byte incomingPT)
Sets the RED payload type for incoming red packets.- Parameters:
incomingPT- the payload type to set.
-
setOutgoingPT
public void setOutgoingPT(byte outgoingPT)
Sets the RED payload type for outgoing red packets.- Parameters:
outgoingPT- the payload type to set.
-
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
-
reverseTransform
public RawPacket[] reverseTransform(RawPacket[] pkts)
Reverse-transforms each packet in an array of packets. Null values must be ignored. Reverse-transform a RED (RFC2198) packet.- 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. Encapsulates the packets in pkts with RED (RFC2198). Effectively inserts the following 1-byte RED header right after the RTP header (where "Block PT" is the payload type of the original packet) and changes the payload type of the packet to outgoingPT 0 1 2 3 4 5 6 7 +-+-+-+-+-+-+-+-+ |0| Block PT | +-+-+-+-+-+-+-+-+- Specified by:
transformin interfacePacketTransformer- Parameters:
pkts- the packets to be transformed- Returns:
- the transformed packets
-
getRTPTransformer
public PacketTransformer getRTPTransformer()
Gets the PacketTransformer for RTP packets. Return the single PacketTransformer for this TransformEngine- 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
-
-