Class TransformEngineChain

  • All Implemented Interfaces:
    TransformEngine

    public class TransformEngineChain
    extends Object
    implements TransformEngine
    The engine chain allows using numerous TransformEngines on a single stream.
    Author:
    Emil Ivov, Lyubomir Marinov
    • Field Detail

      • engineChain

        protected TransformEngine[] engineChain
        The sequence of TransformEngines whose PacketTransformers this engine chain will be applying to RTP and RTCP packets. Implemented as copy-on-write storage for the purposes of performance.
    • Constructor Detail

      • TransformEngineChain

        public TransformEngineChain​(TransformEngine[] engineChain)
        Creates a new TransformEngineChain using the engineChain array. Engines will be applied in the order specified by the engineChain array for outgoing packets and in the reverse order for incoming packets.
        Parameters:
        engineChain - an array containing TransformEngines in the order that they are to be applied on outgoing packets.
      • TransformEngineChain

        protected TransformEngineChain()
        Creates a new TransformEngineChain without initializing the array of transformers to be used. Allows extending classes to initialize the array on their own.
    • Method Detail

      • addEngine

        public boolean addEngine​(TransformEngine engine)
        Appends a TransformEngine to this chain.
        Parameters:
        engine - the engine to add.
        Returns:
        true if the engine was added, and false if the engine was not added because it is already a member of the chain.
      • addEngine

        public boolean addEngine​(TransformEngine engine,
                                 TransformEngine after)
        Adds a TransformEngine to this chain, at the position after the after instance.
        Parameters:
        engine - the engine to add.
        after - the TransformEngine instance from this chain, after which engine should be inserted.
        Returns:
        true if the engine was added, and false if the engine was not added because it is already a member of the chain.
      • addEngine

        public void addEngine​(TransformEngine engine,
                              int position)
        Adds a TransformEngine at a specific position in this chain.
        Parameters:
        engine - the engine to add.
        position - the position at which to add the engine.
      • getEngineChain

        public TransformEngine[] getEngineChain()
        Gets the sequence of TransformEngines whose PacketTransformers this engine chain applies to RTP and RTCP packets.
        Returns:
        the sequence of TransformEngines whose PacketTransformers this engine chain applies to RTP and RTCP packets
      • getRTCPTransformer

        public PacketTransformer getRTCPTransformer()
        Returns the meta PacketTransformer that will be applying RTCP transformations from all engines registered in this TransformEngineChain.
        Specified by:
        getRTCPTransformer in interface TransformEngine
        Returns:
        a PacketTransformerChain over all RTCP transformers in this engine chain.
      • getRTPTransformer

        public PacketTransformer getRTPTransformer()
        Returns the meta PacketTransformer that will be applying RTCP transformations from all engines registered in this TransformEngineChain.
        Specified by:
        getRTPTransformer in interface TransformEngine
        Returns:
        a PacketTransformerChain over all RTP transformers in this engine chain.