media

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultVideoLivenessTimeoutMS = 2000

	VideoPolicyWarn   = "warn"
	VideoPolicyReject = "reject"
)

Variables

This section is empty.

Functions

func CheckVideoEndpoint

func CheckVideoEndpoint(ctx context.Context, mediaURL string, cfg VideoGuidance) error

func CheckVideoMetadata

func CheckVideoMetadata(mimeType string, mediaURL string, cfg VideoGuidance) error

func IsVideoMIME

func IsVideoMIME(value string) bool

func NormalizePolicy

func NormalizePolicy(cfg *PolicyConfig)

func NormalizeVideoGuidance

func NormalizeVideoGuidance(cfg *VideoGuidance)

func ValidatePolicy

func ValidatePolicy(prefix string, cfg PolicyConfig) error

func ValidateVideoGuidance

func ValidateVideoGuidance(prefix string, cfg VideoGuidance) error

Types

type Metrics

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

func (*Metrics) NodeVideoLivenessCheck

func (m *Metrics) NodeVideoLivenessCheck()

func (*Metrics) NodeVideoLivenessFailure

func (m *Metrics) NodeVideoLivenessFailure()

func (*Metrics) VideoMetadataCheck

func (m *Metrics) VideoMetadataCheck()

func (*Metrics) VideoMetadataFailure

func (m *Metrics) VideoMetadataFailure()

func (*Metrics) WriteMetrics

func (m *Metrics) WriteMetrics(w io.Writer)

type PolicyConfig

type PolicyConfig struct {
	Video VideoMetadataPolicy `yaml:"video"`
}

type VideoGuidance

type VideoGuidance struct {
	LivenessCheckEnabled bool     `yaml:"liveness_check_enabled"`
	LivenessTimeoutMS    int      `yaml:"liveness_timeout_ms"`
	ExpectedTransport    string   `yaml:"expected_transport"`
	ExpectedCodec        string   `yaml:"expected_codec"`
	ExpectedContainer    string   `yaml:"expected_container"`
	ExpectedWidth        int      `yaml:"expected_width"`
	ExpectedHeight       int      `yaml:"expected_height"`
	ExpectedFrameRateFPS int      `yaml:"expected_frame_rate_fps"`
	BitrateMinBPS        int64    `yaml:"bitrate_min_bps"`
	BitrateMaxBPS        int64    `yaml:"bitrate_max_bps"`
	RequireProgressive   bool     `yaml:"require_progressive"`
	AllowedSchemes       []string `yaml:"allowed_schemes"`
	AllowedMIMETypes     []string `yaml:"allowed_mime_types"`
}

func DefaultVideoGuidance

func DefaultVideoGuidance() VideoGuidance

type VideoMetadataPolicy

type VideoMetadataPolicy struct {
	Enabled       bool   `yaml:"enabled"`
	Enforcement   string `yaml:"enforcement"`
	VideoGuidance `yaml:",inline"`
}

func DefaultVideoPolicy

func DefaultVideoPolicy() VideoMetadataPolicy

func (VideoMetadataPolicy) CheckMessage

func (p VideoMetadataPolicy) CheckMessage(msg *sapientv2.SapientMessage, metrics *Metrics) []Violation

type Violation

type Violation struct {
	Path   string
	Reason string
}

Jump to

Keyboard shortcuts

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