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 ( TableIdPMT = 2 TableExtPMT = 1 )
View Source
const ( TableIdPAT = 0 TableExtPAT = 1 )
View Source
const ( MaxPESHeaderLength = 19 MaxTSHeaderLength = 12 )
View Source
const ( ElementaryStreamTypeH264 = 0x1B ElementaryStreamTypeAdtsAAC = 0x0F ElementaryStreamTypeAlignmentDescriptor = 0x06 ElementaryStreamTypeH265 = 0x24 )
View Source
const ( PTS_HZ = 90000 PCR_HZ = 27000000 )
View Source
const PSIHeaderLength = 9
Variables ¶
Functions ¶
func FillPESHeader ¶
func ParsePESHeader ¶
func ParsePSI ¶
func ParseTSHeader ¶
func WriteRepeatVal ¶
WriteRepeatVal func
func WriteTSHeader ¶
WriteTSHeader func
Types ¶
type ElementaryStreamInfo ¶
type ElementaryStreamInfo struct {
StreamType uint8
ElementaryPID uint16
Descriptors []Descriptor
}
type PATEntry ¶
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
Source Files
¶
- checksum.go
- tsio.go
- tsio_header_packets.go
Click to show internal directories.
Click to hide internal directories.