Documentation
¶
Index ¶
Constants ¶
const ExtraHeaderSize = 4
ExtraHeaderSize is the size of the extra FEC header in bytes.
Variables ¶
This section is empty.
Functions ¶
func IsControlPacket ¶
IsControlPacket checks if a packet is an FEC control packet.
func WriteControlPacket ¶
func WriteControlPacket(destSocketId uint32, ctrl *ControlPacket) packet.Packet
WriteControlPacket builds an FEC control packet and returns it.
Types ¶
type Config ¶
type Config struct {
Cols int
Rows int
Layout string // "even" or "staircase"
ARQ string // "always", "onreq", "never"
}
Config represents the parsed FEC configuration.
func ParseConfig ¶
ParseConfig parses a packet filter string into an FEC config. Example: "fec,cols:10,rows:5,layout:even"
type ControlPacket ¶
type ControlPacket struct {
SNBase uint32
TimestampRecov uint32
GroupIndex int8
FlagsRecov uint8
LengthRecov uint16
PayloadRecov []byte
}
ControlPacket holds the parsed fields of an FEC control packet.
func ParseControlPacket ¶
func ParseControlPacket(p packet.Packet) (*ControlPacket, error)
ParseControlPacket parses a gosrt packet into an FEC ControlPacket.
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator is responsible for generating FEC control packets.
func NewGenerator ¶
NewGenerator creates a new FEC Generator.
type Reconstructor ¶
type Reconstructor struct {
// contains filtered or unexported fields
}
Reconstructor is responsible for rebuilding lost packets using FEC control packets.
func NewReconstructor ¶
func NewReconstructor(cfg Config) *Reconstructor
NewReconstructor creates a new FEC Reconstructor.