Documentation
¶
Overview ¶
Package control defines the in-process live task control vocabulary; for exposing those controls over a socket, see package ctlserver.
Index ¶
- Variables
- type Control
- func Deliver(event av.Event) Control
- func Keyframe(stream av.StreamID) Control
- func Must(ctrl Control, err error) Control
- func Rate(r float64) (Control, error)
- func Seek(pos time.Duration) Control
- func Segment(start, end time.Duration) (Control, error)
- func SelectActive(id av.StreamID) Control
- func SetBitrate(stream av.StreamID, bitsPerSecond int) (Control, error)
- func (c Control) At(node pipeline.NodeRef) Control
- func (c Control) AtTap(name string) Control
- func (c Control) Bitrate() int
- func (c Control) End() time.Duration
- func (c Control) Event() av.Event
- func (c Control) Message() (*pipeline.Message, error)
- func (c Control) Node() pipeline.NodeRef
- func (c Control) Position() time.Duration
- func (c Control) Rate() float64
- func (c Control) Reason() string
- func (c Control) StreamID() av.StreamID
- func (c Control) Tap() string
- func (c Control) TargetsSources() bool
- func (c Control) Type() Type
- func (c Control) WithReason(reason string) Control
- type Type
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUnsupported is returned when a task graph cannot inject controls. ErrUnsupported = errors.New("goav: task does not support live control") // ErrNotRunning is returned when the task is not running. ErrNotRunning = errors.New("goav: task is not running") // ErrNil is returned when a control carries no payload. ErrNil = errors.New("goav: nil control") // ErrInvalid is returned when a control constructor receives an invalid payload. ErrInvalid = errors.New("goav: invalid control") // ErrAmbiguousTarget is returned when a control does not name exactly one // target and the task cannot infer one safely. ErrAmbiguousTarget = errors.New("goav: control target is ambiguous") )
Functions ¶
This section is empty.
Types ¶
type Control ¶
type Control struct {
// contains filtered or unexported fields
}
Control is an out-of-band request injected into a running task's graph.
func Must ¶
Must unwraps a control constructor in tests and static configurations. It panics if err is non-nil; production code should handle the error instead.
func Rate ¶
Rate builds a control that changes the task-wide playback rate. Rate is not targeted: it re-anchors the task's shared timeline so every paced consumer — clock-aware sources and playout gates — changes pace together. Tasks with nothing paced to scale refuse it.
func SelectActive ¶
SelectActive switches a running Select to forward the arm identified by id.
func SetBitrate ¶
SetBitrate builds a control that retargets live encoders to bitsPerSecond.
func (Control) TargetsSources ¶
TargetsSources reports whether the control is delivered through source Control methods instead of node queues. Rate is neither: it is task-wide and applies to the task timeline without touching the graph.
func (Control) WithReason ¶
WithReason returns a copy of the control carrying human context.
type Type ¶
type Type string
Type classifies an out-of-band control delivered to a running node.
const ( // KeyframeType asks the target node to produce a keyframe. KeyframeType Type = "keyframe" // BitrateType asks encoders on the control's path to retarget bitrate live. BitrateType Type = "bitrate" // SelectType switches a live Select to the input named by StreamID. SelectType Type = "select" // EventType delivers a caller-supplied av.Event verbatim to the target node. EventType Type = "event" // SeekType asks task sources to reposition. SeekType Type = "seek" // RateType changes the task-wide playback rate: it scales the task's // shared timeline, which every paced source sleeps on, so it takes no // node or tap target. RateType Type = "rate" // SegmentType asks task sources to play one [start, end) window. SegmentType Type = "segment" )