Documentation ¶
Index ¶
- Constants
- Variables
- func FillPESHeader(h []byte, streamid uint8, datalen int, pts, dts time.Duration) (n int)
- func FillPSI(h []byte, tableid uint8, tableext uint16, datalen int) (n int)
- func PCRToTime(pcr uint64) (tm time.Duration)
- func PCRToUInt(pcr uint64) uint64
- func ParsePESHeader(h []byte) (hdrlen int, streamid uint8, datalen int, pts, dts time.Duration, err error)
- func ParsePSI(h []byte) (tableid uint8, tableext uint16, hdrlen int, datalen int, err error)
- func ParseTSHeader(tshdr []byte) (pid uint16, start bool, iskeyframe bool, hdrlen int, err error)
- func TimeToPCR(tm time.Duration) (pcr uint64)
- func TimeToTs(tm time.Duration) (v uint64)
- func TsToTime(v uint64) (tm time.Duration)
- func WriteRepeatVal(w io.Writer, val byte, n int) (err error)
- func WriteTSHeader(w io.Writer, element TSHeader, dataLength int) (written int, err error)
- func WriteUInt(w io.Writer, val uint, n int) (err error)
- func WriteUInt64(w io.Writer, val uint64, n int) (err error)
- type Descriptor
- type ElementaryStreamInfo
- type PAT
- type PATEntry
- type PMT
- type TSHeader
- type TSWriter
Constants ¶
View Source
const ( StreamIdH264 = 0xe0 StreamIdAAC = 0xc0 )
View Source
const ( PAT_PID = 0 PMT_PID = 0x1000 )
View Source
const ( ElementaryStreamTypeH264 = 0x1B ElementaryStreamTypeAdtsAAC = 0x0F ElementaryStreamTypeAlignmentDescriptor = 0x06 ElementaryStreamTypeH265 = 0x24 )
View Source
const ( PTS_HZ = 90000 PCR_HZ = 27000000 )
View Source
const MaxPESHeaderLength = 19
View Source
const MaxTSHeaderLength = 12
View Source
const PSIHeaderLength = 9
View Source
const TableExtPAT = 1
View Source
const TableExtPMT = 1
View Source
const TableIdPAT = 0
View Source
const TableIdPMT = 2
Variables ¶
View Source
var ErrPESHeader = fmt.Errorf("invalid PES header")
View Source
var ErrPSIHeader = fmt.Errorf("invalid PSI header")
View Source
var ErrParsePAT = fmt.Errorf("invalid PAT")
View Source
var ErrParsePMT = fmt.Errorf("invalid PMT")
Functions ¶
func FillPESHeader ¶
func ParsePESHeader ¶
func ParseTSHeader ¶
func WriteRepeatVal ¶
WriteRepeatVal func
func WriteTSHeader ¶
WriteTSHeader func
Types ¶
type Descriptor ¶
type ElementaryStreamInfo ¶
type ElementaryStreamInfo struct { StreamType uint8 ElementaryPID uint16 Descriptors []Descriptor }
type PMT ¶
type PMT struct { PCRPID uint16 ProgramDescriptors []Descriptor ElementaryStreamInfos []ElementaryStreamInfo }
type TSHeader ¶
type TSHeader struct { PID uint PCR uint64 OPCR uint64 ContinuityCounter uint PayloadUnitStart bool DiscontinuityIndicator bool RandomAccessIndicator bool HeaderLength uint }
TSHeader func
type TSWriter ¶
type TSWriter struct { ContinuityCounter uint // contains filtered or unexported fields }
func NewTSWriter ¶
Click to show internal directories.
Click to hide internal directories.