playoutav

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package playoutav adapts scheduled packets, frames, and events into a goav source provider. The module owns the playout vocabulary and pacing loop; the root goav module only sees a provider.Source passed to goav.Input.

Index

Constants

View Source
const FormatPlayout av.FormatID = "playout"

FormatPlayout names the scheduled playout framing in SourceShape. It is an open av.FormatID owned by this nested module, not by the root package.

Variables

View Source
var (
	// ErrNoStreams reports a playout input without any declared stream.
	ErrNoStreams = errors.New("playoutav: no streams")
	// ErrStreamIDRequired reports a declared stream or dynamic stream event
	// without a stream id.
	ErrStreamIDRequired = errors.New("playoutav: stream id required")
	// ErrInvalidMessage reports a schedule row that does not contain exactly
	// one packet, frame, or event.
	ErrInvalidMessage = errors.New("playoutav: message must contain exactly one packet, frame, or event")
	// ErrNegativeTime reports a schedule row before the start of the playout.
	ErrNegativeTime = errors.New("playoutav: schedule time must be non-negative")
	// ErrOutOfOrder reports a schedule whose times move backward.
	ErrOutOfOrder = errors.New("playoutav: schedule times must be non-decreasing")
	// ErrMixedDomains reports a schedule that mixes packet and frame media.
	ErrMixedDomains = errors.New("playoutav: schedule cannot mix packet and frame media")
	// ErrUnknownStream reports a packet, frame, or event for an undeclared
	// stream.
	ErrUnknownStream = errors.New("playoutav: message references unknown stream")
)

Functions

This section is empty.

Types

type Input

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

Input is a scheduled playout provider. It implements provider.Source without importing or changing any root goav internals.

func New

func New(streams []av.Stream, messages []Message, options ...Option) *Input

New builds a scheduled playout provider. Streams are declared up front; media messages may omit StreamID when there is exactly one declared stream.

func (*Input) Detail

func (in *Input) Detail() string

Detail returns the human-readable source detail.

func (*Input) Name

func (in *Input) Name() string

Name returns the source node name.

func (*Input) OpenSource

func (in *Input) OpenSource(context.Context) (pipeline.Source, []av.Stream, error)

OpenSource validates the schedule and returns a running pipeline source.

func (*Input) SourceShape

func (in *Input) SourceShape() shape.Spec

SourceShape reports the media shape the schedule produces.

type Message

type Message struct {
	At     time.Duration
	Packet *av.Packet
	Frame  *av.Frame
	Event  *av.Event
}

Message is one scheduled emission. Build values with Packet, Frame, or Event so playout owns a defensive copy of caller-provided media.

func Event

func Event(at time.Duration, event av.Event) Message

Event schedules an out-of-band event at offset at.

func Frame

func Frame(at time.Duration, frame *av.Frame) Message

Frame schedules a decoded frame at offset at.

func Packet

func Packet(at time.Duration, packet *av.Packet) Message

Packet schedules an encoded packet at offset at.

type Option

type Option func(*Input)

Option configures a playout Input.

func WithDetail

func WithDetail(detail string) Option

WithDetail overrides the source-node detail in Describe output.

func WithName

func WithName(name string) Option

WithName names the source node in Describe output.

func WithRealtime

func WithRealtime(realtime bool) Option

WithRealtime controls the Realtime fact reported by SourceShape. Scheduled playout defaults to realtime.

func WithSourceShape

func WithSourceShape(spec shape.Spec) Option

WithSourceShape pins the SourceShape reported before OpenSource. Leave this unset for the module to infer the shape from the first media stream.

Jump to

Keyboard shortcuts

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