pktque

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: MIT Imports: 2 Imported by: 0

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
}

AVSync Drop incorrect packets to make A/V sync.

func (*AVSync) ModifyPacket

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

ModifyPacket ModifyPacket

type Buf

type Buf struct {
	Head, Tail BufPos

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

Buf struct

func NewBuf

func NewBuf() *Buf

NewBuf NewBuf

func (*Buf) Get

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

Get packet

func (*Buf) IsValidPos

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

IsValidPos IsValidPos

func (*Buf) Pop

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

Pop Pop

func (*Buf) Push

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

Push func

type BufPos

type BufPos int

BufPos type

func (BufPos) GE

func (inst BufPos) GE(pos BufPos) bool

GE check

func (BufPos) GT

func (inst BufPos) GT(pos BufPos) bool

GT check

func (BufPos) LT

func (inst BufPos) LT(pos BufPos) bool

LT check

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)
}

Filter Filter

type FilterDemuxer

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

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

func (FilterDemuxer) ReadPacket

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

ReadPacket ReadPacket

type Filters

type Filters []Filter

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

func (Filters) ModifyPacket

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

ModifyPacket ModifyPacket

type FixTime

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

FixTime Fix incorrect packet timestamps.

func (*FixTime) ModifyPacket

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

ModifyPacket ModifyPacket

type Timeline

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

Timeline struct

func (*Timeline) Pop

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

Pop func

func (*Timeline) Push

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

Push func

type WaitKeyFrame

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

WaitKeyFrame Drop packets until first video key frame arrived.

func (*WaitKeyFrame) ModifyPacket

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

ModifyPacket ModifyPacket

type Walltime

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

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

func (*Walltime) ModifyPacket

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

ModifyPacket ModifyPacket

Jump to

Keyboard shortcuts

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