h265parser

package
v0.0.0-...-29ab965 Latest Latest
Warning

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

Go to latest
Published: May 18, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NAL_UNIT_CODED_SLICE_TRAIL_N    = 0
	NAL_UNIT_CODED_SLICE_TRAIL_R    = 1
	NAL_UNIT_CODED_SLICE_TSA_N      = 2
	NAL_UNIT_CODED_SLICE_TSA_R      = 3
	NAL_UNIT_CODED_SLICE_STSA_N     = 4
	NAL_UNIT_CODED_SLICE_STSA_R     = 5
	NAL_UNIT_CODED_SLICE_RADL_N     = 6
	NAL_UNIT_CODED_SLICE_RADL_R     = 7
	NAL_UNIT_CODED_SLICE_RASL_N     = 8
	NAL_UNIT_CODED_SLICE_RASL_R     = 9
	NAL_UNIT_RESERVED_VCL_N10       = 10
	NAL_UNIT_RESERVED_VCL_R11       = 11
	NAL_UNIT_RESERVED_VCL_N12       = 12
	NAL_UNIT_RESERVED_VCL_R13       = 13
	NAL_UNIT_RESERVED_VCL_N14       = 14
	NAL_UNIT_RESERVED_VCL_R15       = 15
	NAL_UNIT_CODED_SLICE_BLA_W_LP   = 16
	NAL_UNIT_CODED_SLICE_BLA_W_RADL = 17
	NAL_UNIT_CODED_SLICE_BLA_N_LP   = 18
	NAL_UNIT_CODED_SLICE_IDR_W_RADL = 19
	NAL_UNIT_CODED_SLICE_IDR_N_LP   = 20
	NAL_UNIT_CODED_SLICE_CRA        = 21
	NAL_UNIT_RESERVED_IRAP_VCL22    = 22
	NAL_UNIT_RESERVED_IRAP_VCL23    = 23
	NAL_UNIT_RESERVED_VCL24         = 24
	NAL_UNIT_RESERVED_VCL25         = 25
	NAL_UNIT_RESERVED_VCL26         = 26
	NAL_UNIT_RESERVED_VCL27         = 27
	NAL_UNIT_RESERVED_VCL28         = 28
	NAL_UNIT_RESERVED_VCL29         = 29
	NAL_UNIT_RESERVED_VCL30         = 30
	NAL_UNIT_RESERVED_VCL31         = 31
	NAL_UNIT_VPS                    = 32
	NAL_UNIT_SPS                    = 33
	NAL_UNIT_PPS                    = 34
	NAL_UNIT_ACCESS_UNIT_DELIMITER  = 35
	NAL_UNIT_EOS                    = 36
	NAL_UNIT_EOB                    = 37
	NAL_UNIT_FILLER_DATA            = 38
	NAL_UNIT_PREFIX_SEI             = 39
	NAL_UNIT_SUFFIX_SEI             = 40
	NAL_UNIT_RESERVED_NVCL41        = 41
	NAL_UNIT_RESERVED_NVCL42        = 42
	NAL_UNIT_RESERVED_NVCL43        = 43
	NAL_UNIT_RESERVED_NVCL44        = 44
	NAL_UNIT_RESERVED_NVCL45        = 45
	NAL_UNIT_RESERVED_NVCL46        = 46
	NAL_UNIT_RESERVED_NVCL47        = 47
	NAL_UNIT_UNSPECIFIED_48         = 48
	NAL_UNIT_UNSPECIFIED_49         = 49
	NAL_UNIT_UNSPECIFIED_50         = 50
	NAL_UNIT_UNSPECIFIED_51         = 51
	NAL_UNIT_UNSPECIFIED_52         = 52
	NAL_UNIT_UNSPECIFIED_53         = 53
	NAL_UNIT_UNSPECIFIED_54         = 54
	NAL_UNIT_UNSPECIFIED_55         = 55
	NAL_UNIT_UNSPECIFIED_56         = 56
	NAL_UNIT_UNSPECIFIED_57         = 57
	NAL_UNIT_UNSPECIFIED_58         = 58
	NAL_UNIT_UNSPECIFIED_59         = 59
	NAL_UNIT_UNSPECIFIED_60         = 60
	NAL_UNIT_UNSPECIFIED_61         = 61
	NAL_UNIT_UNSPECIFIED_62         = 62
	NAL_UNIT_UNSPECIFIED_63         = 63
	NAL_UNIT_INVALID                = 64
)
View Source
const (
	MAX_VPS_COUNT  = 16
	MAX_SUB_LAYERS = 7
	MAX_SPS_COUNT  = 32
)
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 (
	ErrorH265IncorectUnitSize = errors.New("Invorect Unit Size")
	ErrorH265IncorectUnitType = errors.New("Incorect Unit Type")
)
View Source
var AUDBytes = []byte{0, 0, 0, 1, 0x9, 0xf0, 0, 0, 0, 1} // AUD
View Source
var ErrDecconfInvalid = fmt.Errorf("h265parser: AVCDecoderConfRecord invalid")
View Source
var StartCodeBytes = []byte{0, 0, 1}

Functions

func CheckNALUsType

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

func IsDataNALU

func IsDataNALU(b []byte) bool

func SplitNALUs

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

Types

type AVCDecoderConfRecord

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

func (AVCDecoderConfRecord) Len

func (self AVCDecoderConfRecord) Len() (n int)

func (AVCDecoderConfRecord) Marshal

func (self AVCDecoderConfRecord) Marshal(b []byte, si SPSInfo) (n int)

func (*AVCDecoderConfRecord) Unmarshal

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

type CodecData

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

func NewCodecDataFromAVCDecoderConfRecord

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

func NewCodecDataFromVPSAndSPSAndPPS

func NewCodecDataFromVPSAndSPSAndPPS(vps, sps, pps []byte) (self CodecData, err error)

func (CodecData) AVCDecoderConfRecordBytes

func (self CodecData) AVCDecoderConfRecordBytes() []byte

func (CodecData) Bandwidth

func (self CodecData) Bandwidth() string

func (CodecData) FPS

func (self CodecData) FPS() int

func (CodecData) Height

func (self CodecData) Height() int

func (CodecData) PPS

func (self CodecData) PPS() []byte

func (CodecData) PacketDuration

func (self CodecData) PacketDuration(data []byte) time.Duration

func (CodecData) Resolution

func (self CodecData) Resolution() string

func (CodecData) SPS

func (self CodecData) SPS() []byte

func (CodecData) Tag

func (self CodecData) Tag() string

func (CodecData) Type

func (self CodecData) Type() av.CodecType

func (CodecData) VPS

func (self CodecData) VPS() []byte

func (CodecData) Width

func (self CodecData) Width() int

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

	PicWidthInLumaSamples  uint
	PicHeightInLumaSamples uint
	// contains filtered or unexported fields
}

func ParseSPS

func ParseSPS(sps []byte) (ctx SPSInfo, err error)

type SliceType

type SliceType uint

func ParseSliceHeaderFromNALU

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

func (SliceType) String

func (self SliceType) String() string

Jump to

Keyboard shortcuts

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