Class 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 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:
        close in interface PacketTransformer
      • 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:
        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. Transforms the specified pkts using each of the TransformEngines in the chain in order.
        Specified by:
        transform in interface PacketTransformer
        Parameters:
        pkts - the packets to be transformed
        Returns:
        the transformed packets
      • transform

        public RawPacket[] transform​(RawPacket[] pkts,
                                     TransformEngine after)
        Transforms the specified pkts using the TransformEngines in the chain in order starting after a specific TransformEngine.
        Parameters:
        pkts - the array of RawPackets to transform
        after - the TransformEngine in the chain after which the transformation is to begin. If after is not in the chain, the transformation executes through the whole chain.
        Returns:
        the array of RawPackets that is the result of the transformation of pkts using the TransformEngines in the chain