import "github.com/spreadspace/go-gstreamer"
Go bindings for gstreamer1.0. Supports version 1.0 and later.
Functions use the same names as the native C function calls, but use CamelCase. In cases where native gstreamer uses pointers to values to simulate multiple return values, Go's native multiple return values are used instead. Whenever a native gstreamer call could return an unexpected NULL pointer, an additonal error is returned in the Go binding.
gstreamers's C API documentation can be very useful for understanding how the functions in this package work and what each type is for. This documentation can be found at http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/.
In addition to Go versions of the C gstreamer functions, every struct type includes a method named Native (either by direct implementation, or by means of struct embedding). These methods return a uintptr of the native C object the binding type represents. These pointers may be type switched to a native C pointer using unsafe and used with cgo function calls outside this package.
Memory management is handled in proper Go fashion, using runtime finalizers to properly free memory when it is no longer needed. Each time a Go type is created with a pointer to a GObject, a reference is added for Go, sinking the floating reference when necessary. After going out of scope and the next time Go's garbage collector is run, a finalizer is run to remove Go's reference to the GObject. When this reference count hits zero (when neither Go nor gstreamer holds ownership) the object will be freed internally by gstreamer.
const (
// Infinite timeout (unsigned representation of -1)
CLOCK_TIME_NONE uint64 = 18446744073709551615
)Init() is a wrapper around gst_init() and must be called before any other gstreamer calls and is used to initialize everything necessary.
In addition to setting up gstreamer for usage, a pointer to a slice of strings may be passed in to parse standard gst command line arguments. args will be modified to remove any flags that were handled. Alternatively, nil may be passed in to not perform any command line parsing.
BinNew() is a wrapper around gst_bin_new().
Add() is a wrapper around gst_bin_add().
Remove() is a wrapper around gst_bin_remove().
BufferingMode is a representation of GstBufferingMode
const (
BUFFERING_STREAM BufferingMode = C.GST_BUFFERING_STREAM
BUFFERING_DOWNLOAD BufferingMode = C.GST_BUFFERING_DOWNLOAD
BUFFERING_TIMESHIFT BufferingMode = C.GST_BUFFERING_TIMESHIFT
BUFFERING_LIVE BufferingMode = C.GST_BUFFERING_LIVE
)AddSignalWatch() is a wrapper around gst_bus_add_signal_watch().
ElementFactoryMake() is a wrapper around gst_element_factory_make().
AddPad() is a wrapper around gst_element_add_pad().
GetBus() is a wrapper around gst_element_get_bus().
func (v *Element) GetState(timeout uint64) (state, pending State, change StateChangeReturn)
GetState() is a wrapper around gst_element_get_state().
GetStaticPad() is a wrapper around gst_element_get_static_pad().
Link() is a wrapper around gst_element_link().
QueryDuration() is a wrapper around gst_element_query_duration().
QueryPosition() is a wrapper around gst_element_query_position().
RemovePad() is a wrapper around gst_element_remove_pad().
func (v *Element) Seek(rate float64, format Format, flags SeekFlags, startType SeekType, start int64, stopType SeekType, stop int64) bool
Seek() is a wrapper around gst_element_seek().
SeekSimple() is a wrapper around gst_element_seek_simple().
func (v *Element) SetState(state State) StateChangeReturn
SetState() is a wrapper around gst_element_set_state().
SyncStateWithParent() is a wrapper around gst_element_sync_state_with_parent().
type ElementFactory struct {
PluginFeature
}func ElementFactoryFind(name string) (*ElementFactory, error)
ElementFactoryFind() is a wrapper around gst_element_factory_find().
Format is a representation of GstFormat.
const (
FORMAT_UNDEFINED Format = C.GST_FORMAT_UNDEFINED
FORMAT_DEFAULT Format = C.GST_FORMAT_DEFAULT
FORMAT_BYTES Format = C.GST_FORMAT_BYTES
FORMAT_TIME Format = C.GST_FORMAT_TIME
FORMAT_BUFFERS Format = C.GST_FORMAT_BUFFERS
FORMAT_PERCENT Format = C.GST_FORMAT_PERCENT
)type GValueArray []interface{}GhostPadNew() is a wrapper around gst_ghost_pad_new().
type IBin interface {
// contains filtered or unexported methods
}IBin is an interface type implemented by all structs embedding a Bin. It is meant to be used as an argument type for wrapper functions that wrap around a C gst function taking a GstBin.
type IElement interface {
// contains filtered or unexported methods
}IElement is an interface type implemented by all structs embedding a Element. It is meant to be used as an argument type for wrapper functions that wrap around a C gst function taking a GstElement.
type IPad interface {
// contains filtered or unexported methods
}Message is a representation of Gst's GstMessage.
GetSeqnum() is a wrapper around GST_MESSAGE_SEQNUM().
GetSourceName() is a wrapper around GST_MESSAGE_SRC_NAME().
GetStructure() is a wrapper around gst_message_get_structure().
Timestamp() is a wrapper around GST_MESSAGE_TIMESTAMP().
func (v *Message) GetType() MessageType
GetType() is a wrapper around GST_MESSAGE_TYPE().
GetTypeName() is a wrapper around GST_MESSAGE_TYPE_NAME().
Native returns a pointer to the underlying GdkEvent.
ParseAsyncDone() is a wrapper around gst_message_parse_async_done().
ParseBuffering() is a wrapper around gst_message_parse_buffering().
func (v *Message) ParseBufferingStats() (mode BufferingMode, avgIn, avgOut int, bufferingLeft int64)
ParseBufferingStats() is a wrapper around gst_message_parse_buffering_stats().
ParseError() is a wrapper around gst_message_parse_error().
ParseQosStats() is a wrapper around gst_message_parse_qos_stats().
ParseQosValues() is a wrapper around gst_message_parse_qos_values().
ParseResetTime() is a wrapper around gst_message_parse_reset_time().
ParseSegmentDone() is a wrapper around gst_message_parse_segment_done().
ParseSegmentStart() is a wrapper around gst_message_parse_segment_start().
ParseStateChanged() is a wrapper around gst_message_parse_state_changed().
func (v *Message) ParseStepDone() (format Format, amount uint64, rate float64, flush, intermediate bool, duration uint64, eos bool)
ParseStepDone() is a wrapper around gst_message_parse_step_done().
ParseWarning() is a wrapper around gst_message_parse_warning().
MessageType is a representation of GstMessageType.
const (
MESSAGE_UNKNOWN MessageType = C.GST_MESSAGE_UNKNOWN
MESSAGE_EOS MessageType = C.GST_MESSAGE_EOS
MESSAGE_ERROR MessageType = C.GST_MESSAGE_ERROR
MESSAGE_WARNING MessageType = C.GST_MESSAGE_WARNING
MESSAGE_INFO MessageType = C.GST_MESSAGE_INFO
MESSAGE_TAG MessageType = C.GST_MESSAGE_TAG
MESSAGE_BUFFERING MessageType = C.GST_MESSAGE_BUFFERING
MESSAGE_STATE_CHANGED MessageType = C.GST_MESSAGE_STATE_CHANGED
MESSAGE_STATE_DIRTY MessageType = C.GST_MESSAGE_STATE_DIRTY
MESSAGE_STEP_DONE MessageType = C.GST_MESSAGE_STEP_DONE
MESSAGE_CLOCK_LOST MessageType = C.GST_MESSAGE_CLOCK_LOST
MESSAGE_NEW_CLOCK MessageType = C.GST_MESSAGE_NEW_CLOCK
MESSAGE_STRUCTURE_CHANGE MessageType = C.GST_MESSAGE_STRUCTURE_CHANGE
MESSAGE_STREAM_STATUS MessageType = C.GST_MESSAGE_STREAM_STATUS
MESSAGE_APPLICATION MessageType = C.GST_MESSAGE_APPLICATION
MESSAGE_ELEMENT MessageType = C.GST_MESSAGE_ELEMENT
MESSAGE_SEGMENT_START MessageType = C.GST_MESSAGE_SEGMENT_START
MESSAGE_SEGMENT_DONE MessageType = C.GST_MESSAGE_SEGMENT_DONE
MESSAGE_DURATION_CHANGED MessageType = C.GST_MESSAGE_DURATION_CHANGED
MESSAGE_LATENCY MessageType = C.GST_MESSAGE_LATENCY
MESSAGE_ASYNC_START MessageType = C.GST_MESSAGE_ASYNC_START
MESSAGE_ASYNC_DONE MessageType = C.GST_MESSAGE_ASYNC_DONE
MESSAGE_REQUEST_STATE MessageType = C.GST_MESSAGE_REQUEST_STATE
MESSAGE_STEP_START MessageType = C.GST_MESSAGE_STEP_START
MESSAGE_QOS MessageType = C.GST_MESSAGE_QOS
MESSAGE_PROGRESS MessageType = C.GST_MESSAGE_PROGRESS
MESSAGE_TOC MessageType = C.GST_MESSAGE_TOC
MESSAGE_RESET_TIME MessageType = C.GST_MESSAGE_RESET_TIME
MESSAGE_STREAM_START MessageType = C.GST_MESSAGE_STREAM_START
MESSAGE_ANY MessageType = C.GST_MESSAGE_ANY
)const (
MESSAGE_NEED_CONTEXT MessageType = C.GST_MESSAGE_NEED_CONTEXT
MESSAGE_HAVE_CONTEXT MessageType = C.GST_MESSAGE_HAVE_CONTEXT
)Since 1.2
const (
MESSAGE_EXTENDED MessageType = C.GST_MESSAGE_EXTENDED
MESSAGE_DEVICE_ADDED MessageType = C.GST_MESSAGE_DEVICE_ADDED
MESSAGE_DEVICE_REMOVED MessageType = C.GST_MESSAGE_DEVICE_REMOVED
)Since 1.4
type Object struct {
glib.InitiallyUnowned
}Object is a representation of gst's GstObject.
GetName() is a wrapper around gst_object_get_name().
RefSink is a wrapper around gst_object_ref_sink(). This is for internal use.
Unref is a wrapper around gst_object_unref(). This is for internal use.
GetPeer() is a wrapper around gst_pad_get_peer().
func (v *Pad) Link(sinkPad IPad) PadLinkReturn
Link is a wrapper around gst_pad_link().
SetActive() is a wrapper around gst_pad_set_active().
Unlink() is a wrapper around gst_pad_unlink().
PadLinkReturn os a representation of GstPadLinkReturn.
const (
PAD_LINK_OK PadLinkReturn = C.GST_PAD_LINK_OK
PAD_LINK_WRONG_HIERARCHY PadLinkReturn = C.GST_PAD_LINK_WRONG_HIERARCHY
PAD_LINK_WAS_LINKED PadLinkReturn = C.GST_PAD_LINK_WAS_LINKED
PAD_LINK_WRONG_DIRECTION PadLinkReturn = C.GST_PAD_LINK_WRONG_DIRECTION
PAD_LINK_NOFORMAT PadLinkReturn = C.GST_PAD_LINK_NOFORMAT
PAD_LINK_NOSCHED PadLinkReturn = C.GST_PAD_LINK_NOSCHED
PAD_LINK_REFUSED PadLinkReturn = C.GST_PAD_LINK_REFUSED
)PipelineNew() is a wrapper around gst_pipeline_new().
GetBus() is a wrapper around gst_pipeline_get_bus().
SeekFlags is a representation of GstSeekFlags.
const (
SEEK_FLAG_NONE SeekFlags = C.GST_SEEK_FLAG_NONE
SEEK_FLAG_FLUSH SeekFlags = C.GST_SEEK_FLAG_FLUSH
SEEK_FLAG_ACCURATE SeekFlags = C.GST_SEEK_FLAG_ACCURATE
SEEK_FLAG_KEY_UNIT SeekFlags = C.GST_SEEK_FLAG_KEY_UNIT
SEEK_FLAG_SEGMENT SeekFlags = C.GST_SEEK_FLAG_SEGMENT
SEEK_FLAG_SKIP SeekFlags = C.GST_SEEK_FLAG_SKIP
SEEK_FLAG_SNAP_BEFORE SeekFlags = C.GST_SEEK_FLAG_SNAP_BEFORE
SEEK_FLAG_SNAP_AFTER SeekFlags = C.GST_SEEK_FLAG_SNAP_AFTER
SEEK_FLAG_SNAP_NEAREST SeekFlags = C.GST_SEEK_FLAG_SNAP_NEAREST
)SeekType is a representation of GstSeekType.
const (
SEEK_TYPE_NONE SeekType = C.GST_SEEK_TYPE_NONE
SEEK_TYPE_SET SeekType = C.GST_SEEK_TYPE_SET
SEEK_TYPE_END SeekType = C.GST_SEEK_TYPE_END
)State is a representation of GstState.
const (
STATE_VOID_PENDING State = C.GST_STATE_VOID_PENDING
STATE_NULL State = C.GST_STATE_NULL
STATE_READY State = C.GST_STATE_READY
STATE_PAUSED State = C.GST_STATE_PAUSED
STATE_PLAYING State = C.GST_STATE_PLAYING
)GetName() is a wrapper around gst_element_state_get_name().
StateChangeReturn is a representation of GstStateChangeReturn.
const (
STATE_CHANGE_FAILURE StateChangeReturn = C.GST_STATE_CHANGE_FAILURE
STATE_CHANGE_SUCCESS StateChangeReturn = C.GST_STATE_CHANGE_SUCCESS
STATE_CHANGE_ASYNC StateChangeReturn = C.GST_STATE_CHANGE_ASYNC
STATE_CHANGE_NO_PREROLL StateChangeReturn = C.GST_STATE_CHANGE_NO_PREROLL
)Package gst imports 5 packages (graph) and is imported by 1 packages. Updated 2018-08-05. Refresh now. Tools for package owners.