Class AbstractFECReceiver

    • Field Detail

      • statistics

        protected final org.jitsi.impl.neomedia.transform.fec.AbstractFECReceiver.Statistics statistics
        Statistics for this fec receiver
      • ssrc

        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
      • handleFec

        protected boolean handleFec
        Allow disabling of handling of ulpfec packets for testing purposes.
      • mediaPackets

        protected final SortedMap<Integer,​RawPacket> mediaPackets
        Buffer which keeps (copies of) received media packets. We keep them ordered by their RTP sequence numbers, so that we can easily select the oldest one to discard when the buffer is full (when the map has more than MEDIA_BUFF_SIZE entries). We keep them in a Map so that we can easily search for a packet with a specific sequence number. Note: This might turn out to be inefficient, especially with increased buffer sizes. In the vast majority of cases (e.g. on every received packet) we do an insert at one end and a delete from the other -- this can be optimized. We very rarely (when we receive a packet out of order) need to insert at an arbitrary location. FIXME: Look at using the existing packet cache instead of our own here
      • fecPackets

        protected final SortedMap<Integer,​RawPacket> fecPackets
        Buffer which keeps (copies of) received fec packets. We keep them ordered by their RTP sequence numbers, so that we can easily select the oldest one to discard when the buffer is full (when the map has more than FEC_BUFF_SIZE entries. We keep them in a Map so that we can easily search for a packet with a specific sequence number. Note: This might turn out to be inefficient, especially with increased buffer sizes. In the vast majority of cases (e.g. on every received packet) we do an insert at one end and a delete from the other -- this can be optimized. We very rarely (when we receive a packet out of order) need to insert at an arbitrary location. FIXME: Look at using the existing packet cache instead of our own here
    • Method Detail

      • saveMedia

        protected void saveMedia​(RawPacket p)
        Makes a copy of p into mediaPackets. If the size of mediaPackets has reached MEDIA_BUFF_SIZE discards the oldest packet from it and reuses it.
        Parameters:
        p - the packet to copy.
      • setPayloadType

        public void setPayloadType​(byte payloadType)
        Sets the ulpfec payload type.
        Parameters:
        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?
      • transform

        public RawPacket[] transform​(RawPacket[] pkts)
        Transforms each packet in an array of packets. Null values must be ignored. Don't touch "outgoing".
        Specified by:
        transform in interface PacketTransformer
        Parameters:
        pkts - the packets to be transformed
        Returns:
        the transformed packets
      • reverseTransform

        public RawPacket[] reverseTransform​(RawPacket[] pkts)
        Description copied from interface: PacketTransformer
        Reverse-transforms each packet in an array of packets. Null values must be ignored.
        Specified by:
        reverseTransform in interface PacketTransformer
        Parameters:
        pkts - the transformed packets to be restored.
        Returns:
        the restored packets.
      • close

        public void close()
        Closes this PacketTransformer i.e. releases the resources allocated by it and prepares it for garbage collection.
        Specified by:
        close in interface PacketTransformer
      • doReverseTransform

        protected abstract RawPacket[] doReverseTransform​(RawPacket[] pkts)
        Perform fec receive logic specific to the fec implementation
        Parameters:
        pkts - the input media packets
        Returns:
        a RawPacket[] containing the given media packets as well as any media packets that were recovered