gst

package
v0.0.0-...-2e79410 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package gst manages GStreamer pipelines.

This implementation is heavily inspired by https://github.com/pion/rtwatch, which uses GStreamer and Pion WebRTC to stream a video file from disk. I doubt that I could have figured this out without that project as a reference.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pipeline

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

Pipeline represents a GStreamer pipeline that can provide sample data to Go programs through appsink elements.

func NewPipeline

func NewPipeline(description string) (*Pipeline, error)

NewPipeline creates a GStreamer pipeline based on the syntax used in the gst-launch-1.0 utility.

func (*Pipeline) Close

func (p *Pipeline) Close() error

Close stops this pipeline if it is started and releases any resources associated with it. It is invalid to call any other method of a pipeline after it has been closed.

func (*Pipeline) SetSink

func (p *Pipeline) SetSink(name string, fn SinkFunc)

SetSink associates fn with a named appsink element in the pipeline, causing it to be continuously called with new samples while the pipeline is running.

SetSink must only be called while the pipeline is stopped, and may only be called up to once per appsink over the life of the pipeline. It will panic if name does not correspond to the name of a defined appsink, if fn is nil, or if SetSink has already been called once for the named appsink.

func (*Pipeline) Start

func (p *Pipeline) Start() error

Start attempts to set the GStreamer pipeline to the PLAYING state, in which all elements are processing data and sinks are receiving output.

func (*Pipeline) Stop

func (p *Pipeline) Stop() error

Stop attempts to set the pipeline to the NULL state, in which no elements are processing data and sinks are not receiving any output.

type SinkFunc

type SinkFunc func([]byte, time.Duration)

SinkFunc is a type for functions that receive data from the appsink elements of a Pipeline.

Jump to

Keyboard shortcuts

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