manifest

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diagnose

func Diagnose(stream media.StreamInfo, capabilities []Capability) error

func IsNilCapability

func IsNilCapability(capability Capability) bool

func MatchesAny

func MatchesAny(capabilities []Capability, stream media.StreamInfo) bool

Types

type AudioConstraint

type AudioConstraint struct {
	Codecs        []media.CodecID
	SampleRates   IntConstraint
	Channels      IntConstraint
	Layouts       []media.ChannelLayout
	SampleFormats []SampleFormatConstraint
}

func (*AudioConstraint) Diagnose

func (c *AudioConstraint) Diagnose(stream media.StreamInfo) error

func (*AudioConstraint) Match

func (c *AudioConstraint) Match(stream media.StreamInfo) bool

type Capability

type Capability interface {
	Match(p media.StreamInfo) bool
	Diagnose(p media.StreamInfo) error
}

type IntConstraint

type IntConstraint struct {
	// A zero Min or Max leaves that bound unset.
	Values []int
	Min    int
	Max    int
}

func (IntConstraint) Candidates

func (c IntConstraint) Candidates(current int) []int

func (IntConstraint) Match

func (c IntConstraint) Match(value int) bool

func (IntConstraint) Preferred

func (c IntConstraint) Preferred(current int) int

func (IntConstraint) String

func (c IntConstraint) String() string

type NodeType

type NodeType string
const (
	RoleDemuxer NodeType = "demuxer"
	RoleMuxer   NodeType = "muxer"
	RoleDecoder NodeType = "decoder"
	RoleEncoder NodeType = "encoder"
	RoleFilter  NodeType = "filter"
	RoleUnknown NodeType = "unknown"
)

type ProbeScore

type ProbeScore int

ProbeScore represents the confidence level of format detection (0-100). Higher scores indicate stronger evidence of a format match.

const (
	// ProbeMismatch (0):
	// Negative evidence found. The data explicitly contradicts the format.
	ProbeMismatch ProbeScore = 0

	// ProbeExtensionOnly (10):
	// External hints only (e.g., file extension or MIME type).
	// Content is completely unverified. Used as a last-resort fallback.
	ProbeExtensionOnly ProbeScore = 10

	// ProbeGenericContainer (25):
	// Discovered a generic container header (e.g., "RIFF", "ISOBMFF" structure).
	// The exact internal format or codec remains unknown.
	ProbeGenericContainer ProbeScore = 25

	// ProbeSharedMetadata (40):
	// Discovered shared metadata blocks (e.g., ID3v2 tags).
	// High probability of being a media file, but the stream format is unconfirmed.
	ProbeSharedMetadata ProbeScore = 40

	// ProbeSingleSync (60):
	// Discovered a single occurrence of a sync pattern (e.g., MPEG-TS 0x47).
	// Could potentially be a coincidence within binary data.
	ProbeSingleSync ProbeScore = 60

	// ProbeMultipleSync (80):
	// Discovered multiple consecutive sync patterns at the expected intervals.
	// Statistically highly probable to be the correct format.
	ProbeMultipleSync ProbeScore = 80

	// ProbeIncompleteSignature (90):
	// The primary magic number matched perfectly, but the peek buffer was
	// too small to verify mandatory extended headers. Requires a larger buffer.
	ProbeIncompleteSignature ProbeScore = 90

	// ProbeExactSignature (100):
	// Perfect match of the unique format signature at the correct offset
	// (e.g., "ftypmp42", EBML header). Absolute certainty.
	ProbeExactSignature ProbeScore = 100
)

type Prober

type Prober func(r io.Reader) ProbeScore

type SampleFormatConstraint

type SampleFormatConstraint struct {
	Format        media.SampleFormat
	BitsPerSample IntConstraint
}

Jump to

Keyboard shortcuts

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