Documentation ¶
Index ¶
- Constants
- Variables
- func AnnexBToAVCC(b []byte) ([]byte, error)
- func CheckNALUsType(b []byte) (typ int)
- func DecodeAVCC(b []byte) ([][]byte, error)
- func DecodeAnnexB(b []byte) ([][]byte, error)
- func EncodeAVCC(nalus [][]byte) []byte
- func IsDataNALU(b []byte) bool
- func PktToCodecData(pkt av.Packet) (h264CodecData av.CodecData, err error)
- func SplitNALUs(b []byte) ([][]byte, int)
- type AVCDecoderConfRecord
- type CodecData
- func (self CodecData) AVCDecoderConfRecordBytes() []byte
- func (self CodecData) Framerate() (int, int)
- func (self CodecData) Height() int
- func (self CodecData) PPS() []byte
- func (self CodecData) PacketDuration([]byte) (dur time.Duration, err error)
- func (self CodecData) SPS() []byte
- func (self CodecData) Type() av.CodecType
- func (self CodecData) Width() int
- type SPSInfo
- type SliceType
Constants ¶
View Source
const ( NALU_SEI = 6 NALU_PPS = 7 NALU_SPS = 8 NALU_AUD = 9 )
View Source
const ( NALU_RAW = iota NALU_AVCC NALU_ANNEXB )
View Source
const ( SLICE_P = iota + 1 SLICE_B SLICE_I )
Variables ¶
View Source
var AUDBytes = []byte{0, 0, 0, 1, 0x9, 0xf0, 0, 0, 0, 1} // AUD
View Source
var ErrDecconfInvalid = fmt.Errorf("h264parser: AVCDecoderConfRecord invalid")
View Source
var ErrInvalidAVCC = fmt.Errorf("bytestream b was not AVCC")
View Source
var ErrInvalidAnnexB = fmt.Errorf("bytestream b was not AnnexB")
View Source
var StartCodeBytes = []byte{0, 0, 1}
Functions ¶
func AnnexBToAVCC ¶ added in v1.0.31
func CheckNALUsType ¶
func DecodeAVCC ¶ added in v1.0.31
func DecodeAnnexB ¶ added in v1.0.31
func EncodeAVCC ¶ added in v1.0.31
func IsDataNALU ¶
func PktToCodecData ¶ added in v1.0.15
PktToCodecData parses NAL units to find SPS and PPS, and derive codec data from them. h264CodecData can be nil if the SPS and/or PPS is not found
func SplitNALUs ¶
Types ¶
type AVCDecoderConfRecord ¶
type AVCDecoderConfRecord struct { AVCProfileIndication uint8 ProfileCompatibility uint8 AVCLevelIndication uint8 LengthSizeMinusOne uint8 SPS [][]byte PPS [][]byte }
func (AVCDecoderConfRecord) Len ¶
func (self AVCDecoderConfRecord) Len() (n int)
func (AVCDecoderConfRecord) Marshal ¶
func (self AVCDecoderConfRecord) Marshal(b []byte) (n int)
type CodecData ¶
type CodecData struct { Record []byte RecordInfo AVCDecoderConfRecord SPSInfo SPSInfo }
func (CodecData) AVCDecoderConfRecordBytes ¶
func (CodecData) PacketDuration ¶ added in v1.0.15
Click to show internal directories.
Click to hide internal directories.