Documentation
¶
Overview ¶
Package plan holds the structured Explain tree: the report a job or task returns about what it will do, which adapters it needs, and the decisions and diagnostics behind the plan. The recipe grammar (Stream, Mix, Composite, Select, To, Task.Control, constructors, options) lives in the goav root; everything Explain reports back lives here.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdapterRequirement ¶
type AdapterRequirement struct {
Kind string `json:"kind,omitempty"`
Name string `json:"name,omitempty"`
Format av.FormatID `json:"format,omitempty"`
Codec av.CodecID `json:"codec,omitempty"`
Media []av.MediaType `json:"media,omitempty"`
Codecs []av.CodecID `json:"codecs,omitempty"`
MinStreams int `json:"minStreams,omitempty"`
MaxStreams int `json:"maxStreams,omitempty"`
Transform string `json:"transform,omitempty"`
Input av.MediaType `json:"input,omitempty"`
Output av.MediaType `json:"output,omitempty"`
PixelFormats []string `json:"pixelFormats,omitempty"`
SampleFormats []string `json:"sampleFormats,omitempty"`
ResizeModes []filter.ResizeMode `json:"resizeModes,omitempty"`
Realtime bool `json:"realtime,omitempty"`
Stateless bool `json:"stateless,omitempty"`
Metadata av.Metadata `json:"metadata,omitempty"`
RequiredBy string `json:"requiredBy,omitempty"`
Status string `json:"status,omitempty"`
// Backend names the backend chosen to serve a codec requirement, with its
// kind ("videotoolbox (hardware)"); BackendReason says why it was chosen,
// and Alternatives lists the other backends that would serve it, in
// preference order.
Backend string `json:"backend,omitempty"`
BackendReason string `json:"backendReason,omitempty"`
Alternatives []string `json:"alternatives,omitempty"`
// Knobs lists the settings the chosen backend takes, one summary each
// ("rc=cbr|vbr (default vbr): rate control").
Knobs []string `json:"knobs,omitempty"`
// Notice is the attribution the chosen backend's license asks to be
// shown ("OpenH264 Video Codec provided by Cisco Systems, Inc.").
Notice string `json:"notice,omitempty"`
}
AdapterRequirement reports one adapter (demuxer, muxer, codec, filter) the plan needs, with the capability metadata known about it.
type Branch ¶
type Branch struct {
Name string `json:"name,omitempty"`
Input string `json:"input,omitempty"`
Stream StreamSelect `json:"stream,omitzero"`
Shape shape.Spec `json:"shape,omitzero"`
Operations []Operation `json:"operations,omitempty"`
Destinations []string `json:"destinations,omitempty"`
}
Branch reports one planned branch: its source binding, media shape, and ordered operations.
type Decision ¶
type Decision struct {
Code string `json:"code,omitempty"`
Branch string `json:"branch,omitempty"`
Message string `json:"message,omitempty"`
}
Decision records one planning decision and the branch it applies to.
type Destination ¶
type Destination struct {
Name string `json:"name,omitempty"`
URI string `json:"uri,omitempty"`
Protocol av.ProtocolID `json:"protocol,omitempty"`
MIMEType string `json:"mimeType,omitempty"`
Format av.FormatID `json:"format,omitempty"`
Kind string `json:"kind,omitempty"`
Branches []string `json:"branches,omitempty"`
}
Destination reports one planned destination and the branches feeding it.
type Diagnostic ¶
type Diagnostic struct {
Code string `json:"code,omitempty"`
Node string `json:"node,omitempty"`
Message string `json:"message,omitempty"`
Details []string `json:"details,omitempty"`
Suggestions []string `json:"suggestions,omitempty"`
}
Diagnostic is one structured warning attached to a plan.
type Input ¶
type Input struct {
Name string `json:"name,omitempty"`
URI string `json:"uri,omitempty"`
Protocol av.ProtocolID `json:"protocol,omitempty"`
MIMEType string `json:"mimeType,omitempty"`
Realtime bool `json:"realtime,omitempty"`
Format av.FormatID `json:"format,omitempty"`
Codec av.CodecID `json:"codec,omitempty"`
Streams []av.Stream `json:"streams,omitempty"`
}
Input reports one job input: where it comes from and what it carries.
type Operation ¶
type Operation struct {
Kind OperationKind `json:"kind,omitempty"`
Component string `json:"component,omitempty"`
Detail string `json:"detail,omitempty"`
Shape shape.Spec `json:"shape,omitzero"`
Adapter string `json:"adapter,omitempty"`
Config map[string]string `json:"config,omitempty"`
}
Operation reports one planned operation row inside a stream or branch. Kind, Component, Shape, Adapter, and Config are the typed machine surface; Detail is the display fallback. Shape carries media kind, codec, format, and geometry; Adapter names the implementation the operation lowers to (a codec id, filter factory, or component name); Config carries small typed settings such as bitrate or geometry as stable key/value strings.
type OperationKind ¶
type OperationKind string
OperationKind names one kind of planned operation in a task's media plan. It is the shared vocabulary between plan reports, snapshots, and tap anchors.
const ( // OpProbe is input content detection (format and stream discovery). OpProbe OperationKind = "probe" // OpDemux reads packets out of a container input. OpDemux OperationKind = "demux" // OpDepacketize reassembles transport payloads (RTP) into codec packets. OpDepacketize OperationKind = "depacketize" // OpSelect narrows the input to one matched stream. OpSelect OperationKind = "select" // OpDecode turns packets into frames. OpDecode OperationKind = "decode" // OpShape is a shape annotation or solver directive (.Shape, .Auto, // .Require, .Prefer); it lowers to no runtime node. OpShape OperationKind = "shape" // OpTransform is a frame conversion (resize, resample, format convert). OpTransform OperationKind = "transform" // OpStage is a custom caller-provided stage (.Do). OpStage OperationKind = "stage" // OpJoin is the planned N-to-1 convergence node (Mix/Composite/Select): N // arm chains feed one join operation and the downstream chain hangs off it // like any other stream point. OpJoin OperationKind = "join" // OpEncode turns frames into packets. OpEncode OperationKind = "encode" // OpCopy forwards packets unchanged (packet-preserving passthrough). OpCopy OperationKind = "copy" // OpMux writes packets into a container output. OpMux OperationKind = "mux" // OpWrite delivers muxed bytes to a byte destination. OpWrite OperationKind = "write" // OpSink delivers media messages to a sink destination. OpSink OperationKind = "sink" // OpTap is a named attach point for runtime branches. OpTap OperationKind = "tap" )
type Report ¶
type Report struct {
Summary string `json:"summary,omitempty"`
Operation string `json:"operation,omitempty"`
Inputs []Input `json:"inputs,omitempty"`
Streams []Stream `json:"streams,omitempty"`
Taps []Tap `json:"taps,omitempty"`
Branches []Branch `json:"branches,omitempty"`
Destinations []Destination `json:"destinations,omitempty"`
Decisions []Decision `json:"decisions,omitempty"`
Missing []Requirement `json:"missing,omitempty"`
RequiredAdapters []AdapterRequirement `json:"requiredAdapters,omitempty"`
Warnings []Diagnostic `json:"warnings,omitempty"`
Graph pipeline.Spec `json:"graph"`
}
Report is the structured report Explain returns: what the job will do, which adapters it needs, and the decisions and diagnostics behind the plan. Every field is typed; Report and its members marshal to stable JSON so machine consumers can read the plan directly. Detail strings are a display fallback, never the machine surface.
type Requirement ¶
type Requirement struct {
Kind string `json:"kind,omitempty"`
Name string `json:"name,omitempty"`
RequiredBy string `json:"requiredBy,omitempty"`
Status string `json:"status,omitempty"`
}
Requirement reports one unmet prerequisite that blocks the plan.
type Stream ¶
type Stream struct {
Name string `json:"name,omitempty"`
Select StreamSelect `json:"select,omitzero"`
Decode bool `json:"decode,omitempty"`
Operations []Operation `json:"operations,omitempty"`
Encode codec.Spec `json:"encode,omitzero"`
Destinations []string `json:"destinations,omitempty"`
}
Stream reports one declared stream chain: its selection, decode intent, ordered operations, encode target, and destination bindings.
type StreamSelect ¶
type StreamSelect struct {
ID av.StreamID `json:"id,omitempty"`
Index int `json:"index,omitempty"`
UseIndex bool `json:"useIndex,omitempty"`
Type av.MediaType `json:"type,omitempty"`
Codec av.CodecID `json:"codec,omitempty"`
Name string `json:"name,omitempty"`
// Input narrows the selection to the named recipe input: the input a
// Stream was selected from (mic.Audio()).
Input string `json:"input,omitempty"`
}
StreamSelect reports how a stream chain selects its source stream.
type Tap ¶
type Tap struct {
Name string `json:"name,omitempty"`
MediaKind av.MediaType `json:"mediaKind,omitempty"`
Domain shape.MediaDomain `json:"domain,omitempty"`
Shape shape.Spec `json:"shape,omitzero"`
Node pipeline.NodeRef `json:"node,omitempty"`
}
Tap reports one named media outlet the plan declares for runtime branches.