Class TransformEngineChain
- java.lang.Object
-
- org.jitsi.impl.neomedia.transform.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classTransformEngineChain.PacketTransformerChainA PacketTransformerChain is a meta PacketTransformer that applies all transformers present in this engine chain.
-
Field Summary
Fields Modifier and Type Field Description protected TransformEngine[]engineChainThe sequence of TransformEngines whose PacketTransformers this engine chain will be applying to RTP and RTCP packets.
-
Constructor Summary
Constructors Modifier Constructor Description protectedTransformEngineChain()Creates a new TransformEngineChain without initializing the array of transformers to be used.TransformEngineChain(TransformEngine[] engineChain)Creates a new TransformEngineChain using the engineChain array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddEngine(TransformEngine engine)Appends aTransformEngineto this chain.voidaddEngine(TransformEngine engine, int position)Adds aTransformEngineat a specific position in this chain.booleanaddEngine(TransformEngine engine, TransformEngine after)Adds aTransformEngineto this chain, at the position after theafterinstance.TransformEngine[]getEngineChain()Gets the sequence of TransformEngines whose PacketTransformers this engine chain applies to RTP and RTCP packets.PacketTransformergetRTCPTransformer()Returns the meta PacketTransformer that will be applying RTCP transformations from all engines registered in this TransformEngineChain.PacketTransformergetRTPTransformer()Returns the meta PacketTransformer that will be applying RTCP transformations from all engines registered in this TransformEngineChain.
-
-
-
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 aTransformEngineto this chain.- Parameters:
engine- the engine to add.- Returns:
trueif the engine was added, andfalseif the engine was not added because it is already a member of the chain.
-
addEngine
public boolean addEngine(TransformEngine engine, TransformEngine after)
Adds aTransformEngineto this chain, at the position after theafterinstance.- Parameters:
engine- the engine to add.after- theTransformEngineinstance from this chain, after whichengineshould be inserted.- Returns:
trueif the engine was added, andfalseif the engine was not added because it is already a member of the chain.
-
addEngine
public void addEngine(TransformEngine engine, int position)
Adds aTransformEngineat 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:
getRTCPTransformerin interfaceTransformEngine- 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:
getRTPTransformerin interfaceTransformEngine- Returns:
- a PacketTransformerChain over all RTP transformers in this engine chain.
-
-