ps

package
v0.0.0-...-3fc9a46 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPackStartCodeNotFound  = errors.New("pack start code not found")
	ErrProgramEndCodeNotFound = errors.New("program end code not found")
	ErrMarkerNotFound         = errors.New("marker not found")
)
View Source
var ErrUnexpectedStartCode = errors.New("unexpected start code")

ErrUnexpectedStartCode indicates that a start code was read from the bitstream that was unexpected.

Functions

func NewPackReader

func NewPackReader(r io.Reader) io.Reader

Types

type Decoder

type Decoder interface {
	Packs() <-chan *Pack
	Go() <-chan bool
	Err() error
}

func NewDecoder

func NewDecoder(r bitreader.BitReader) Decoder

type Pack

type Pack struct {
	*PackHeader
	// contains filtered or unexported fields
}

func (*Pack) Packets

func (p *Pack) Packets() pes.PacketChannel

type PackHeader

type PackHeader struct {
	SystemClockReferenceBase      uint32
	SystemClockReferenceExtension uint32
	ProgramMuxRate                uint32
	*SystemHeader
}

func NewPackHeader

func NewPackHeader(r bitreader.BitReader) (*PackHeader, error)

type StartCode

type StartCode uint32
const (
	StartCodePrefix = 0x000001

	PackStartCode         StartCode = (StartCodePrefix << 8) | 0xBA
	ProgramEndCode        StartCode = (StartCodePrefix << 8) | 0xB9
	SystemHeaderStartCode StartCode = (StartCodePrefix << 8) | 0xBB
)

func (StartCode) Assert

func (expected StartCode) Assert(br bitreader.BitReader) error

Assert() returns an ErrUnexpectedStartCode if the next bits in the bitstream do not match the expected code. If the expected code is present, the the bits are consumed from the bitstream.

func (StartCode) Check

func (expected StartCode) Check(br bitreader.BitReader) (bool, error)

Check() will return true if the next bits in the bitstream match the expected code. Check() does not consume any bits from the bitstream and will only return an error if there is a underlying error attempting to peek into the bitstream.

type SystemHeader

type SystemHeader struct {
	HeaderLength          uint32
	RateBound             uint32
	AudioBound            uint32
	Fixed                 bool
	CSPS                  bool
	SystemAudioLock       bool
	SystemVideoLock       bool
	VideoBound            uint32
	PacketRateRestriction bool
	Streams               []*SystemHeaderStream
}

type SystemHeaderStream

type SystemHeaderStream struct {
	StreamID               uint32
	P_STD_BufferBoundScale bool
	P_STD_BufferSizeBound  uint32
}

Jump to

Keyboard shortcuts

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