rtph264

package
v0.0.0-...-b7e0f59 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package rtph264 contains a RTP/H264 decoder and encoder.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

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

Decoder is a RTP/H264 decoder.

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

NewDecoder creates a decoder around a Reader.

func NewDecoderFromPacketConn

func NewDecoderFromPacketConn(pc net.PacketConn) *Decoder

NewDecoderFromPacketConn creates a decoder around a net.PacketConn.

func (*Decoder) Read

func (d *Decoder) Read() (rtp.Header, [][]byte, error)

Read decodes NALUs from RTP/H264 packets.

func (*Decoder) ReadSPSPPS

func (d *Decoder) ReadSPSPPS() ([]byte, []byte, error)

ReadSPSPPS decodes NALUs until SPS and PPS are found.

type Encoder

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

Encoder is a RTP/H264 encoder.

func NewEncoder

func NewEncoder(payloadType uint8) (*Encoder, error)

NewEncoder allocates an Encoder.

func (*Encoder) Write

func (e *Encoder) Write(ts time.Duration, nalus [][]byte) ([][]byte, error)

Write encodes NALUs into RTP/H264 packets.

type NALUType

type NALUType uint8

NALUType is the type of a NALU.

const (
	NALUTypeNonIDR                        NALUType = 1
	NALUTypeDataPartitionA                NALUType = 2
	NALUTypeDataPartitionB                NALUType = 3
	NALUTypeDataPartitionC                NALUType = 4
	NALUTypeIDR                           NALUType = 5
	NALUTypeSei                           NALUType = 6
	NALUTypeSPS                           NALUType = 7
	NALUTypePPS                           NALUType = 8
	NALUTypeAccessUnitDelimiter           NALUType = 9
	NALUTypeEndOfSequence                 NALUType = 10
	NALUTypeEndOfStream                   NALUType = 11
	NALUTypeFillerData                    NALUType = 12
	NALUTypeSPSExtension                  NALUType = 13
	NALUTypePrefix                        NALUType = 14
	NALUTypeSubsetSPS                     NALUType = 15
	NALUTypeReserved16                    NALUType = 16
	NALUTypeReserved17                    NALUType = 17
	NALUTypeReserved18                    NALUType = 18
	NALUTypeSliceLayerWithoutPartitioning NALUType = 19
	NALUTypeSliceExtension                NALUType = 20
	NALUTypeSliceExtensionDepth           NALUType = 21
	NALUTypeReserved22                    NALUType = 22
	NALUTypeReserved23                    NALUType = 23
	NALUTypeStapA                         NALUType = 24
	NALUTypeStapB                         NALUType = 25
	NALUTypeMtap16                        NALUType = 26
	NALUTypeMtap24                        NALUType = 27
	NALUTypeFuA                           NALUType = 28
	NALUTypeFuB                           NALUType = 29
)

standard NALU types.

Jump to

Keyboard shortcuts

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