node

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder interface {
	Node

	InputPorts() map[string]*InPort[*media.Packet]
	OutputPorts() map[string]*OutPort[media.Frame]
}

type Demuxer

type Demuxer interface {
	Node

	Metadata() *metadata.Bundle
	Streams() ([]media.StreamInfo, error)

	OutputPorts() map[string]*OutPort[*media.Packet]
}

type Edge

type Edge[T any] interface {
	Push(ctx context.Context, item T) error
	Pull(ctx context.Context) (T, error)
	Close()
}

type Encoder

type Encoder interface {
	Node

	InputPorts() map[string]*InPort[media.Frame]
	OutputPorts() map[string]*OutPort[*media.Packet]
}

type Filter

type Filter interface {
	Node

	Process(ctx context.Context) error

	InputPorts() map[string]*InPort[media.Frame]
	OutputPorts() map[string]*OutPort[media.Frame]
}

type InPort

type InPort[T any] struct {
	// contains filtered or unexported fields
}

func NewInPort

func NewInPort[T any](id string) *InPort[T]

func (*InPort[T]) Connect

func (p *InPort[T]) Connect(e Edge[T])

func (*InPort[T]) Edge

func (p *InPort[T]) Edge() Edge[T]

func (*InPort[T]) ID

func (p *InPort[T]) ID() string

func (*InPort[T]) Pull

func (p *InPort[T]) Pull(ctx context.Context) (T, error)

type InputNode

type InputNode[T any] interface {
	InputPorts() map[string]*InPort[T]
}

type InputPhase

type InputPhase uint8
const (
	InputPhaseRun InputPhase = iota
	InputPhasePreload
)

type Lifecycle

type Lifecycle interface {
	Start(ctx context.Context) error
	Close() error
}

type Muxer

type Muxer interface {
	Node

	AddStream(info media.StreamInfo) (streamIndex int, err error)
	SetMetadata(meta *metadata.Bundle) error

	InputPorts() map[string]*InPort[*media.Packet]
}

type Node

type Node interface {
	Lifecycle
}

type OutPort

type OutPort[T any] struct {
	// contains filtered or unexported fields
}

func NewOutPort

func NewOutPort[T any](id string, info media.StreamInfo) *OutPort[T]

func (*OutPort[T]) Connect

func (p *OutPort[T]) Connect(e Edge[T])

func (*OutPort[T]) Edge

func (p *OutPort[T]) Edge() Edge[T]

func (*OutPort[T]) ID

func (p *OutPort[T]) ID() string

func (*OutPort[T]) Push

func (p *OutPort[T]) Push(ctx context.Context, data T) error

func (*OutPort[T]) SetStreamInfo

func (p *OutPort[T]) SetStreamInfo(info media.StreamInfo)

func (*OutPort[T]) StreamInfo

func (p *OutPort[T]) StreamInfo() media.StreamInfo

type OutputNode

type OutputNode[T any] interface {
	OutputPorts() map[string]*OutPort[T]
}

type Seeker

type Seeker interface {
	Seek(offset time.Duration) error
}

type StagedInput

type StagedInput interface {
	InputPhases() map[string]InputPhase
	Preload(context.Context) error
}

StagedInput is implemented by nodes that consume some inputs before the regular pipeline run begins. Preload must consume every InputPhasePreload port to EOF without producing downstream output.

Jump to

Keyboard shortcuts

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