Class TransformEngineChain.PacketTransformerChain
- java.lang.Object
-
- org.jitsi.impl.neomedia.transform.TransformEngineChain.PacketTransformerChain
-
- All Implemented Interfaces:
PacketTransformer
- Enclosing class:
- TransformEngineChain
public class TransformEngineChain.PacketTransformerChain extends Object implements PacketTransformer
A PacketTransformerChain is a meta PacketTransformer that applies all transformers present in this engine chain. The class respects the order of the engine chain for outgoing packets and reverses it for incoming packets.
-
-
Constructor Summary
Constructors Constructor Description PacketTransformerChain(boolean rtp)Creates an instance of this packet transformer and prepares it to deal with RTP or RTCP according to the isRtp argument.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the transformer and underlying transform engines.RawPacket[]reverseTransform(RawPacket[] pkts)Reverse-transforms each packet in an array of packets.RawPacket[]transform(RawPacket[] pkts)Transforms each packet in an array of packets.RawPacket[]transform(RawPacket[] pkts, TransformEngine after)Transforms the specifiedpktsusing theTransformEngines in the chain in order starting after a specificTransformEngine.
-
-
-
Constructor Detail
-
PacketTransformerChain
public PacketTransformerChain(boolean rtp)
Creates an instance of this packet transformer and prepares it to deal with RTP or RTCP according to the isRtp argument.- Parameters:
rtp- true if this transformer will be dealing with RTP (i.e. will transform packets via the RTP transformers in this chain rather than the RTCP ones) and false otherwise.
-
-
Method Detail
-
close
public void close()
Close the transformer and underlying transform engines. Propagate the close to all transformers in chain.- 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-transforms the given packets using each of the TransformEngine-s in the engine chain in reverse order.- 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. Transforms the specifiedpktsusing each of theTransformEngines in the chain in order.- Specified by:
transformin interfacePacketTransformer- Parameters:
pkts- the packets to be transformed- Returns:
- the transformed packets
-
transform
public RawPacket[] transform(RawPacket[] pkts, TransformEngine after)
Transforms the specifiedpktsusing theTransformEngines in the chain in order starting after a specificTransformEngine.- Parameters:
pkts- the array ofRawPackets to transformafter- theTransformEnginein the chain after which the transformation is to begin. Ifafteris not in the chain, the transformation executes through the whole chain.- Returns:
- the array of
RawPackets that is the result of the transformation ofpktsusing theTransformEngines in the chain
-
-