Documentation
¶
Index ¶
- Constants
- func Build(ctx context.Context, inputs InputSet, output io.Writer, spec Spec, ...) (*pipeline.Pipeline, error)
- func Negotiate(ctx context.Context, inputs InputSet, output io.Writer, spec Spec) (*pipeline.Geometry, error)
- func NewError(code Code, message string) error
- type AuxInputSpec
- type Code
- type Error
- type FilterSpec
- type InputSet
- type Job
- type NodeStatus
- type PluginSpec
- type PortRef
- type Progress
- type Resolved
- type Spec
- type Status
Constants ¶
const MainInputAlias = routing.MainInputAlias
MainInputAlias is the reserved source alias for the main input's decoded stream (see routing.MainInputAlias).
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuxInputSpec ¶
type AuxInputSpec struct {
Demuxer *PluginSpec `json:"demuxer,omitempty"`
Decoder *PluginSpec `json:"decoder,omitempty"`
}
AuxInputSpec is a named additional source, demuxed and decoded like the main input. It has no filter chain of its own — any processing on the way to a consumer is just an ordinary FilterSpec wired from this alias.
type Code ¶
type Code string
const ( CodeInvalidSpec Code = "invalid_spec" CodeUnsupportedCodec Code = "unsupported_codec" CodeNegotiationFailed Code = "negotiation_failed" CodeBuildFailed Code = "build_failed" CodePipelineFailed Code = "pipeline_failed" CodeCanceled Code = "canceled" CodeNotFound Code = "not_found" CodeNotReady Code = "not_ready" CodePayloadTooLarge Code = "payload_too_large" CodeInternal Code = "internal" )
type Error ¶
type FilterSpec ¶
type InputSet ¶
type InputSet struct {
Main io.ReadSeeker
Aux map[string]io.ReadSeeker
}
type Job ¶
type Job struct {
// contains filtered or unexported fields
}
Job runs a negotiated conversion in the background and tracks its outcome so progress can be polled independently of the goroutine driving Run. It is the shared state machine behind both the HTTP job store (example/web) and the WASM bindings: only how input/output are wired up and how job IDs are exposed differs between them.
func StartJob ¶
StartJob negotiates, builds, and runs a conversion in the background. The returned Job stays valid until Close is called; Snapshot and Cancel are safe to call concurrently with the running conversion.
func (*Job) Cancel ¶
func (j *Job) Cancel()
Cancel requests that the job stop. It does not wait for the pipeline to finish; use Done or Close for that.
func (*Job) Close ¶
Close cancels the job if still running, waits for it to finish, and releases pipeline resources. Safe to call multiple times.
func (*Job) Description ¶
func (j *Job) Description() pipeline.Description
func (*Job) Done ¶
func (j *Job) Done() <-chan struct{}
Done is closed once the job's goroutine has finished, after which Snapshot and Err reflect the final outcome.
type NodeStatus ¶
type PluginSpec ¶
type PortRef ¶
PortRef names one port of one graph node: a filter alias, an auxiliary input name, or MainInputAlias. An empty Port defaults to "out".
type Progress ¶
type Progress struct {
Status Status `json:"status,omitempty"` // set by Job.Snapshot; empty when Snapshot is called directly
Error string `json:"error,omitempty"` // set by Job.Snapshot when Status is failed
Percent float64 `json:"percent"` // -1 when duration is unknown
ProcessedMs int64 `json:"processedMs"`
TotalMs int64 `json:"totalMs"`
ProcessedItems uint64 `json:"processedItems"`
SpeedRatio float64 `json:"speedRatio"` // processed media time per wall-clock second
ElapsedMs int64 `json:"elapsedMs"`
EtaMs int64 `json:"etaMs"`
Nodes []NodeStatus `json:"nodes"`
}
func Snapshot ¶
Snapshot summarizes a pipeline.Snapshot for progress reporting. Elapsed time is taken from snapshot.Elapsed (wall-clock time since Pipeline.Run started). Set final to true once the conversion has finished (successfully or not) so the reported percent/duration reflect completion rather than the last observed media time.
type Resolved ¶
type Resolved struct {
Demuxer registry.DemuxerManifest
DemuxConfig registry.Configuration
Decoder registry.DecoderManifest
DecodeConfig registry.Configuration
Filters []routing.FilterSpec
AuxInputs map[string]resolvedAuxInput
Sink *routing.PortRef
Encoder registry.EncoderManifest
EncodeConfig registry.Configuration
Muxer registry.MuxerManifest
MuxConfig registry.Configuration
Codec media.CodecID
Resources registry.ResourceBudget
}
type Spec ¶
type Spec struct {
Demuxer *PluginSpec `json:"demuxer,omitempty"`
Decoder *PluginSpec `json:"decoder,omitempty"`
Filters []FilterSpec `json:"filters,omitempty"`
AuxInputs map[string]AuxInputSpec `json:"auxInputs,omitempty"`
// Sink names the port that feeds the encoder. nil resolves to the
// default: the last filter's "out" port, or (with no filters) the main
// input directly.
Sink *PortRef `json:"sink,omitempty"`
Codec string `json:"codec,omitempty"`
Encoder *PluginSpec `json:"encoder,omitempty"`
Muxer PluginSpec `json:"muxer"`
Parallelism int `json:"parallelism,omitempty"`
}