Class PayloadTypeTransformEngine
- java.lang.Object
-
- org.jitsi.impl.neomedia.transform.SinglePacketTransformer
-
- org.jitsi.impl.neomedia.transform.SinglePacketTransformerAdapter
-
- org.jitsi.impl.neomedia.transform.pt.PayloadTypeTransformEngine
-
- All Implemented Interfaces:
PacketTransformer,TransformEngine
public class PayloadTypeTransformEngine extends SinglePacketTransformerAdapter implements TransformEngine
We use this engine to change payload types of outgoing RTP packets if needed. This is necessary so that we can support the RFC3264 case where the answerer has the right to declare what payload type mappings it wants to receive even if they are different from those in the offer. RFC3264 claims this is for support of legacy protocols such as H.323 but we've been bumping with a number of cases where multi-component pure SIP systems also need to behave this way.- Author:
- Damian Minkov
-
-
Constructor Summary
Constructors Constructor Description PayloadTypeTransformEngine()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPTMappingOverride(byte originalPt, byte overridePt)Adds an additional RTP payload type mapping used to override the payload type of outgoing RTP packets.voidclose()Closes this PacketTransformer i.e.PacketTransformergetRTCPTransformer()Always returns null since this engine does not require any RTCP transformations.PacketTransformergetRTPTransformer()Returns a reference to this class since it is performing RTP transformations in here.RawPackettransform(RawPacket pkt)Checks if there are any override mappings, if no setting just pass through the packet.-
Methods inherited from class org.jitsi.impl.neomedia.transform.SinglePacketTransformerAdapter
reverseTransform
-
Methods inherited from class org.jitsi.impl.neomedia.transform.SinglePacketTransformer
reverseTransform, transform
-
-
-
-
Method Detail
-
transform
public RawPacket transform(RawPacket pkt)
Checks if there are any override mappings, if no setting just pass through the packet. If the RawPacket payload has entry in mappings to override, we override packet payload type.- Overrides:
transformin classSinglePacketTransformerAdapter- Parameters:
pkt- the RTP RawPacket that we check for need to change payload type.- Returns:
- the updated RawPacket instance containing the changed payload type.
-
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- Overrides:
closein classSinglePacketTransformer
-
getRTPTransformer
public PacketTransformer getRTPTransformer()
Returns a reference to this class since it is performing RTP transformations in here.- Specified by:
getRTPTransformerin interfaceTransformEngine- Returns:
- a reference to this instance of the PayloadTypeTransformEngine.
-
getRTCPTransformer
public PacketTransformer getRTCPTransformer()
Always returns null since this engine does not require any RTCP transformations.- Specified by:
getRTCPTransformerin interfaceTransformEngine- Returns:
- null since this engine does not require any RTCP transformations.
-
addPTMappingOverride
public void addPTMappingOverride(byte originalPt, byte overridePt)Adds an additional RTP payload type mapping used to override the payload type of outgoing RTP packets. If an override for originalPT, was already being overridden, this call is simply going to update the override to the new one.This method creates a copy of the local overriding map so that mapping overrides could be set during a call (e.g. after a SIP re-INVITE) in a thread-safe way without using synchronization.
- Parameters:
originalPt- the payload type that we are overridingoverridePt- the payload type that we are overriding it with
-
-