Documentation
¶
Index ¶
- Variables
- func ResolveConfig[T any, C Wrapper[T]](cfg registry.Configuration) (T, error)
- func WrapDecoder(engine DecoderEngine) node.Decoder
- func WrapDemuxer(engine DemuxerEngine) node.Demuxer
- func WrapEncoder(engine EncoderEngine) node.Encoder
- func WrapFilter(engine FilterEngine, options ...FilterOption) node.Filter
- func WrapMuxer(engine MuxerEngine) node.Muxer
- type AuxInputEngine
- type DecoderAdapter
- func (n *DecoderAdapter) Close() error
- func (n *DecoderAdapter) InputPorts() map[string]*node.InPort[*media.Packet]
- func (n *DecoderAdapter) OutputPorts() map[string]*node.OutPort[media.Frame]
- func (n *DecoderAdapter) Prepare(resources registry.ResourceGrant) error
- func (n *DecoderAdapter) Start(ctx context.Context) error
- type DecoderEngine
- type DemuxerAdapter
- func (n *DemuxerAdapter) Close() error
- func (n *DemuxerAdapter) Metadata() *metadata.Bundle
- func (n *DemuxerAdapter) OutputPorts() map[string]*node.OutPort[*media.Packet]
- func (n *DemuxerAdapter) Prepare(resources registry.ResourceGrant) error
- func (n *DemuxerAdapter) Start(ctx context.Context) error
- func (n *DemuxerAdapter) Streams() ([]media.StreamInfo, error)
- type DemuxerEngine
- type EncoderAdapter
- func (n *EncoderAdapter) Close() error
- func (n *EncoderAdapter) InputPorts() map[string]*node.InPort[media.Frame]
- func (n *EncoderAdapter) OutputPorts() map[string]*node.OutPort[*media.Packet]
- func (n *EncoderAdapter) Prepare(resources registry.ResourceGrant) error
- func (n *EncoderAdapter) Start(ctx context.Context) error
- type EncoderEngine
- type FilterAdapter
- func (n *FilterAdapter) Close() error
- func (n *FilterAdapter) InputPhases() map[string]node.InputPhase
- func (n *FilterAdapter) InputPorts() map[string]*node.InPort[media.Frame]
- func (n *FilterAdapter) OutputPorts() map[string]*node.OutPort[media.Frame]
- func (n *FilterAdapter) Preload(ctx context.Context) error
- func (n *FilterAdapter) Prepare(resources registry.ResourceGrant) error
- func (n *FilterAdapter) Process(ctx context.Context) error
- func (n *FilterAdapter) Start(ctx context.Context) error
- type FilterEngine
- type FilterInput
- type FilterOption
- type MultiOutputEngine
- type MuxerAdapter
- func (n *MuxerAdapter) AddStream(info media.StreamInfo) (int, error)
- func (n *MuxerAdapter) Close() error
- func (n *MuxerAdapter) InputPorts() map[string]*node.InPort[*media.Packet]
- func (n *MuxerAdapter) SetMetadata(meta *metadata.Bundle) error
- func (n *MuxerAdapter) Start(ctx context.Context) error
- type MuxerEngine
- type SeekableDemuxerAdapter
- type SeekerEngine
- type Validateable
- type Wrapper
Constants ¶
This section is empty.
Variables ¶
var ( ErrEAGAIN = errors.New("resource temporarily unavailable (need more data)") ErrEOF = errors.New("end of file or stream") )
Functions ¶
func ResolveConfig ¶
func ResolveConfig[T any, C Wrapper[T]](cfg registry.Configuration) (T, error)
ResolveConfig resolves a configuration from the registry. It accepts either a value type T or a pointer type *T.
func WrapDecoder ¶
func WrapDecoder(engine DecoderEngine) node.Decoder
func WrapDemuxer ¶
func WrapDemuxer(engine DemuxerEngine) node.Demuxer
func WrapEncoder ¶
func WrapEncoder(engine EncoderEngine) node.Encoder
func WrapFilter ¶
func WrapFilter(engine FilterEngine, options ...FilterOption) node.Filter
WrapFilter adapts engine to node.Filter. With no options it exposes the conventional single "in" (run-phase) input port and single "out" output port, using only SendFrame/ReceiveFrame/Flush.
func WrapMuxer ¶
func WrapMuxer(engine MuxerEngine) node.Muxer
Types ¶
type AuxInputEngine ¶
type AuxInputEngine interface {
SendInput(port string, frame *media.Frame) error
EndInput(port string) error
}
AuxInputEngine is an optional FilterEngine capability, detected via type assertion, needed only when a filter declares more than one run-phase input port and/or any preload input port. SendInput receives a frame for a named port; EndInput marks that port's EOF. The adapter retains and releases frames around both calls.
type DecoderAdapter ¶
type DecoderAdapter struct {
// contains filtered or unexported fields
}
func (*DecoderAdapter) Close ¶
func (n *DecoderAdapter) Close() error
func (*DecoderAdapter) InputPorts ¶
func (*DecoderAdapter) OutputPorts ¶
func (*DecoderAdapter) Prepare ¶
func (n *DecoderAdapter) Prepare(resources registry.ResourceGrant) error
type DecoderEngine ¶
type DemuxerAdapter ¶
type DemuxerAdapter struct {
// contains filtered or unexported fields
}
func (*DemuxerAdapter) Close ¶
func (n *DemuxerAdapter) Close() error
func (*DemuxerAdapter) Metadata ¶
func (n *DemuxerAdapter) Metadata() *metadata.Bundle
func (*DemuxerAdapter) OutputPorts ¶
func (*DemuxerAdapter) Prepare ¶
func (n *DemuxerAdapter) Prepare(resources registry.ResourceGrant) error
func (*DemuxerAdapter) Streams ¶
func (n *DemuxerAdapter) Streams() ([]media.StreamInfo, error)
type DemuxerEngine ¶
type EncoderAdapter ¶
type EncoderAdapter struct {
// contains filtered or unexported fields
}
func (*EncoderAdapter) Close ¶
func (n *EncoderAdapter) Close() error
func (*EncoderAdapter) InputPorts ¶
func (*EncoderAdapter) OutputPorts ¶
func (*EncoderAdapter) Prepare ¶
func (n *EncoderAdapter) Prepare(resources registry.ResourceGrant) error
type EncoderEngine ¶
type FilterAdapter ¶
type FilterAdapter struct {
// contains filtered or unexported fields
}
FilterAdapter adapts a FilterEngine to node.Filter. A single run-phase input and a single output is the smallest possible topology and needs nothing beyond FilterEngine itself; more of either is a difference in degree, not in kind, and is handled by the same adapter type using the optional AuxInputEngine/MultiOutputEngine capabilities.
func (*FilterAdapter) Close ¶
func (n *FilterAdapter) Close() error
func (*FilterAdapter) InputPhases ¶
func (n *FilterAdapter) InputPhases() map[string]node.InputPhase
func (*FilterAdapter) InputPorts ¶
func (*FilterAdapter) OutputPorts ¶
func (*FilterAdapter) Preload ¶
func (n *FilterAdapter) Preload(ctx context.Context) error
Preload drains every declared preload-phase port to EOF, before Start (and thus the rest of the pipeline's run) ever begins.
func (*FilterAdapter) Prepare ¶
func (n *FilterAdapter) Prepare(resources registry.ResourceGrant) error
type FilterEngine ¶
type FilterEngine interface {
SendFrame(frame *media.Frame) error
ReceiveFrame() (media.Frame, error)
Flush() error
}
FilterEngine is the only interface a filter engine must implement. Exactly one run-phase input port and one output port need nothing more than this; declaring additional ports (see FilterInput, WithInputs, WithOutputs) requires the engine to also implement AuxInputEngine and/or MultiOutputEngine below. Those are optional, type-asserted capabilities, not part of this base contract, so a plain single-port engine never needs to know about them.
type FilterInput ¶
type FilterInput struct {
ID string
Phase node.InputPhase
}
FilterInput names one input port and declares when it is consumed: Run ports are pulled during the pipeline's normal run; Preload ports are drained to completion before the run begins (see node.StagedInput).
type FilterOption ¶
type FilterOption func(*filterOptions)
FilterOption configures WrapFilter's port topology. Callers that need only the conventional single "in"/"out" ports pass no options.
func WithInputs ¶
func WithInputs(inputs ...FilterInput) FilterOption
WithInputs declares this filter's input ports, replacing the default single run-phase "in" port. Declaring more than one run-phase port, or any preload port, requires the engine to also implement AuxInputEngine.
func WithOutputs ¶
func WithOutputs(outputs ...string) FilterOption
WithOutputs names this filter's output ports, replacing the default single "out" port. Declaring more than one requires the engine to also implement MultiOutputEngine.
type MultiOutputEngine ¶
MultiOutputEngine is an optional FilterEngine capability, detected via type assertion, needed only when a filter declares more than one output port. ReceiveOutput behaves like ReceiveFrame but also names which output port the frame belongs to.
type MuxerAdapter ¶
type MuxerAdapter struct {
// contains filtered or unexported fields
}
func (*MuxerAdapter) AddStream ¶
func (n *MuxerAdapter) AddStream(info media.StreamInfo) (int, error)
func (*MuxerAdapter) Close ¶
func (n *MuxerAdapter) Close() error
func (*MuxerAdapter) InputPorts ¶
func (*MuxerAdapter) SetMetadata ¶
func (n *MuxerAdapter) SetMetadata(meta *metadata.Bundle) error
type MuxerEngine ¶
type SeekableDemuxerAdapter ¶
type SeekableDemuxerAdapter struct {
*DemuxerAdapter
// contains filtered or unexported fields
}
type SeekerEngine ¶
type Validateable ¶
type Validateable interface {
Validate() error
}
type Wrapper ¶
type Wrapper[T any] interface { registry.Configuration Resolve() T ResolveDefault() T }