pktque

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 2 Imported by: 19

Documentation

Overview

Package pktque provides packet Filter interface and structures used by other components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AVSync

type AVSync struct {
	MaxTimeDiff time.Duration
	// contains filtered or unexported fields
}

Drop incorrect packets to make A/V sync.

func (*AVSync) ModifyPacket

func (self *AVSync) ModifyPacket(pkt *av.Packet, streams []av.CodecData, videoidx int, audioidx int) (drop bool, err error)

type Buf

type Buf struct {
	Head, Tail BufPos

	Size  int
	Count int
	// contains filtered or unexported fields
}

func NewBuf

func NewBuf() *Buf

func (*Buf) Get

func (self *Buf) Get(pos BufPos) av.Packet

func (*Buf) IsValidPos

func (self *Buf) IsValidPos(pos BufPos) bool

func (*Buf) Pop

func (self *Buf) Pop() av.Packet

func (*Buf) Push

func (self *Buf) Push(pkt av.Packet)

type BufPos

type BufPos int

func (BufPos) GE

func (self BufPos) GE(pos BufPos) bool

func (BufPos) GT

func (self BufPos) GT(pos BufPos) bool

func (BufPos) LT

func (self BufPos) LT(pos BufPos) bool

type CalcDuration added in v0.0.23

type CalcDuration struct {
	LastTime map[int8]time.Duration
}

func (*CalcDuration) ModifyPacket added in v0.0.23

func (self *CalcDuration) ModifyPacket(pkt *av.Packet, streams []av.CodecData, videoidx int, audioidx int) (drop bool, err error)

type Filter

type Filter interface {
	// Change packet time or drop packet
	ModifyPacket(pkt *av.Packet, streams []av.CodecData, videoidx int, audioidx int) (drop bool, err error)
}

type FilterDemuxer

type FilterDemuxer struct {
	av.Demuxer
	Filter Filter
	// contains filtered or unexported fields
}

Wrap origin Demuxer and Filter into a new Demuxer, when read this Demuxer filters will be called.

func (*FilterDemuxer) ReadPacket

func (self *FilterDemuxer) ReadPacket() (pkt av.Packet, err error)

type Filters

type Filters []Filter

Combine multiple Filters into one, ModifyPacket will be called in order.

func (Filters) ModifyPacket

func (self Filters) ModifyPacket(pkt *av.Packet, streams []av.CodecData, videoidx int, audioidx int) (drop bool, err error)

type FixTime

type FixTime struct {
	StartFromZero bool // make timestamp start from zero
	MakeIncrement bool // force timestamp increment
	// contains filtered or unexported fields
}

Fix incorrect packet timestamps.

func (*FixTime) ModifyPacket

func (self *FixTime) ModifyPacket(pkt *av.Packet, streams []av.CodecData, videoidx int, audioidx int) (drop bool, err error)

type Timeline

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

func (*Timeline) Pop

func (self *Timeline) Pop(dur time.Duration) (tm time.Duration)

func (*Timeline) Push

func (self *Timeline) Push(tm time.Duration, dur time.Duration)

type WaitKeyFrame

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

Drop packets until first video key frame arrived.

func (*WaitKeyFrame) ModifyPacket

func (self *WaitKeyFrame) ModifyPacket(pkt *av.Packet, streams []av.CodecData, videoidx int, audioidx int) (drop bool, err error)

type Walltime

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

Make packets reading speed as same as walltime, effect like ffmpeg -re option.

func (*Walltime) ModifyPacket

func (self *Walltime) ModifyPacket(pkt *av.Packet, streams []av.CodecData, videoidx int, audioidx int) (drop bool, err error)

Jump to

Keyboard shortcuts

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