avc

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2020 License: MIT Imports: 4 Imported by: 6

Documentation

Index

Constants

View Source
const (
	NaluUnitTypeSlice    uint8 = 1
	NaluUnitTypeIDRSlice uint8 = 5
	NaluUnitTypeSEI      uint8 = 6
	NaluUintTypeSPS      uint8 = 7
	NaluUintTypePPS      uint8 = 8
	NaluUintTypeAUD      uint8 = 9
)
View Source
const (
	SliceTypeP  uint8 = 0
	SliceTypeB  uint8 = 1
	SliceTypeI  uint8 = 2
	SliceTypeSP uint8 = 3 // TODO chef
	SliceTypeSI uint8 = 4 // TODO chef
)

Variables

View Source
var ErrAVC = errors.New("lal.avc: fxxk")
View Source
var NaluStartCode = []byte{0x0, 0x0, 0x0, 0x1}
View Source
var NaluUintTypeMapping = map[uint8]string{
	1: "SLICE",
	5: "IDR",
	6: "SEI",
	7: "SPS",
	8: "PPS",
	9: "AUD",
}
View Source
var SliceTypeMapping = map[uint8]string{
	0: "P",
	1: "B",
	2: "I",
	3: "SP",
	4: "SI",
	5: "P",
	6: "B",
	7: "I",
	8: "SP",
	9: "SI",
}

Functions

func CalcNaluType added in v0.8.0

func CalcNaluType(nalu []byte) uint8

func CalcNaluTypeReadable added in v0.8.0

func CalcNaluTypeReadable(nalu []byte) string

func CalcSliceType added in v0.8.0

func CalcSliceType(nalu []byte) uint8

TODO chef: 考虑将error返回给上层

func CalcSliceTypeReadable added in v0.8.0

func CalcSliceTypeReadable(nalu []byte) string

func CaptureAVC

func CaptureAVC(w io.Writer, payload []byte) error

将rtmp avc数据转换成avc裸流 @param <payload> rtmp message的payload部分 或者 flv tag的payload部分

func ParseAVCSeqHeader

func ParseAVCSeqHeader(payload []byte) (sps, pps []byte, err error)

TODO chef: 参考 hls session的代码,重构这个函数 从 rtmp avc sequence header 中解析 sps 和 pps @param <payload> rtmp message的payload部分 或者 flv tag的payload部分

Types

This section is empty.

Jump to

Keyboard shortcuts

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