package flexfec

Import Path
	github.com/pion/interceptor/pkg/flexfec (on go.dev)

Dependency Relation
	imports 9 packages, and imported by one package

Involved Source Files encoder_interceptor.go flexfec_coverage.go Package flexfec implements FlexFEC-03 to recover missing RTP packets due to packet loss. https://datatracker.ietf.org/doc/html/draft-ietf-payload-flexible-fec-scheme-03 Package flexfec implements FlexFEC to recover missing RTP packets due to packet loss. https://datatracker.ietf.org/doc/html/rfc8627 Package flexfec implements FlexFEC to recover missing RTP packets due to packet loss. https://datatracker.ietf.org/doc/html/rfc8627 option.go
Package-Level Type Names (total 9)
/* sort by: | */
EncoderFactory is an interface for generic FEC encoders. ( EncoderFactory) NewEncoder(payloadType uint8, ssrc uint32) FlexEncoder FlexEncoder03Factory func FECEncoderFactory(factory EncoderFactory) FecOption
FecInterceptor implements FlexFec. NoOp interceptor.NoOp BindLocalStream lets you modify any outgoing RTP packets. It is called once for per LocalStream. The returned method will be called once per rtp packet. BindRTCPReader lets you modify any incoming RTCP packets. It is called once per sender/receiver, however this might change in the future. The returned method will be called once per packet batch. BindRTCPWriter lets you modify any outgoing RTCP packets. It is called once per PeerConnection. The returned method will be called once per packet batch. BindRemoteStream lets you modify any incoming RTP packets. It is called once for per RemoteStream. The returned method will be called once per rtp packet. Close closes the Interceptor, cleaning up any data if necessary. UnbindLocalStream removes the stream state for a specific SSRC. UnbindRemoteStream is called when the Stream is removed. It can be used to clean up any data related to that track. *FecInterceptor : github.com/pion/interceptor.Interceptor *FecInterceptor : github.com/prometheus/common/expfmt.Closer *FecInterceptor : io.Closer
FecInterceptorFactory creates new FecInterceptors. NewInterceptor constructs a new FecInterceptor. *FecInterceptorFactory : github.com/pion/interceptor.Factory func NewFecInterceptor(opts ...FecOption) (*FecInterceptorFactory, error)
FecOption can be used to set initial options on Fec encoder interceptors. func FECEncoderFactory(factory EncoderFactory) FecOption func NumFECPackets(numFecPackets uint32) FecOption func NumMediaPackets(numMediaPackets uint32) FecOption func NewFecInterceptor(opts ...FecOption) (*FecInterceptorFactory, error) func github.com/pion/webrtc/v4.ConfigureFlexFEC03(payloadType webrtc.PayloadType, mediaEngine *webrtc.MediaEngine, interceptorRegistry *interceptor.Registry, options ...FecOption) error
FlexEncoder is the interface that FecInterceptor uses to encode Fec packets. ( FlexEncoder) EncodeFec(mediaPackets []rtp.Packet, numFecPackets uint32) []rtp.Packet *FlexEncoder03 *FlexEncoder20 func EncoderFactory.NewEncoder(payloadType uint8, ssrc uint32) FlexEncoder func FlexEncoder03Factory.NewEncoder(payloadType uint8, ssrc uint32) FlexEncoder
FlexEncoder03 implements the Fec encoding mechanism for the "Flex" variant of FlexFec. EncodeFec returns a list of generated RTP packets with FEC payloads that protect the specified mediaPackets. This method returns nil in case of missing RTP packets in the mediaPackets array or packets passed out of order. *FlexEncoder03 : FlexEncoder func NewFlexEncoder03(payloadType uint8, ssrc uint32) *FlexEncoder03
FlexEncoder03Factory is a factory for FlexFEC-03 encoders. NewEncoder creates new FlexFEC-03 encoder. FlexEncoder03Factory : EncoderFactory
FlexEncoder20 implementation is WIP, contains bugs and no tests. Check out FlexEncoder03. EncodeFec returns a list of generated RTP packets with FEC payloads that protect the specified mediaPackets. This method does not account for missing RTP packets in the mediaPackets array nor does it account for them being passed out of order. *FlexEncoder20 : FlexEncoder func NewFlexEncoder(payloadType uint8, ssrc uint32) *FlexEncoder20
ProtectionCoverage defines the map of RTP packets that individual Fec packets protect. ExtractMask1 returns the first section of the bitmask as defined by the FEC header. https://datatracker.ietf.org/doc/html/rfc8627#section-4.2.2.1 ExtractMask2 returns the second section of the bitmask as defined by the FEC header. https://datatracker.ietf.org/doc/html/rfc8627#section-4.2.2.1 ExtractMask3 returns the third section of the bitmask as defined by the FEC header. https://datatracker.ietf.org/doc/html/rfc8627#section-4.2.2.1 ExtractMask3_03 returns the third section of the bitmask as defined by the FEC header. https://datatracker.ietf.org/doc/html/draft-ietf-payload-flexible-fec-scheme-03#section-4.2 GetCoveredBy returns an iterator over RTP packets that are protected by the specified Fec packet index. UpdateCoverage updates the ProtectionCoverage object with new bitmasks accounting for the numFecPackets we want to use to protect the batch media packets. func NewCoverage(mediaPackets []rtp.Packet, numFecPackets uint32) *ProtectionCoverage
Package-Level Functions (total 7)
FECEncoderFactory sets the custom factory for constructing the FEC Encoders.
NewCoverage returns a new ProtectionCoverage object. numFecPackets represents the number of Fec packets that we will be generating to cover the list of mediaPackets. This allows us to know how big the underlying map should be.
NewFecInterceptor returns a new Fec interceptor factory.
NewFlexEncoder returns a new FlexEncoder20. FlexEncoder20 implementation is WIP, contains bugs and no tests. Check out FlexEncoder03.
NewFlexEncoder03 creates new FlexFEC-03 encoder.
NumFECPackets sets the number of FEC packets to generate for each batch of media packets.
NumMediaPackets sets the number of media packets to accumulate before generating another FEC packets batch.
Package-Level Constants (total 5)
BaseFec03HeaderSize represents the minium FEC payload's header size including the required first mask.
BaseFecHeaderSize represents the minium FEC payload's header size including the required first mask.
BaseRTPHeaderSize represents the minium RTP packet header size in bytes.
Maximum number of media packets that can be protected by a single FEC packet. We are not supporting the possibility of having an FEC packet protect multiple SSRC source packets for now. https://datatracker.ietf.org/doc/html/rfc8627#section-4.2.2.1
Maximum number of media packets that can be protected by a single FEC packet. We are not supporting the possibility of having an FEC packet protect multiple SSRC source packets for now. https://datatracker.ietf.org/doc/html/rfc8627#section-4.2.2.1