tsio

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StreamIDH264 const
	StreamIDH264 = 0xe0
	// StreamIDAAC const
	StreamIDAAC = 0xc0
)
View Source
const (
	// PatPID const
	PatPID = 0
	// PmtPID const
	PmtPID = 0x1000
)
View Source
const (
	// ElementaryStreamTypeH264 const
	ElementaryStreamTypeH264 = 0x1B
	// ElementaryStreamTypeAdtsAAC const
	ElementaryStreamTypeAdtsAAC = 0x0F
)
View Source
const (
	// PtsHZ const
	PtsHZ = 90000
	// PcrHZ const
	PcrHZ = 27000000
)
View Source
const MaxPESHeaderLength = 19

MaxPESHeaderLength var

View Source
const MaxTSHeaderLength = 12

MaxTSHeaderLength var

View Source
const PSIHeaderLength = 9

PSIHeaderLength var

View Source
const TableExtPAT = 1

TableExtPAT var

View Source
const TableExtPMT = 1

TableExtPMT var

View Source
const TableIDPAT = 0

TableIDPAT var

View Source
const TableIDPMT = 2

TableIDPMT var

Variables

View Source
var ErrPESHeader = fmt.Errorf("invalid PES header")

ErrPESHeader func

View Source
var ErrPSIHeader = fmt.Errorf("invalid PSI header")

ErrPSIHeader func

View Source
var ErrParsePAT = fmt.Errorf("invalid PAT")

ErrParsePAT func

View Source
var ErrParsePMT = fmt.Errorf("invalid PMT")

ErrParsePMT func

Functions

func FillPESHeader

func FillPESHeader(h []byte, streamid uint8, datalen int, pts, dts time.Duration) (n int)

FillPESHeader func

func FillPSI

func FillPSI(h []byte, tableid uint8, tableext uint16, datalen int) (n int)

FillPSI func

func PCRToTime

func PCRToTime(pcr uint64) (tm time.Duration)

PCRToTime func

func ParsePESHeader

func ParsePESHeader(h []byte) (hdrlen int, streamid uint8, datalen int, pts, dts time.Duration, err error)

ParsePESHeader func

func ParsePSI

func ParsePSI(h []byte) (tableid uint8, tableext uint16, hdrlen int, datalen int, err error)

ParsePSI func

func ParseTSHeader

func ParseTSHeader(tshdr []byte) (pid uint16, start bool, iskeyframe bool, hdrlen int, err error)

ParseTSHeader func

func TimeToPCR

func TimeToPCR(tm time.Duration) (pcr uint64)

TimeToPCR func

func TimeToTs

func TimeToTs(tm time.Duration) (v uint64)

TimeToTs func

func TsToTime

func TsToTime(v uint64) (tm time.Duration)

TsToTime func

Types

type Descriptor

type Descriptor struct {
	Tag  uint8
	Data []byte
}

Descriptor func

type ElementaryStreamInfo

type ElementaryStreamInfo struct {
	StreamType    uint8
	ElementaryPID uint16
	Descriptors   []Descriptor
}

ElementaryStreamInfo func

type PAT

type PAT struct {
	Entries []PATEntry
}

PAT func

func (PAT) Len

func (inst PAT) Len() (n int)

Len func

func (PAT) Marshal

func (inst PAT) Marshal(b []byte) (n int)

Marshal func

func (*PAT) Unmarshal

func (inst *PAT) Unmarshal(b []byte) (n int, err error)

Unmarshal func

type PATEntry

type PATEntry struct {
	ProgramNumber uint16
	NetworkPID    uint16
	ProgramMapPID uint16
}

PATEntry func

type PMT

type PMT struct {
	PCRPID                uint16
	ProgramDescriptors    []Descriptor
	ElementaryStreamInfos []ElementaryStreamInfo
}

PMT func

func (PMT) Len

func (inst PMT) Len() (n int)

Len func

func (PMT) Marshal

func (inst PMT) Marshal(b []byte) (n int)

Marshal func

func (*PMT) Unmarshal

func (inst *PMT) Unmarshal(b []byte) (n int, err error)

Unmarshal func

type TSWriter

type TSWriter struct {
	ContinuityCounter uint
	// contains filtered or unexported fields
}

TSWriter func

func NewTSWriter

func NewTSWriter(pid uint16) *TSWriter

NewTSWriter func

func (*TSWriter) WritePackets

func (inst *TSWriter) WritePackets(w io.Writer, datav [][]byte, pcr time.Duration, sync bool, paddata bool) (err error)

WritePackets func

Jump to

Keyboard shortcuts

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