public abstract class AbstractFECReceiver extends java.lang.Object implements PacketTransformer
PacketTransformer
which handles incoming fec packets. This class
contains only the generic fec handling logic.Modifier and Type | Class and Description |
---|---|
(package private) class |
AbstractFECReceiver.Statistics |
Modifier and Type | Field and Description |
---|---|
protected java.util.SortedMap<java.lang.Integer,RawPacket> |
fecPackets
Buffer which keeps (copies of) received fec packets.
|
protected boolean |
handleFec
Allow disabling of handling of ulpfec packets for testing purposes.
|
protected java.util.SortedMap<java.lang.Integer,RawPacket> |
mediaPackets
Buffer which keeps (copies of) received media packets.
|
protected long |
ssrc
The SSRC of the fec stream
NOTE that for ulpfec this might be the same as the associated media
stream, whereas for flexfec it will be different
|
protected AbstractFECReceiver.Statistics |
statistics
Statistics for this fec receiver
|
Constructor and Description |
---|
AbstractFECReceiver(long ssrc,
byte payloadType)
Initialize the FEC receiver
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this PacketTransformer i.e.
|
protected abstract RawPacket[] |
doReverseTransform(RawPacket[] pkts)
Perform fec receive logic specific to the fec implementation
|
RawPacket[] |
reverseTransform(RawPacket[] pkts)
Reverse-transforms each packet in an array of packets.
|
protected void |
saveMedia(RawPacket p)
Makes a copy of p into mediaPackets.
|
void |
setPayloadType(byte payloadType)
Sets the ulpfec payload type.
|
RawPacket[] |
transform(RawPacket[] pkts)
Transforms each packet in an array of packets.
|
protected final AbstractFECReceiver.Statistics statistics
protected long ssrc
protected boolean handleFec
protected final java.util.SortedMap<java.lang.Integer,RawPacket> mediaPackets
protected final java.util.SortedMap<java.lang.Integer,RawPacket> fecPackets
AbstractFECReceiver(long ssrc, byte payloadType)
ssrc
- the ssrc of the stream on which fec packets will be receivedpayloadType
- the payload type of the fec packetsprotected void saveMedia(RawPacket p)
p
- the packet to copy.public void setPayloadType(byte payloadType)
payloadType
- the payload type.
FIXME(brian): do we need both this and the ability to pass the payload
type in the ctor? Can we get rid of this or get rid of the arg in the ctor?public RawPacket[] transform(RawPacket[] pkts)
transform
in interface PacketTransformer
pkts
- the packets to be transformedpublic RawPacket[] reverseTransform(RawPacket[] pkts)
PacketTransformer
reverseTransform
in interface PacketTransformer
pkts
- the transformed packets to be restored.public void close()
close
in interface PacketTransformer
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.