h265

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: MIT Imports: 6 Imported by: 1

README

H265

Payloader code taken from pion library branch h265. Because it's still not in release. Thanks to @kevmo314.

Documentation

Index

Constants

View Source
const (
	NALUTypePFrame    = 1
	NALUTypeIFrame    = 19
	NALUTypeIFrame2   = 20
	NALUTypeIFrame3   = 21
	NALUTypeVPS       = 32
	NALUTypeSPS       = 33
	NALUTypePPS       = 34
	NALUTypePrefixSEI = 39
	NALUTypeSuffixSEI = 40
	NALUTypeFU        = 49
)

Variables

This section is empty.

Functions

func DecodeStream added in v1.5.0

func DecodeStream(annexb []byte) ([]byte, int)

DecodeStream - find and return first AU in AVC format useful for processing live streams with unknown separator size

func GetParameterSet

func GetParameterSet(fmtp string) (vps, sps, pps []byte)

func IsKeyframe

func IsKeyframe(b []byte) bool

func NALUType

func NALUType(b []byte) byte

func RTPDepay

func RTPDepay(codec *core.Codec, handler core.HandlerFunc) core.HandlerFunc

func RTPPay added in v1.2.0

func RTPPay(mtu uint16, handler core.HandlerFunc) core.HandlerFunc

func SafariPay

func SafariPay(mtu uint16, handler core.HandlerFunc) core.HandlerFunc

SafariPay - generate Safari friendly payload for H265 https://github.com/AlexxIT/Blog/issues/5

func Types

func Types(data []byte) []byte

Types

type H265FragmentationUnitHeader added in v1.2.0

type H265FragmentationUnitHeader uint8

H265FragmentationUnitHeader is a H265 FU Header +---------------+ |0|1|2|3|4|5|6|7| +-+-+-+-+-+-+-+-+ |S|E| FuType | +---------------+

func (H265FragmentationUnitHeader) E added in v1.2.0

E represents the end of a fragmented NAL unit.

func (H265FragmentationUnitHeader) FuType added in v1.2.0

FuType MUST be equal to the field Type of the fragmented NAL unit.

func (H265FragmentationUnitHeader) S added in v1.2.0

S represents the start of a fragmented NAL unit.

type H265NALUHeader added in v1.2.0

type H265NALUHeader uint16

H265NALUHeader is a H265 NAL Unit Header https://datatracker.ietf.org/doc/html/rfc7798#section-1.1.4 +---------------+---------------+

|0|1|2|3|4|5|6|7|0|1|2|3|4|5|6|7|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|F|   Type    |  LayerID  | TID |
+-------------+-----------------+

func (H265NALUHeader) F added in v1.2.0

func (h H265NALUHeader) F() bool

F is the forbidden bit, should always be 0.

func (H265NALUHeader) IsAggregationPacket added in v1.2.0

func (h H265NALUHeader) IsAggregationPacket() bool

IsAggregationPacket returns whether or not the packet is an Aggregation packet.

func (H265NALUHeader) IsFragmentationUnit added in v1.2.0

func (h H265NALUHeader) IsFragmentationUnit() bool

IsFragmentationUnit returns whether or not the packet is a Fragmentation Unit packet.

func (H265NALUHeader) IsPACIPacket added in v1.2.0

func (h H265NALUHeader) IsPACIPacket() bool

IsPACIPacket returns whether or not the packet is a PACI packet.

func (H265NALUHeader) IsTypeVCLUnit added in v1.2.0

func (h H265NALUHeader) IsTypeVCLUnit() bool

IsTypeVCLUnit returns whether or not the NAL Unit type is a VCL NAL unit.

func (H265NALUHeader) LayerID added in v1.2.0

func (h H265NALUHeader) LayerID() uint8

LayerID should always be 0 in non-3D HEVC context.

func (H265NALUHeader) TID added in v1.2.0

func (h H265NALUHeader) TID() uint8

TID is the temporal identifier of the NAL unit +1.

func (H265NALUHeader) Type added in v1.2.0

func (h H265NALUHeader) Type() uint8

Type of NAL Unit.

type Payloader added in v1.2.0

type Payloader struct {
	AddDONL         bool
	SkipAggregation bool
	// contains filtered or unexported fields
}

Payloader payloads H265 packets

func (*Payloader) Payload added in v1.2.0

func (p *Payloader) Payload(mtu uint16, payload []byte) [][]byte

Payload fragments a H265 packet across one or more byte arrays

Jump to

Keyboard shortcuts

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