rewriter

package
v0.0.0-...-3f3c78e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandCounter

func ExpandCounter(truncated, width uint64, latest *uint64) uint64

Expands a counter (whether it's a sequence number, timestamp or any other counter) into an expanded counter using the latest observed counter value for a calculation. It's impossible to reliably extend the counter without knowing the "max" value of the previously observed counter (i.e. the latest counter value). This function also updates the value of the latest observed counter. Returns expanded counter value that can be casted to any smaller type. The `width` defines the width of the truncated counter in bits.

func IsVP8Keyframe

func IsVP8Keyframe(packet rtp.Packet) bool

Determines if a given packet contains a VP8 keyframe.

Types

type ExpandedPacketIdentifiers

type ExpandedPacketIdentifiers struct {
	// contains filtered or unexported fields
}

Expanded identifiers after taking into account the rollover.

func (ExpandedPacketIdentifiers) Add

Add the given delta to the identifiers.

func (ExpandedPacketIdentifiers) Max

Returns the maximum value of both.

func (ExpandedPacketIdentifiers) Sub

Subtract the given delta from the identifiers.

type PacketRewriter

type PacketRewriter struct {
	// contains filtered or unexported fields
}

A structure that is used to rewrite the RTP packets that are being forwarded.

func NewPacketRewriter

func NewPacketRewriter() *PacketRewriter

Creates a new instance of the `PacketRewriter`.

func (*PacketRewriter) ProcessIncoming

func (p *PacketRewriter) ProcessIncoming(packet rtp.Packet) RewrittenRTPPacket

Process new incoming packet.

type RewrittenRTPPacket

type RewrittenRTPPacket *rtp.Packet

type TruncatedPacketIdentifiers

type TruncatedPacketIdentifiers struct {
	// contains filtered or unexported fields
}

Holds values required for the proper calculation of RTP IDs. These are the values that are being overwritten in the RTP packets.

func (TruncatedPacketIdentifiers) Add

Add the given delta to the identifiers.

func (TruncatedPacketIdentifiers) Max

Returns the maximum value of both.

func (TruncatedPacketIdentifiers) Sub

Subtract the given delta from the identifiers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL