h264parser

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NaluSei const
	NaluSei = 6
	// NaluPps const
	NaluPps = 7
	// NaluSps const
	NaluSps = 8
	// NaluAud const
	NaluAud = 9
)
View Source
const (
	// NaluRaw const
	NaluRaw = iota
	// NaluAvcc const
	NaluAvcc
	// NaluAnnexb const
	NaluAnnexb
)
View Source
const (
	// SliceP const
	SliceP = iota + 1
	// SliceB const
	SliceB
	// SliceI const
	SliceI
)

Variables

View Source
var AUDBytes = []byte{0, 0, 0, 1, 0x9, 0xf0, 0, 0, 0, 1} // AUD

AUDBytes var

View Source
var ErrDecconfInvalid = fmt.Errorf("h264parser: AVCDecoderConfRecord invalid")

ErrDecconfInvalid var

View Source
var StartCodeBytes = []byte{0, 0, 1}

StartCodeBytes var

Functions

func CheckNALUsType

func CheckNALUsType(b []byte) (typ int)

CheckNALUsType func

func IsDataNALU

func IsDataNALU(b []byte) bool

IsDataNALU func

func SplitNALUs

func SplitNALUs(b []byte) (nalus [][]byte, typ int)

SplitNALUs func

Types

type AVCDecoderConfRecord

type AVCDecoderConfRecord struct {
	AVCProfileIndication uint8
	ProfileCompatibility uint8
	AVCLevelIndication   uint8
	LengthSizeMinusOne   uint8
	SPS                  [][]byte
	PPS                  [][]byte
}

AVCDecoderConfRecord struct

func (AVCDecoderConfRecord) Len

func (instance AVCDecoderConfRecord) Len() (n int)

Len func

func (AVCDecoderConfRecord) Marshal

func (instance AVCDecoderConfRecord) Marshal(b []byte) (n int)

Marshal func

func (*AVCDecoderConfRecord) Unmarshal

func (instance *AVCDecoderConfRecord) Unmarshal(b []byte) (n int, err error)

Unmarshal func

type CodecData

type CodecData struct {
	Record     []byte
	RecordInfo AVCDecoderConfRecord
	SPSInfo    SPSInfo
}

CodecData struct

func NewCodecDataFromAVCDecoderConfRecord

func NewCodecDataFromAVCDecoderConfRecord(record []byte) (instance CodecData, err error)

NewCodecDataFromAVCDecoderConfRecord func

func NewCodecDataFromSPSAndPPS

func NewCodecDataFromSPSAndPPS(sps, pps []byte) (instance CodecData, err error)

NewCodecDataFromSPSAndPPS func

func (CodecData) AVCDecoderConfRecordBytes

func (instance CodecData) AVCDecoderConfRecordBytes() []byte

AVCDecoderConfRecordBytes func

func (CodecData) Height

func (instance CodecData) Height() int

Height func

func (CodecData) PPS

func (instance CodecData) PPS() []byte

PPS func

func (CodecData) SPS

func (instance CodecData) SPS() []byte

SPS func

func (CodecData) Type

func (instance CodecData) Type() av.CodecType

Type func

func (CodecData) Width

func (instance CodecData) Width() int

Width func

type SPSInfo

type SPSInfo struct {
	ProfileIdc uint
	LevelIdc   uint

	MbWidth  uint
	MbHeight uint

	CropLeft   uint
	CropRight  uint
	CropTop    uint
	CropBottom uint

	Width  uint
	Height uint
}

SPSInfo struct

func ParseSPS

func ParseSPS(data []byte) (spsInfo SPSInfo, err error)

ParseSPS func

type SliceType

type SliceType uint

SliceType type

func ParseSliceHeaderFromNALU

func ParseSliceHeaderFromNALU(packet []byte) (sliceType SliceType, err error)

ParseSliceHeaderFromNALU func

func (SliceType) String

func (instance SliceType) String() string

String func

Jump to

Keyboard shortcuts

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