pes

package
v2.2.1 Latest Latest
Warning

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

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

Documentation

Overview

Package pes contains interfaces and operations for packetized elementary stream headers.

Index

Constants

View Source
const (
	STREAM_ID_ALL_AUDIO_STREAMS           uint8 = 184
	STREAM_ID_ALL_VIDEO_STREAMS                 = 185
	STREAM_ID_PROGRAM_STREAM_MAP                = 188
	STREAM_ID_PRIVATE_STREAM_1                  = 189
	STREAM_ID_PADDNG_STREAM                     = 190
	STREAM_ID_PRIVATE_STREAM_2                  = 191
	STREAM_ID_ECM_STREAM                        = 240
	STREAM_ID_EMM_STREAM                        = 241
	STREAM_ID_DSM_CC_STREAM                     = 242
	STREAM_ID_ISO_IEC_13552_STREAM              = 243
	STREAM_ID_ITU_T_H222_1_TYPE_A               = 244
	STREAM_ID_ITU_T_H222_1_TYPE_B               = 245
	STREAM_ID_ITU_T_H222_1_TYPE_C               = 246
	STREAM_ID_ITU_T_H222_1_TYPE_D               = 247
	STREAM_ID_ITU_T_H222_1_TYPE_E               = 248
	STREAM_ID_ANCILLARY_STREAM                  = 249
	STREAM_ID_MPEG_4_SL_PACKETIZED_STREAM       = 250
	STREAM_ID_MPEG_4_FLEXMUX_STREAM             = 251
	STREAM_ID_METADATA_STREAM                   = 252
	STREAM_ID_EXTENDED_STREAM_ID                = 253
	STREAM_ID_RESERVED                          = 254
	STREAM_ID_PROGRAM_STREAM_DIRECTORY          = 255
)

stream_id possibilities

Variables

This section is empty.

Functions

func AlignedPUSI

func AlignedPUSI(pkt *packet.Packet) ([]byte, bool)

AlignedPUSI checks for a PUSI with aligned flag set and returns a bool indicating a match when true, as well as the bytes for the PES data

func CheckLength

func CheckLength(byteArray []byte, name string, min int) bool

CheckLength the length of the byte array to avoid index out of bound panics

func ExtractTime

func ExtractTime(bytes []byte) uint64

ExtractTime extracts a PTS time

Types

type PESHeader

type PESHeader interface {
	// HasPTS returns true if the header has a PTS time
	HasPTS() bool
	//PTS return the PTS time in the header
	PTS() uint64
	// HasDTS returns true if the header has a DTS time
	HasDTS() bool
	//DTS return the DTS time in the header
	DTS() uint64
	// Data returns the PES data
	Data() []byte
	// StreamId returns the stream id
	StreamId() uint8
	// DataAligned returns true if the data_alignment_indicator is set
	DataAligned() bool
	// PacketStartCodePrefix returns the packet_start_code_prefix. Note that this is a 24 bit value.
	PacketStartCodePrefix() uint32
}

PESHeader represents operations available on a packetized elementary stream header.

func NewPESHeader

func NewPESHeader(pesBytes []byte) (PESHeader, error)

NewPESHeader creates a new PES header with the provided bytes. pesBytes is the packet payload that contains the PES data

Jump to

Keyboard shortcuts

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