h264reader

package
v4.0.2 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package h264reader implements a H264 Annex-B Reader

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type H264Reader

type H264Reader struct {
	// contains filtered or unexported fields
}

H264Reader reads data from stream and constructs h264 nal units

func NewReader

func NewReader(in io.Reader) (*H264Reader, error)

NewReader creates new H264Reader

func (*H264Reader) NextNAL

func (reader *H264Reader) NextNAL() (*NAL, error)

NextNAL reads from stream and returns then next NAL, and an error if there is incomplete frame data. Returns all nil values when no more NALs are available.

type NAL

type NAL struct {
	PictureOrderCount uint32

	// NAL header
	ForbiddenZeroBit bool
	RefIdc           uint8
	UnitType         NalUnitType

	Data []byte // header byte + rbsp
}

NAL H.264 Network Abstraction Layer

type NalUnitType

type NalUnitType uint8

NalUnitType is the type of a NAL

const (
	NalUnitTypeUnspecified              NalUnitType = 0  // Unspecified
	NalUnitTypeCodedSliceNonIdr         NalUnitType = 1  // Coded slice of a non-IDR picture
	NalUnitTypeCodedSliceDataPartitionA NalUnitType = 2  // Coded slice data partition A
	NalUnitTypeCodedSliceDataPartitionB NalUnitType = 3  // Coded slice data partition B
	NalUnitTypeCodedSliceDataPartitionC NalUnitType = 4  // Coded slice data partition C
	NalUnitTypeCodedSliceIdr            NalUnitType = 5  // Coded slice of an IDR picture
	NalUnitTypeSEI                      NalUnitType = 6  // Supplemental enhancement information (SEI)
	NalUnitTypeSPS                      NalUnitType = 7  // Sequence parameter set
	NalUnitTypePPS                      NalUnitType = 8  // Picture parameter set
	NalUnitTypeAUD                      NalUnitType = 9  // Access unit delimiter
	NalUnitTypeEndOfSequence            NalUnitType = 10 // End of sequence
	NalUnitTypeEndOfStream              NalUnitType = 11 // End of stream
	NalUnitTypeFiller                   NalUnitType = 12 // Filler data
	NalUnitTypeSpsExt                   NalUnitType = 13 // Sequence parameter set extension
	NalUnitTypeCodedSliceAux            NalUnitType = 19 // Coded slice of an auxiliary coded picture without partitioning

)

Enums for NalUnitTypes

func (*NalUnitType) String

func (n *NalUnitType) String() string

Jump to

Keyboard shortcuts

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