Help us shape the future of Go! Take the 2026 Go Developer Survey

codecmunger

package
v1.13.11 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const MaxHeaderSize = 8

MaxHeaderSize is the largest codec header the mungers produce (VP8: 6 bytes).

Variables

View Source
var (
	ErrNotVP8                          = errors.New("not VP8")
	ErrOutOfOrderVP8PictureIdCacheMiss = errors.New("out-of-order VP8 picture id not found in cache")
	ErrFilteredTemporalLayer           = errors.New("filtered temporal layer")
	ErrFilteredOutOfOrder              = errors.New("filtered out-of-order packet")
)

Functions

This section is empty.

Types

type CodecMunger

type CodecMunger interface {
	GetState() any
	SeedState(state any)

	SetLast(extPkt *buffer.ExtPacket)
	UpdateOffsets(extPkt *buffer.ExtPacket)

	// UpdateAndGet returns the incoming codec header size and the munged
	// header by value, so the per-packet path does not allocate.
	UpdateAndGet(extPkt *buffer.ExtPacket, snOutOfOrder bool, snHasGap bool, maxTemporal int32) (int, [MaxHeaderSize]byte, int, error)

	UpdateAndGetPadding(newPicture bool) ([]byte, error)
}

type DDTemporal added in v1.13.10

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

DDTemporal filters the temporal layers of a simulcast stream with the dependency descriptor, for any codec: it leaves the payload unchanged. Every packet names its frame and temporal layer, so the munger decides once per frame and applies that decision to all packets of the frame, a late one included. For VP8, libwebrtc sends a one byte payload descriptor with the dependency descriptor, so there is no picture ID to munge; the forwarder uses the VP8 munger for a stream that keeps picture IDs.

func NewDDTemporal added in v1.13.10

func NewDDTemporal(mimeType mime.MimeType, logger logger.Logger) *DDTemporal

func (*DDTemporal) GetState added in v1.13.10

func (v *DDTemporal) GetState() any

func (*DDTemporal) SeedState added in v1.13.10

func (v *DDTemporal) SeedState(_state any)

func (*DDTemporal) SetLast added in v1.13.10

func (v *DDTemporal) SetLast(_extPkt *buffer.ExtPacket)

func (*DDTemporal) UpdateAndGet added in v1.13.10

func (v *DDTemporal) UpdateAndGet(extPkt *buffer.ExtPacket, snOutOfOrder bool, _snHasGap bool, maxTemporalLayer int32) (int, [MaxHeaderSize]byte, int, error)

func (*DDTemporal) UpdateAndGetPadding added in v1.13.10

func (v *DDTemporal) UpdateAndGetPadding(_newPicture bool) ([]byte, error)

func (*DDTemporal) UpdateOffsets added in v1.13.10

func (v *DDTemporal) UpdateOffsets(_extPkt *buffer.ExtPacket)

type Null

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

func NewNull

func NewNull(_logger logger.Logger) *Null

func (*Null) GetSeededState

func (n *Null) GetSeededState() any

func (*Null) GetState

func (n *Null) GetState() any

func (*Null) SeedState

func (n *Null) SeedState(state any)

func (*Null) SetLast

func (n *Null) SetLast(_extPkt *buffer.ExtPacket)

func (*Null) UpdateAndGet

func (n *Null) UpdateAndGet(_extPkt *buffer.ExtPacket, snOutOfOrder bool, snHasGap bool, maxTemporal int32) (int, [MaxHeaderSize]byte, int, error)

func (*Null) UpdateAndGetPadding

func (n *Null) UpdateAndGetPadding(newPicture bool) ([]byte, error)

func (*Null) UpdateOffsets

func (n *Null) UpdateOffsets(_extPkt *buffer.ExtPacket)

type VP8

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

func NewVP8

func NewVP8(logger logger.Logger) *VP8

func NewVP8FromOther added in v1.9.11

func NewVP8FromOther(cm CodecMunger, logger logger.Logger) *VP8

func (*VP8) GetState

func (v *VP8) GetState() any

func (*VP8) PictureIdOffset

func (v *VP8) PictureIdOffset(extPictureId int32) (int32, bool)

for testing only

func (*VP8) SeedState

func (v *VP8) SeedState(seed any)

func (*VP8) SetLast

func (v *VP8) SetLast(extPkt *buffer.ExtPacket)

func (*VP8) UpdateAndGet

func (v *VP8) UpdateAndGet(extPkt *buffer.ExtPacket, snOutOfOrder bool, snHasGap bool, maxTemporalLayer int32) (int, [MaxHeaderSize]byte, int, error)

func (*VP8) UpdateAndGetPadding

func (v *VP8) UpdateAndGetPadding(newPicture bool) ([]byte, error)

func (*VP8) UpdateOffsets

func (v *VP8) UpdateOffsets(extPkt *buffer.ExtPacket)

type VP8PictureIdWrapHandler

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

func (*VP8PictureIdWrapHandler) Init

func (v *VP8PictureIdWrapHandler) Init(extPictureId int32, mBit bool)

func (*VP8PictureIdWrapHandler) MaxPictureId

func (v *VP8PictureIdWrapHandler) MaxPictureId() int32

func (*VP8PictureIdWrapHandler) Unwrap

func (v *VP8PictureIdWrapHandler) Unwrap(pictureId uint16, mBit bool) int32

unwrap picture id and update the maxPictureId. return unwrapped value

func (*VP8PictureIdWrapHandler) UpdateMaxPictureId

func (v *VP8PictureIdWrapHandler) UpdateMaxPictureId(extPictureId int32, mBit bool)

Jump to

Keyboard shortcuts

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