gstreamer

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildQueue

func BuildQueue(name string, latency uint64, leaky bool) (*gst.Element, error)

Types

type Bin

type Bin struct {
	*Callbacks
	*StateManager
	// contains filtered or unexported fields
}

Bins are designed to hold a single stream, with any number of sources and sinks

func (*Bin) AddElement

func (b *Bin) AddElement(e *gst.Element) error

Elements will be linked in the order they are added

func (*Bin) AddElements

func (b *Bin) AddElements(elements ...*gst.Element) error

Elements will be linked in the order they are added

func (*Bin) AddSinkBin

func (b *Bin) AddSinkBin(sink *Bin) error

Add src as a sink of b. This should only be called once for each sink bin

func (*Bin) AddSourceBin

func (b *Bin) AddSourceBin(src *Bin) error

Add src as a source of b. This should only be called once for each source bin

func (*Bin) NewBin

func (b *Bin) NewBin(name string) *Bin

func (*Bin) RemoveSinkBin

func (b *Bin) RemoveSinkBin(name string) (bool, error)

func (*Bin) RemoveSourceBin

func (b *Bin) RemoveSourceBin(name string) (bool, error)

func (*Bin) SetEOSFunc

func (b *Bin) SetEOSFunc(f func() bool)

Set a custom EOS function (used for appsrc, input-selector). If it returns true, EOS will also be sent to src bins

func (*Bin) SetGetSinkPad

func (b *Bin) SetGetSinkPad(f func(sinkName string) *gst.Pad)

Set a custom linking function which returns a pad for the named sink bin

func (*Bin) SetGetSrcPad

func (b *Bin) SetGetSrcPad(f func(srcName string) *gst.Pad)

Set a custom linking function which returns a pad for the named src bin

func (*Bin) SetLinkFunc

func (b *Bin) SetLinkFunc(f func() error)

Set a custom linking function for this bin's elements (used when you need to modify chain functions)

func (*Bin) SetState

func (b *Bin) SetState(state gst.State) error

type Callbacks

type Callbacks struct {
	GstReady chan struct{}
	// contains filtered or unexported fields
}

func (*Callbacks) AddOnStop

func (c *Callbacks) AddOnStop(f func() error)

func (*Callbacks) AddOnTrackAdded

func (c *Callbacks) AddOnTrackAdded(f func(*config.TrackSource))

func (*Callbacks) AddOnTrackMuted

func (c *Callbacks) AddOnTrackMuted(f func(string))

func (*Callbacks) AddOnTrackRemoved

func (c *Callbacks) AddOnTrackRemoved(f func(string))

func (*Callbacks) AddOnTrackUnmuted

func (c *Callbacks) AddOnTrackUnmuted(f func(string, time.Duration))

func (*Callbacks) OnError

func (c *Callbacks) OnError(err error)

func (*Callbacks) OnStop

func (c *Callbacks) OnStop() error

func (*Callbacks) OnTrackAdded

func (c *Callbacks) OnTrackAdded(ts *config.TrackSource)

func (*Callbacks) OnTrackMuted

func (c *Callbacks) OnTrackMuted(trackID string)

func (*Callbacks) OnTrackRemoved

func (c *Callbacks) OnTrackRemoved(trackID string)

func (*Callbacks) OnTrackUnmuted

func (c *Callbacks) OnTrackUnmuted(trackID string, pts time.Duration)

func (*Callbacks) SetOnError

func (c *Callbacks) SetOnError(f func(error))

type Pipeline

type Pipeline struct {
	*Bin
	// contains filtered or unexported fields
}

func NewPipeline

func NewPipeline(name string, latency uint64, callbacks *Callbacks) (*Pipeline, error)

A pipeline can have either elements or src and sink bins. If you add both you will get a wrong hierarchy error Bins can contain both elements and src and sink bins

func (*Pipeline) AddElement

func (p *Pipeline) AddElement(e *gst.Element) error

func (*Pipeline) AddElements

func (p *Pipeline) AddElements(elements ...*gst.Element) error

func (*Pipeline) AddSinkBin

func (p *Pipeline) AddSinkBin(sink *Bin) error

func (*Pipeline) AddSourceBin

func (p *Pipeline) AddSourceBin(src *Bin) error

func (*Pipeline) DebugBinToDotData

func (p *Pipeline) DebugBinToDotData(details gst.DebugGraphDetails) string
func (p *Pipeline) Link() error

func (*Pipeline) Run

func (p *Pipeline) Run() error

func (*Pipeline) SendEOS

func (p *Pipeline) SendEOS()

func (*Pipeline) SetState

func (p *Pipeline) SetState(state gst.State) error

func (*Pipeline) SetWatch

func (p *Pipeline) SetWatch(watch func(msg *gst.Message) bool)

func (*Pipeline) Stop

func (p *Pipeline) Stop()

type State

type State int
const (
	StateBuilding State = iota
	StateStarted
	StateRunning
	StateEOS
	StateStopping
	StateFinished
)

func (State) String

func (s State) String() string

type StateManager

type StateManager struct {
	// contains filtered or unexported fields
}

func (*StateManager) GetState

func (s *StateManager) GetState() State

func (*StateManager) GetStateLocked

func (s *StateManager) GetStateLocked() State

func (*StateManager) LockState

func (s *StateManager) LockState()

func (*StateManager) LockStateShared

func (s *StateManager) LockStateShared()

func (*StateManager) UnlockState

func (s *StateManager) UnlockState()

func (*StateManager) UnlockStateShared

func (s *StateManager) UnlockStateShared()

func (*StateManager) UpgradeState

func (s *StateManager) UpgradeState(state State) (State, bool)

Jump to

Keyboard shortcuts

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