Documentation ¶
Index ¶
- Constants
- Variables
- func BuildSeqHeaderFromVpsSpsPps(vps, sps, pps []byte) ([]byte, error)
- func BuildVpsSpsPps2Annexb(vps, sps, pps []byte) ([]byte, error)
- func IsIrapNalu(typ uint8) bool
- func ParseNaluType(v uint8) uint8
- func ParseNaluTypeReadable(v uint8) string
- func ParseSps(sps []byte, ctx *Context) error
- func ParseVps(vps []byte, ctx *Context) error
- func ParseVpsSpsPpsFromSeqHeader(payload []byte) (vps, sps, pps []byte, err error)
- func ParseVpsSpsPpsFromSeqHeaderWithoutMalloc(payload []byte) (vps, sps, pps []byte, err error)
- func VpsSpsPpsSeqHeader2Annexb(payload []byte) ([]byte, error)
- type Context
Constants ¶
View Source
const ( NaluTypeSliceTrailN uint8 = 0 // 0x0 NaluTypeSliceTrailR uint8 = 1 // 0x01 NaluTypeSliceTsaN uint8 = 2 // 0x02 NaluTypeSliceTsaR uint8 = 3 // 0x03 NaluTypeSliceStsaN uint8 = 4 // 0x04 NaluTypeSliceStsaR uint8 = 5 // 0x05 NaluTypeSliceRadlN uint8 = 6 // 0x06 NaluTypeSliceRadlR uint8 = 7 // 0x07 NaluTypeSliceRaslN uint8 = 8 // 0x06 NaluTypeSliceRaslR uint8 = 9 // 0x09 NaluTypeSliceBlaWlp uint8 = 16 // 0x10 NaluTypeSliceBlaWradl uint8 = 17 // 0x11 NaluTypeSliceBlaNlp uint8 = 18 // 0x12 NaluTypeSliceIdr uint8 = 19 // 0x13 NaluTypeSliceIdrNlp uint8 = 20 // 0x14 NaluTypeSliceCranut uint8 = 21 // 0x15 NaluTypeSliceRsvIrapVcl22 uint8 = 22 // 0x16 NaluTypeSliceRsvIrapVcl23 uint8 = 23 // 0x17 NaluTypeVps uint8 = 32 // 0x20 NaluTypeSps uint8 = 33 // 0x21 NaluTypePps uint8 = 34 // 0x22 NaluTypeAud uint8 = 35 // 0x23 NaluTypeSei uint8 = 39 // 0x27 NaluTypeSeiSuffix uint8 = 40 // 0x28 )
ISO_IEC_23008-2_2013.pdf Table 7-1 – NAL unit type codes and NAL unit type classes
Variables ¶
View Source
var ( NaluStartCode4 = []byte{0x0, 0x0, 0x0, 0x1} // AudNalu aud nalu AudNalu = []byte{0x00, 0x00, 0x00, 0x01, 0x46, 0x01, 0x10} )
View Source
var Log = nazalog.GetGlobalLogger()
View Source
var NaluTypeMapping = map[uint8]string{
NaluTypeSliceTrailN: "TrailN",
NaluTypeSliceTrailR: "TrailR",
NaluTypeSliceTsaN: "TsaN",
NaluTypeSliceTsaR: "TsaR",
NaluTypeSliceStsaN: "StsaN",
NaluTypeSliceStsaR: "StsaR",
NaluTypeSliceRadlN: "RadlN",
NaluTypeSliceRadlR: "RadlR",
NaluTypeSliceRaslN: "RaslN",
NaluTypeSliceRaslR: "RaslR",
NaluTypeSliceBlaWlp: "BlaWlp",
NaluTypeSliceBlaWradl: "BlaWradl",
NaluTypeSliceBlaNlp: "BlaNlp",
NaluTypeSliceIdr: "IDR",
NaluTypeSliceIdrNlp: "IDRNLP",
NaluTypeSliceCranut: "CRANUT",
NaluTypeSliceRsvIrapVcl22: "IrapVcl22",
NaluTypeSliceRsvIrapVcl23: "IrapVcl23",
NaluTypeVps: "VPS",
NaluTypeSps: "SPS",
NaluTypePps: "PPS",
NaluTypeAud: "AUD",
NaluTypeSei: "SEI",
NaluTypeSeiSuffix: "SEISuffix",
}
Functions ¶
func BuildVpsSpsPps2Annexb ¶ added in v0.31.0
func ParseNaluTypeReadable ¶ added in v0.23.0
func ParseVpsSpsPpsFromSeqHeader ¶ added in v0.23.0
ParseVpsSpsPpsFromSeqHeader
见func ParseVpsSpsPpsFromSeqHeaderWithoutMalloc
@return vps, sps, pps: 内存块为内部独立新申请
func ParseVpsSpsPpsFromSeqHeaderWithoutMalloc ¶ added in v0.24.0
ParseVpsSpsPpsFromSeqHeaderWithoutMalloc
从HVCC格式的Seq Header中得到VPS,SPS,PPS内存块。
@param payload: rtmp message的payload部分或者flv tag的payload部分。
注意,包含了头部2字节类型以及3字节的cts。
@return vps, sps, pps: 复用传入参数`payload`的内存块。
func VpsSpsPpsSeqHeader2Annexb ¶ added in v0.23.0
VpsSpsPpsSeqHeader2Annexb
HVCC Seq Header -> Annexb
@return 返回的内存块为内部独立新申请
Types ¶
Click to show internal directories.
Click to hide internal directories.