internal

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PacketSize = 188
	PtsWrap    = 1 << 33
	PcrWrap    = PtsWrap * 300
	TimeScale  = 90000
)

Variables

This section is empty.

Functions

func AddPTS added in v0.1.1

func AddPTS(p1, p2 int64) int64

func CalculateSteps added in v0.1.1

func CalculateSteps(timestamps []int64) []int64

func Execute added in v0.1.1

func Execute(w io.Writer, o Options, inFile string, function RunableFunc) error

func GetVersion

func GetVersion() string

GetVersion - get version and also commitHash and commitDate if inserted via Makefile

func ParseAll added in v0.2.0

func ParseAll(ctx context.Context, w io.Writer, f io.Reader, o Options) error

func ParseInfo added in v0.2.0

func ParseInfo(ctx context.Context, w io.Writer, f io.Reader, o Options) error

func SignedPTSDiff added in v0.1.1

func SignedPTSDiff(p2, p1 int64) int64

func ToSdtInfo added in v0.1.1

func ToSdtInfo(sdt *astits.SDTData) sdtInfo

func UnsignedPTSDiff added in v0.1.1

func UnsignedPTSDiff(p2, p1 int64) int64

Types

type AvcPS added in v0.2.0

type AvcPS struct {
	Statistics StreamStatistics
	// contains filtered or unexported fields
}

func ParseAVCPES added in v0.2.0

func ParseAVCPES(jp *JsonPrinter, d *astits.DemuxerData, ps *AvcPS, o Options) (*AvcPS, error)

type ElementaryStreamInfo added in v0.1.1

type ElementaryStreamInfo struct {
	PID   uint16 `json:"pid"`
	Codec string `json:"codec"`
	Type  string `json:"type"`
}

type HevcPS added in v0.2.0

type HevcPS struct {
	Statistics StreamStatistics
	// contains filtered or unexported fields
}

func ParseHEVCPES added in v0.2.0

func ParseHEVCPES(jp *JsonPrinter, d *astits.DemuxerData, ps *HevcPS, o Options) (*HevcPS, error)

type JsonPrinter added in v0.1.1

type JsonPrinter struct {
	W        io.Writer
	Indent   bool
	AccError error
}

func (*JsonPrinter) Error added in v0.1.1

func (p *JsonPrinter) Error() error

func (*JsonPrinter) Print added in v0.1.1

func (p *JsonPrinter) Print(data any, show bool)

func (*JsonPrinter) PrintPS added in v0.1.1

func (jp *JsonPrinter) PrintPS(pid uint16, psKind string, nr uint32, ps []byte, details any, verbose bool, show bool)

func (*JsonPrinter) PrintSdtInfo added in v0.1.1

func (p *JsonPrinter) PrintSdtInfo(sdt *astits.SDTData, show bool)

func (*JsonPrinter) PrintStatistics added in v0.1.1

func (p *JsonPrinter) PrintStatistics(s StreamStatistics, show bool)

type NaluData added in v0.1.1

type NaluData struct {
	Type string `json:"type"`
	Len  int    `json:"len"`
	Data any    `json:"data,omitempty"`
}

type NaluFrameData added in v0.1.1

type NaluFrameData struct {
	PID     uint16     `json:"pid"`
	RAI     bool       `json:"rai"`
	PTS     int64      `json:"pts"`
	DTS     int64      `json:"dts,omitempty"`
	ImgType string     `json:"imgType,omitempty"`
	NALUS   []NaluData `json:"nalus,omitempty"`
}

type OptionParseFunc added in v0.1.1

type OptionParseFunc func() Options

type Options added in v0.1.1

type Options struct {
	MaxNrPictures  int
	Version        bool
	Indent         bool
	ShowStreamInfo bool
	ShowService    bool
	ShowPS         bool
	VerbosePSInfo  bool
	ShowNALU       bool
	ShowSEIDetails bool
	ShowStatistics bool
}

func CreateFullOptions added in v0.1.1

func CreateFullOptions(max int) Options

func ParseParams added in v0.1.1

func ParseParams(function OptionParseFunc) (o Options, inFile string)

type PsInfo added in v0.1.1

type PsInfo struct {
	PID          uint16 `json:"pid"`
	ParameterSet string `json:"parameterSet"`
	Nr           uint32 `json:"nr"`
	Hex          string `json:"hex"`
	Length       int    `json:"length"`
	Details      any    `json:"details,omitempty"`
}

type RunableFunc added in v0.1.1

type RunableFunc func(ctx context.Context, w io.Writer, f io.Reader, o Options) error

type SeiOut added in v0.2.0

type SeiOut struct {
	Msg     string `json:"msg"`
	Payload any    `json:"payload,omitempty"`
}

type StreamStatistics added in v0.1.1

type StreamStatistics struct {
	Type       string  `json:"streamType"`
	Pid        uint16  `json:"pid"`
	FrameRate  float64 `json:"frameRate"`
	TimeStamps []int64 `json:"-"`
	MaxStep    int64   `json:"maxStep,omitempty"`
	MinStep    int64   `json:"minStep,omitempty"`
	AvgStep    int64   `json:"avgStep,omitempty"`
	// RAI-markers
	RAIPTS         []int64 `json:"-"`
	IDRPTS         []int64 `json:"-"`
	RAIGOPDuration int64   `json:"RAIGoPDuration,omitempty"`
	IDRGOPDuration int64   `json:"IDRGoPDuration,omitempty"`
	// Errors
	Errors []string `json:"errors,omitempty"`
}

Jump to

Keyboard shortcuts

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