h264parser

package
Version: 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 (confRecord AVCDecoderConfRecord) Len() (n int)

Len func

func (AVCDecoderConfRecord) Marshal

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

Marshal func

func (*AVCDecoderConfRecord) Unmarshal

func (confRecord *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) (codecData CodecData, err error)

NewCodecDataFromAVCDecoderConfRecord func

func NewCodecDataFromSPSAndPPS

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

NewCodecDataFromSPSAndPPS func

func (CodecData) AVCDecoderConfRecordBytes

func (codecData CodecData) AVCDecoderConfRecordBytes() []byte

AVCDecoderConfRecordBytes func

func (CodecData) Height

func (codecData CodecData) Height() int

Height func

func (CodecData) PPS

func (codecData CodecData) PPS() []byte

PPS func

func (CodecData) SPS

func (codecData CodecData) SPS() []byte

SPS func

func (CodecData) Type

func (codecData CodecData) Type() av.CodecType

Type func

func (CodecData) Width

func (codecData 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) (inst 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 (sliceType SliceType) String() string

String func

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL