Documentation
¶
Overview ¶
Package gst contains bindings for the gstreamer C API. If you are trying to build simple pipelines quickly (and optiionally readers/writers) see the gstauto package.
Index ¶
- Constants
- Variables
- func ElementLinkMany(elems ...*Element) error
- func Init(args *[]string)
- func NewElementMany(elemNames ...string) (map[int]*Element, error)
- func Wait(p *Pipeline)
- type Bin
- func (b *Bin) Add(elem *Element) error
- func (b *Bin) AddMany(elems ...*Element) error
- func (b *Bin) GetElementByName(name string) (*Element, error)
- func (b *Bin) GetElements() ([]*Element, error)
- func (b *Bin) GetSinkElements() ([]*Element, error)
- func (b *Bin) GetSourceElements() ([]*Element, error)
- func (b *Bin) Instance() *C.GstBin
- type Buffer
- func (b *Buffer) Bytes() []byte
- func (b *Buffer) DecodingTimestamp() time.Duration
- func (b *Buffer) Duration() time.Duration
- func (b *Buffer) Instance() *C.GstBuffer
- func (b *Buffer) Offset() int64
- func (b *Buffer) OffsetEnd() int64
- func (b *Buffer) PresentationTimestamp() time.Duration
- func (b *Buffer) Reader() io.Reader
- type BufferingMode
- type Bus
- type Caps
- func NewAnyCaps() *Caps
- func NewCapsFromString(capsStr string) *Caps
- func NewEmptyCaps() *Caps
- func NewEmptySimpleCaps(mediaFormat string) *Caps
- func NewFullCaps(structures ...*Structure) *Caps
- func NewRawCaps(format string, rate, channels int) *Caps
- func NewSimpleCaps(mediaFormat string, fieldVals ...interface{}) (*Caps, error)
- func (c *Caps) Append(caps *Caps)
- func (c *Caps) AppendStructure(st *Structure)
- func (c *Caps) GetFeaturesAt(idx int) *CapsFeatures
- func (c *Caps) GetStructureAt(idx int) *Structure
- func (c *Caps) Instance() *C.GstCaps
- func (c *Caps) IsAny() bool
- func (c *Caps) IsEmpty() bool
- func (c *Caps) Ref()
- func (c *Caps) Size() int
- func (c *Caps) Unref()
- type CapsFeatures
- type Clock
- func (c *Clock) Duration() time.Duration
- func (c *Clock) Instance() *C.GstClock
- func (c *Clock) InternalDuration() time.Duration
- func (c *Clock) InternalString() string
- func (c *Clock) InternalTime() uint64
- func (c *Clock) IsSynced() bool
- func (c *Clock) String() string
- func (c *Clock) Time() uint64
- type Element
- func (e *Element) BlockSetState(state State) error
- func (e *Element) GetBus() *Bus
- func (e *Element) GetClock() *Clock
- func (e *Element) GetFactory() *ElementFactory
- func (e *Element) GetPadTemplates() []*PadTemplate
- func (e *Element) GetPads() []*Pad
- func (e *Element) GetState() State
- func (e *Element) GetURIProtocols() []string
- func (e *Element) GetURIType() URIType
- func (e *Element) Has(flags ElementFlags) bool
- func (e *Element) Instance() *C.GstElement
- func (e *Element) IsURIHandler() bool
- func (e *Element) Link(elem *Element) error
- func (e *Element) LinkFiltered(elem *Element, caps *Caps) error
- func (e *Element) SetState(state State) error
- type ElementFactory
- func (e *ElementFactory) CanSinkAllCaps(caps *C.GstCaps) bool
- func (e *ElementFactory) CanSinkAnyCaps(caps *C.GstCaps) bool
- func (e *ElementFactory) CanSourceAllCaps(caps *C.GstCaps) bool
- func (e *ElementFactory) CanSourceAnyCaps(caps *C.GstCaps) bool
- func (e *ElementFactory) GetMetadata(key string) string
- func (e *ElementFactory) GetMetadataKeys() []string
- func (e *ElementFactory) Instance() *C.GstElementFactory
- type ElementFlags
- type EnumValue
- type FlagsValue
- type FlowReturn
- type Format
- type GhostPad
- type GoGError
- type MapFlags
- type MapInfo
- type Message
- func (m *Message) Copy() *Message
- func (m *Message) GetStructure() *Structure
- func (m *Message) Instance() *C.GstMessage
- func (m *Message) ParseError() *GoGError
- func (m *Message) ParseInfo() *GoGError
- func (m *Message) ParseStateChanged() (oldState, newState State)
- func (m *Message) ParseWarning() *GoGError
- func (m *Message) Ref() *Message
- func (m *Message) Type() MessageType
- func (m *Message) TypeName() string
- func (m *Message) Unref()
- type MessageType
- type MiniObject
- func (m *MiniObject) AddParent(parent *MiniObject)
- func (m *MiniObject) Copy() *MiniObject
- func (m *MiniObject) GetData(name string) unsafe.Pointer
- func (m *MiniObject) Instance() *C.GstMiniObject
- func (m *MiniObject) Parent() *MiniObject
- func (m *MiniObject) Ref()
- func (m *MiniObject) SetData(name string, ptr unsafe.Pointer)
- func (m *MiniObject) Type() glib.Type
- func (m *MiniObject) Unref()
- type MiniObjectFlags
- type Object
- type Pad
- type PadDirection
- type PadLinkReturn
- type PadPresence
- type PadTemplate
- type ParameterFlags
- type ParameterSpec
- func (p *ParameterSpec) DoubleRange() (float64, float64)
- func (p *ParameterSpec) FloatRange() (float64, float64)
- func (p *ParameterSpec) GetCaps() *Caps
- func (p *ParameterSpec) GetDefaultFlags() int
- func (p *ParameterSpec) GetEnumValues() []*EnumValue
- func (p *ParameterSpec) GetFlagValues() []*FlagsValue
- func (p *ParameterSpec) Int64Range() (int64, int64)
- func (p *ParameterSpec) IntRange() (int, int)
- func (p *ParameterSpec) IsBoxed() bool
- func (p *ParameterSpec) IsCaps() bool
- func (p *ParameterSpec) IsEnum() bool
- func (p *ParameterSpec) IsFlags() bool
- func (p *ParameterSpec) IsFraction() bool
- func (p *ParameterSpec) IsGstArray() bool
- func (p *ParameterSpec) IsObject() bool
- func (p *ParameterSpec) IsPointer() bool
- func (p *ParameterSpec) UInt64Range() (uint64, uint64)
- func (p *ParameterSpec) UIntRange() (uint, uint)
- func (p *ParameterSpec) Unref()
- type Pipeline
- type Plugin
- type PluginFeature
- type Registry
- type Sample
- type SeekFlags
- type SeekType
- type State
- type StateChangeReturn
- type Structure
- func (s *Structure) Free()
- func (s *Structure) GetValue(key string) (interface{}, error)
- func (s *Structure) Instance() *C.GstStructure
- func (s *Structure) Name() string
- func (s *Structure) RemoveValue(key string)
- func (s *Structure) SetValue(key string, value interface{}) error
- func (s *Structure) Size() int
- func (s *Structure) String() string
- func (s *Structure) Values() map[string]interface{}
- type URIType
Constants ¶
const ( // ClockFormat is the string used when formatting clock strings ClockFormat string = "u:%02u:%02u.%09u" // ClockTimeNone means infinite timeout (unsigned representation of -1) ClockTimeNone uint64 = 18446744073709551615 )
const ( ParameterReadable ParameterFlags = C.G_PARAM_READABLE // the parameter is readable ParameterWritable = C.G_PARAM_WRITABLE // the parameter is writable ParameterConstruct = C.G_PARAM_CONSTRUCT // the parameter will be set upon object construction ParameterConstructOnly = C.G_PARAM_CONSTRUCT_ONLY // the parameter can only be set upon object construction ParameterLaxValidation = C.G_PARAM_LAX_VALIDATION // upon parameter conversion (see g_param_value_convert()) strict validation is not required ParameterStaticName = C.G_PARAM_STATIC_NAME // the string used as name when constructing the parameter is guaranteed to remain valid and unmodified for the lifetime of the parameter. Since 2.8 ParameterStaticNick = C.G_PARAM_STATIC_NICK // the string used as nick when constructing the parameter is guaranteed to remain valid and unmmodified for the lifetime of the parameter. Since 2.8 ParameterStaticBlurb = C.G_PARAM_STATIC_BLURB // the string used as blurb when constructing the parameter is guaranteed to remain valid and unmodified for the lifetime of the parameter. Since 2.8 ParameterExplicitNotify = C.G_PARAM_EXPLICIT_NOTIFY // calls to g_object_set_property() for this property will not automatically result in a "notify" signal being emitted: the implementation must call g_object_notify() themselves in case the property actually changes. Since: 2.42. ParameterDeprecated = C.G_PARAM_DEPRECATED // the parameter is deprecated and will be removed in a future version. A warning will be generated if it is used while running with G_ENABLE_DIAGNOSTIC=1. Since 2.26 ParameterControllable = C.GST_PARAM_CONTROLLABLE ParameterMutablePlaying = C.GST_PARAM_MUTABLE_PLAYING ParameterMutablePaused = C.GST_PARAM_MUTABLE_PAUSED ParameterMutableReady = C.GST_PARAM_MUTABLE_READY )
Type casting of GParamFlags
const ( URIUnknown URIType = C.GST_URI_UNKNOWN // (0) – The URI direction is unknown URISink = C.GST_URI_SINK // (1) – The URI is a consumer. URISource = C.GST_URI_SRC // (2) - The URI is a producer. )
Type cast URI types
const (
CapsFeatureMemorySystemMemory = C.GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY
)
Go casting of caps features constants
Variables ¶
var (
CapsFeaturesAny = wrapCapsFeatures(C.gst_caps_features_new_any())
)
Go casting of pre-baked caps features
Functions ¶
func ElementLinkMany ¶
ElementLinkMany is a go implementation of `gst_element_link_many` to compensate for no variadic functions in cgo.
func Init ¶
func Init(args *[]string)
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.
func NewElementMany ¶
NewElementMany is a convenience wrapper around building many GstElements in a single function call. It returns an error if the creation of any element fails. A map containing the ordinal of the argument to the Element created is returned.
Types ¶
type Bin ¶
type Bin struct{ *Element }
Bin is a go wrapper arounds a GstBin.
func (*Bin) AddMany ¶
AddMany is a go implementation of `gst_bin_add_many` to compensate for the inability to use variadic functions in cgo.
func (*Bin) GetElementByName ¶
GetElementByName returns the element with the given name. Unref after usage.
func (*Bin) GetElements ¶
GetElements returns a list of the elements added to this pipeline.
func (*Bin) GetSinkElements ¶
GetSinkElements returns a list of all the sink elements in this pipeline. Unref elements after usage.
func (*Bin) GetSourceElements ¶
GetSourceElements returns a list of all the source elements in this pipeline.
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer is a go representation of a GstBuffer.
func NewBufferFromBytes ¶
NewBufferFromBytes returns a new buffer from the given byte slice.
func NewBufferFromReader ¶
NewBufferFromReader returns a new buffer from the given io.Reader.
func (*Buffer) DecodingTimestamp ¶
DecodingTimestamp returns the decoding timestamp of the buffer, or a negative duration if not known or relevant. This value contains the timestamp when the media should be processed.
func (*Buffer) Duration ¶
Duration returns the length of the data inside this buffer, or a negative duration if not known or relevant.
func (*Buffer) Offset ¶
Offset returns a media specific offset for the buffer data. For video frames, this is the frame number of this buffer. For audio samples, this is the offset of the first sample in this buffer. For file data or compressed data this is the byte offset of the first byte in this buffer.
func (*Buffer) OffsetEnd ¶
OffsetEnd returns the last offset contained in this buffer. It has the same format as Offset.
func (*Buffer) PresentationTimestamp ¶
PresentationTimestamp returns the presentation timestamp of the buffer, or a negative duration if not known or relevant. This value contains the timestamp when the media should be presented to the user.
type BufferingMode ¶
type BufferingMode int
BufferingMode is a representation of GstBufferingMode
const ( BufferingStream BufferingMode = C.GST_BUFFERING_STREAM BufferingDownload BufferingMode = C.GST_BUFFERING_DOWNLOAD BufferingTimeshift BufferingMode = C.GST_BUFFERING_TIMESHIFT BufferingLive BufferingMode = C.GST_BUFFERING_LIVE )
Type casts of buffering modes
type Bus ¶
type Bus struct { *Object // contains filtered or unexported fields }
Bus is a Go wrapper around a GstBus. It provides convenience methods for popping messages from the queue.
func (*Bus) BlockPopMessage ¶
BlockPopMessage blocks until a message is available on the bus and then returns it. This function can return nil if the bus is closed. The message should be unreffed after usage.
func (*Bus) MessageChan ¶
MessageChan returns a new channel to listen for messages asynchronously. Messages should be unreffed after each usage. Messages are delivered to channels in the order in which this function was called.
While a message is being delivered to created channels, there is a lock on creating new ones.
func (*Bus) PopMessage ¶ added in v0.0.2
PopMessage attempts to pop a message from the bus. It returns nil if none are available. The message should be unreffed after usage.
type Caps ¶
type Caps struct {
// contains filtered or unexported fields
}
Caps is a go wrapper around GstCaps.
func NewAnyCaps ¶
func NewAnyCaps() *Caps
NewAnyCaps creates a new caps that indicate compatibility with any format.
func NewCapsFromString ¶
NewCapsFromString creates a new Caps object from the given string.
func NewEmptyCaps ¶
func NewEmptyCaps() *Caps
NewEmptyCaps creates a new empty caps object. This is essentially the opposite of NewAnyCamps.
func NewEmptySimpleCaps ¶
NewEmptySimpleCaps returns a new empty caps object with the given media format.
func NewFullCaps ¶
NewFullCaps creates a new caps from the given structures.
func NewRawCaps ¶
NewRawCaps returns new GstCaps with the given format, sample-rate, and channels.
func NewSimpleCaps ¶
NewSimpleCaps creates new caps with the given media format and key value pairs. The key of each pair must be a string, followed by any field that can be converted to a GType.
func (*Caps) Append ¶
Append appends the given caps element to these caps. These caps take ownership over the given object. If either caps are ANY, the resulting caps will be ANY.
func (*Caps) AppendStructure ¶
AppendStructure appends the given structure to this caps instance.
func (*Caps) GetFeaturesAt ¶
func (c *Caps) GetFeaturesAt(idx int) *CapsFeatures
GetFeaturesAt returns the feature at the given index, or nil if none exists.
func (*Caps) GetStructureAt ¶
GetStructureAt returns the structure at the given index, or nil if none exists.
type CapsFeatures ¶
type CapsFeatures struct {
// contains filtered or unexported fields
}
CapsFeatures is a go representation of GstCapsFeatures.
func NewCapsFeaturesFromString ¶
func NewCapsFeaturesFromString(features string) *CapsFeatures
NewCapsFeaturesFromString creates new CapsFeatures from the given string.
func (*CapsFeatures) Equal ¶
func (c *CapsFeatures) Equal(feats *CapsFeatures) bool
Equal returns true if the given CapsFeatures are equal to the provided ones. If the provided structure is nil, this function immediately returns false.
func (*CapsFeatures) Instance ¶
func (c *CapsFeatures) Instance() *C.GstCapsFeatures
Instance returns the native underlying GstCapsFeatures instance.
func (*CapsFeatures) IsAny ¶
func (c *CapsFeatures) IsAny() bool
IsAny returns true if these features match any.
func (*CapsFeatures) String ¶
func (c *CapsFeatures) String() string
String implements a stringer on caps features.
type Clock ¶
type Clock struct{ *Object }
Clock is a go wrapper around a GstClock.
func (*Clock) InternalDuration ¶
InternalDuration returns the time.Duration equivalent of this clock's internal time.
func (*Clock) InternalString ¶
InternalString returns the string representation of this clock's internal value.
func (*Clock) InternalTime ¶
InternalTime gets the current internal time of the given clock in nanoseconds or ClockTimeNone if invalid. The time is returned unadjusted for the offset and the rate.
type Element ¶
type Element struct{ *Object }
Element is a Go wrapper around a GstElement.
func NewElement ¶
NewElement is a generic wrapper around `gst_element_factory_make`.
func (*Element) BlockSetState ¶
BlockSetState is like SetState except it will block until the transition is complete.
func (*Element) GetBus ¶
GetBus returns the GstBus for retrieving messages from this element. This function returns nil unless the element is a Pipeline.
func (*Element) GetClock ¶
GetClock returns the Clock for this element. This is the clock as was last set with gst_element_set_clock. Elements in a pipeline will only have their clock set when the pipeline is in the PLAYING state.
func (*Element) GetFactory ¶
func (e *Element) GetFactory() *ElementFactory
GetFactory returns the factory that created this element. No refcounting is needed.
func (*Element) GetPadTemplates ¶
func (e *Element) GetPadTemplates() []*PadTemplate
GetPadTemplates retrieves a list of the pad templates associated with this element. The list must not be modified by the calling code.
func (*Element) GetURIProtocols ¶
GetURIProtocols returns the protocols this element can handle.
func (*Element) GetURIType ¶
GetURIType returns the type of URI this element can handle.
func (*Element) Has ¶
func (e *Element) Has(flags ElementFlags) bool
Has returns true if this element has the given flags.
func (*Element) Instance ¶
func (e *Element) Instance() *C.GstElement
Instance returns the underlying GstElement instance.
func (*Element) IsURIHandler ¶
IsURIHandler returns true if this element can handle URIs.
func (*Element) LinkFiltered ¶
LinkFiltered wraps gst_element_link_filtered and link this element to the given one using the provided sink caps.
type ElementFactory ¶
type ElementFactory struct{ *PluginFeature }
ElementFactory wraps the GstElementFactory
func Find ¶
func Find(name string) *ElementFactory
Find returns the factory for the given plugin, or nil if it doesn't exist. Unref after usage.
func (*ElementFactory) CanSinkAllCaps ¶
func (e *ElementFactory) CanSinkAllCaps(caps *C.GstCaps) bool
CanSinkAllCaps checks if the factory can sink all possible capabilities.
func (*ElementFactory) CanSinkAnyCaps ¶
func (e *ElementFactory) CanSinkAnyCaps(caps *C.GstCaps) bool
CanSinkAnyCaps checks if the factory can sink any possible capability.
func (*ElementFactory) CanSourceAllCaps ¶
func (e *ElementFactory) CanSourceAllCaps(caps *C.GstCaps) bool
CanSourceAllCaps checks if the factory can src all possible capabilities.
func (*ElementFactory) CanSourceAnyCaps ¶
func (e *ElementFactory) CanSourceAnyCaps(caps *C.GstCaps) bool
CanSourceAnyCaps checks if the factory can src any possible capability.
func (*ElementFactory) GetMetadata ¶
func (e *ElementFactory) GetMetadata(key string) string
GetMetadata gets the metadata on this factory with key.
func (*ElementFactory) GetMetadataKeys ¶
func (e *ElementFactory) GetMetadataKeys() []string
GetMetadataKeys gets the available keys for the metadata on this factory.
func (*ElementFactory) Instance ¶
func (e *ElementFactory) Instance() *C.GstElementFactory
Instance returns the C GstFactory instance
type ElementFlags ¶
type ElementFlags int
ElementFlags casts C GstElementFlags to a go type
const ( ElementFlagLockedState ElementFlags = C.GST_ELEMENT_FLAG_LOCKED_STATE // (16) – ignore state changes from parent ElementFlagSink ElementFlags = C.GST_ELEMENT_FLAG_SINK // (32) – the element is a sink ElementFlagSource ElementFlags = C.GST_ELEMENT_FLAG_SOURCE // (64) – the element is a source. ElementFlagProvideClock ElementFlags = C.GST_ELEMENT_FLAG_PROVIDE_CLOCK // (128) – the element can provide a clock ElementFlagRequireClock ElementFlags = C.GST_ELEMENT_FLAG_REQUIRE_CLOCK // (256) – the element requires a clock ElementFlagIndexable ElementFlags = C.GST_ELEMENT_FLAG_INDEXABLE // (512) – the element can use an index ElementFlagLast ElementFlags = C.GST_ELEMENT_FLAG_LAST // (16384) – offset to define more flags )
Type casting of element flags
type FlagsValue ¶
FlagsValue is a go representation of GFlagsValue
type FlowReturn ¶
type FlowReturn int
FlowReturn is go type casting for GstFlowReturn.
const ( FlowOK FlowReturn = C.GST_FLOW_OK // Data passing was ok FlowNotLinked FlowReturn = C.GST_FLOW_NOT_LINKED // Pad is not linked FlowFlushing FlowReturn = C.GST_FLOW_FLUSHING // Pad is flushing FlowEOS FlowReturn = C.GST_FLOW_EOS // Pad is EOS FlowNotNegotiated FlowReturn = C.GST_FLOW_NOT_NEGOTIATED // Pad is not negotiated FlowError FlowReturn = C.GST_FLOW_ERROR // Some (fatal) error occurred FlowNotSupported FlowReturn = C.GST_FLOW_NOT_SUPPORTED // The operation is not supported. )
Type casting of the GstFlowReturn types. Custom ones are omitted for now.
type Format ¶
type Format int
Format is a representation of GstFormat.
const ( FormatUndefined Format = C.GST_FORMAT_UNDEFINED FormatDefault Format = C.GST_FORMAT_DEFAULT FormatBytes Format = C.GST_FORMAT_BYTES FormatTime Format = C.GST_FORMAT_TIME FormatBuffer Format = C.GST_FORMAT_BUFFERS FormatPercent Format = C.GST_FORMAT_PERCENT )
Type casts of formats
type GoGError ¶
type GoGError struct {
// contains filtered or unexported fields
}
GoGError is a Go wrapper for a C GError. It implements the error interface and provides additional functions for retrieving debug strings and details.
func (*GoGError) DebugString ¶
DebugString returns any debug info alongside the error.
type MapFlags ¶
type MapFlags int
MapFlags is a go casting of GstMapFlags
const ( MapRead MapFlags = C.GST_MAP_READ // (1) – map for read access MapWrite MapFlags = C.GST_MAP_WRITE // (2) - map for write access MapFlagLast MapFlags = C.GST_MAP_FLAG_LAST // (65536) – first flag that can be used for custom purposes )
Type casting of the map flag types
type MapInfo ¶
type MapInfo struct { Memory unsafe.Pointer // A pointer to the GstMemory object Flags MapFlags Data unsafe.Pointer // A pointer to the actual data Size int64 MaxSize int64 // contains filtered or unexported fields }
MapInfo is a go representation of a GstMapInfo.
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message is a Go wrapper around a GstMessage. It provides convenience methods for unref-ing and parsing the underlying messages.
func (*Message) Copy ¶
Copy will copy this object into a new Message that can be Unrefed separately.
func (*Message) GetStructure ¶
GetStructure returns the GstStructure of this message, using the type of the message to determine the method to use. The returned structure must not be freed.
func (*Message) Instance ¶ added in v0.0.3
func (m *Message) Instance() *C.GstMessage
Instance returns the underlying GstMessage object.
func (*Message) ParseError ¶
ParseError will return a GoGError from the contents of this message. This will only work if the GstMessageType is `GST_MESSAGE_ERROR`.
func (*Message) ParseInfo ¶
ParseInfo is identical to ParseError. The returned types are the same. However, this is intended for use with GstMessageType `GST_MESSAGE_INFO`.
func (*Message) ParseStateChanged ¶
ParseStateChanged will return the old and new states as Go strings. This will only work if the GstMessageType is `GST_MESSAGE_STATE_CHANGED`.
func (*Message) ParseWarning ¶
ParseWarning is identical to ParseError. The returned types are the same. However, this is intended for use with GstMessageType `GST_MESSAGE_WARNING`.
func (*Message) Ref ¶
Ref will increase the ref count on this message. This increases the total amount of times Unref needs to be called before the object is freed from memory. It returns the underlying message object for convenience.
func (*Message) Type ¶
func (m *Message) Type() MessageType
Type returns the MessageType of the message.
type MessageType ¶
type MessageType int
MessageType is an alias to the C equivalent of GstMessageType.
const ( MessageAny MessageType = C.GST_MESSAGE_ANY MessageStreamStart MessageType = C.GST_MESSAGE_STREAM_START MessageEOS MessageType = C.GST_MESSAGE_EOS MessageInfo MessageType = C.GST_MESSAGE_INFO MessageWarning MessageType = C.GST_MESSAGE_WARNING MessageError MessageType = C.GST_MESSAGE_ERROR MessageStateChanged MessageType = C.GST_MESSAGE_STATE_CHANGED MessageElement MessageType = C.GST_MESSAGE_ELEMENT MessageStreamStatus MessageType = C.GST_MESSAGE_STREAM_STATUS MessageBuffering MessageType = C.GST_MESSAGE_BUFFERING MessageLatency MessageType = C.GST_MESSAGE_LATENCY MessageNewClock MessageType = C.GST_MESSAGE_NEW_CLOCK MessageAsyncDone MessageType = C.GST_MESSAGE_ASYNC_DONE MessageTag MessageType = C.GST_MESSAGE_TAG )
Type casting of GstMessageTypes
type MiniObject ¶
type MiniObject struct {
// contains filtered or unexported fields
}
MiniObject is an opaque struct meant to form the base of gstreamer classes extending the GstMiniObject. This object is a WIP and is intended primarily for forming the base of extending classes.
func NewMiniObject ¶
func NewMiniObject(flags MiniObjectFlags, gtype glib.Type) *MiniObject
NewMiniObject initializes a new mini object with the desired flags, types, and callbacks. If you don't need any callbacks you can specify nil. TODO: This is more for reference and is not fully implemented.
func (*MiniObject) AddParent ¶
func (m *MiniObject) AddParent(parent *MiniObject)
AddParent adds the given object as a parent of this object. See https://gstreamer.freedesktop.org/documentation/gstreamer/gstminiobject.html?gi-language=c#gst_mini_object_add_parent.
func (*MiniObject) Copy ¶
func (m *MiniObject) Copy() *MiniObject
Copy creates a copy of this object.
func (*MiniObject) GetData ¶
func (m *MiniObject) GetData(name string) unsafe.Pointer
GetData returns the userdata pointer associated with this object at the given key, or nil if none exists.
func (*MiniObject) Instance ¶
func (m *MiniObject) Instance() *C.GstMiniObject
Instance returns the native GstMiniObject instance.
func (*MiniObject) Parent ¶
func (m *MiniObject) Parent() *MiniObject
Parent returns the parent of this MiniObject
func (*MiniObject) Ref ¶
func (m *MiniObject) Ref()
Ref increases the ref count on this object by one.
func (*MiniObject) SetData ¶
func (m *MiniObject) SetData(name string, ptr unsafe.Pointer)
SetData sets a userdata pointer associated with this object at the given key, Use nil to delete an existing key.
func (*MiniObject) Type ¶
func (m *MiniObject) Type() glib.Type
Type returns the type of this mini object.
func (*MiniObject) Unref ¶
func (m *MiniObject) Unref()
Unref decresaes the ref count on this object by one.
type MiniObjectFlags ¶
type MiniObjectFlags int
MiniObjectFlags casts GstMiniObjectFlags to a go type.
const ( MiniObjectFlagLockable MiniObjectFlags = C.GST_MINI_OBJECT_FLAG_LOCKABLE // (1) – the object can be locked and unlocked with gst_mini_object_lock and gst_mini_object_unlock. MiniObjectFlagLockReadOnly MiniObjectFlags = C.GST_MINI_OBJECT_FLAG_LOCK_READONLY // (2) – the object is permanently locked in READONLY mode. Only read locks can be performed on the object. MiniObjectFlagMayBeLeaked MiniObjectFlags = C.GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED // (4) – the object is expected to stay alive even after gst_deinit has been called and so should be ignored by leak detection tools. (Since: 1.10) MiniObjectFlagLast MiniObjectFlags = C.GST_MINI_OBJECT_FLAG_LAST // (16) – first flag that can be used by subclasses. )
Type casting of mini-object flags
type Object ¶
type Object struct{ *glib.InitiallyUnowned }
Object is a go representation of a GstObject. Type casting stops here and we do not descend into the glib library.
func (*Object) Class ¶
func (o *Object) Class() *C.GObjectClass
Class returns the GObjectClass of this instance.
func (*Object) Interfaces ¶
Interfaces returns the interfaces associated with this object.
func (*Object) ListProperties ¶
func (o *Object) ListProperties() []*ParameterSpec
ListProperties returns a list of the properties associated with this object. The default values assumed in the parameter spec reflect the values currently set in this object, or their defaults.
Unref after usage.
type Pad ¶
type Pad struct{ *Object }
Pad is a go representation of a GstPad
func (*Pad) CurrentCaps ¶
CurrentCaps returns the caps for this Pad or nil.
func (*Pad) Direction ¶
func (p *Pad) Direction() PadDirection
Direction returns the direction of this pad.
func (*Pad) Template ¶
func (p *Pad) Template() *PadTemplate
Template returns the template for this pad or nil.
type PadDirection ¶
type PadDirection int
PadDirection is a cast of GstPadDirection to a go type.
const ( PadUnknown PadDirection = C.GST_PAD_UNKNOWN // (0) - the direction is unknown PadSource PadDirection = C.GST_PAD_SRC // (1) - the pad is a source pad PadSink PadDirection = C.GST_PAD_SINK // (2) - the pad is a sink pad )
Type casting of pad directions
func (PadDirection) String ¶
func (p PadDirection) String() string
String implements a Stringer on PadDirection.
type PadLinkReturn ¶
type PadLinkReturn int
PadLinkReturn os a representation of GstPadLinkReturn.
const ( PadLinkOK PadLinkReturn = C.GST_PAD_LINK_OK PadLinkWrongHierarchy PadLinkReturn = C.GST_PAD_LINK_WRONG_HIERARCHY PadLinkWasLinked PadLinkReturn = C.GST_PAD_LINK_WAS_LINKED PadLinkWrongDirection PadLinkReturn = C.GST_PAD_LINK_WRONG_DIRECTION PadLinkNoFormat PadLinkReturn = C.GST_PAD_LINK_NOFORMAT PadLinkNoSched PadLinkReturn = C.GST_PAD_LINK_NOSCHED PadLinkRefused PadLinkReturn = C.GST_PAD_LINK_REFUSED )
Type casts for PadLinkReturns.
type PadPresence ¶
type PadPresence int
PadPresence is a cast of GstPadPresence to a go type.
const ( PadAlways PadPresence = C.GST_PAD_ALWAYS // (0) - the pad is always available PadSometimes PadPresence = C.GST_PAD_SOMETIMES // (1) - the pad will become available depending on the media stream PadRequest PadPresence = C.GST_PAD_REQUEST // (2) - the pad is only available on request with gst_element_request_pad. )
Type casting of pad presences
func (PadPresence) String ¶
func (p PadPresence) String() string
String implements a stringer on PadPresence.
type PadTemplate ¶
type PadTemplate struct{ *Object }
PadTemplate is a go representation of a GstPadTemplate
func (*PadTemplate) Caps ¶
func (p *PadTemplate) Caps() *Caps
Caps returns the caps of the pad template.
func (*PadTemplate) Direction ¶
func (p *PadTemplate) Direction() PadDirection
Direction returns the direction of the pad template.
func (*PadTemplate) Instance ¶
func (p *PadTemplate) Instance() *C.GstPadTemplate
Instance returns the underlying C GstPadTemplate.
func (*PadTemplate) Name ¶
func (p *PadTemplate) Name() string
Name returns the name of the pad template.
func (*PadTemplate) Presence ¶
func (p *PadTemplate) Presence() PadPresence
Presence returns the presence of the pad template.
type ParameterFlags ¶
type ParameterFlags int
ParameterFlags is a go cast of GParamFlags.
func (ParameterFlags) GstFlagsString ¶
func (p ParameterFlags) GstFlagsString() string
GstFlagsString returns a string of the flags that are relevant specifically to gstreamer.
func (ParameterFlags) Has ¶
func (p ParameterFlags) Has(b ParameterFlags) bool
Has returns true if these flags contain the provided ones.
func (ParameterFlags) String ¶
func (p ParameterFlags) String() string
type ParameterSpec ¶
type ParameterSpec struct { Name string Blurb string Flags ParameterFlags ValueType glib.Type OwnerType glib.Type DefaultValue *glib.Value // contains filtered or unexported fields }
ParameterSpec is a go representation of a C GParamSpec
func (*ParameterSpec) DoubleRange ¶
func (p *ParameterSpec) DoubleRange() (float64, float64)
DoubleRange returns the range of the Double stored in this parameter spec.
func (*ParameterSpec) FloatRange ¶
func (p *ParameterSpec) FloatRange() (float64, float64)
FloatRange returns the range of the Float stored in this parameter spec.
func (*ParameterSpec) GetCaps ¶
func (p *ParameterSpec) GetCaps() *Caps
GetCaps returns the caps in this parameter if it is of type GST_TYPE_CAPS.
func (*ParameterSpec) GetDefaultFlags ¶
func (p *ParameterSpec) GetDefaultFlags() int
GetDefaultFlags returns the default flags for this parameter spec.
func (*ParameterSpec) GetEnumValues ¶
func (p *ParameterSpec) GetEnumValues() []*EnumValue
GetEnumValues returns the possible enum values for this parameter.
func (*ParameterSpec) GetFlagValues ¶
func (p *ParameterSpec) GetFlagValues() []*FlagsValue
GetFlagValues returns the possible flags for this parameter.
func (*ParameterSpec) Int64Range ¶
func (p *ParameterSpec) Int64Range() (int64, int64)
Int64Range returns the range of the Int64 stored in this parameter spec.
func (*ParameterSpec) IntRange ¶
func (p *ParameterSpec) IntRange() (int, int)
IntRange returns the range of the Int stored in this parameter spec.
func (*ParameterSpec) IsBoxed ¶
func (p *ParameterSpec) IsBoxed() bool
IsBoxed returns true if this parameter contains a boxed object.
func (*ParameterSpec) IsCaps ¶
func (p *ParameterSpec) IsCaps() bool
IsCaps returns true if this parameter contains a caps object.
func (*ParameterSpec) IsEnum ¶
func (p *ParameterSpec) IsEnum() bool
IsEnum returns true if this parameter contains an enum.
func (*ParameterSpec) IsFlags ¶
func (p *ParameterSpec) IsFlags() bool
IsFlags returns true if this paramater contains flags.
func (*ParameterSpec) IsFraction ¶
func (p *ParameterSpec) IsFraction() bool
IsFraction returns true if this parameter contains a fraction.
func (*ParameterSpec) IsGstArray ¶
func (p *ParameterSpec) IsGstArray() bool
IsGstArray returns true if this parameter contains a Gst array.
func (*ParameterSpec) IsObject ¶
func (p *ParameterSpec) IsObject() bool
IsObject returns true if this parameter contains an object.
func (*ParameterSpec) IsPointer ¶
func (p *ParameterSpec) IsPointer() bool
IsPointer returns true if this paramater contains a pointer.
func (*ParameterSpec) UInt64Range ¶
func (p *ParameterSpec) UInt64Range() (uint64, uint64)
UInt64Range returns the range of the Uint64 stored in this parameter spec.
func (*ParameterSpec) UIntRange ¶
func (p *ParameterSpec) UIntRange() (uint, uint)
UIntRange returns the range of the Uint stored in this parameter spec.
type Pipeline ¶
type Pipeline struct { *Bin // contains filtered or unexported fields }
Pipeline is a go implementation of a GstPipeline.
func NewPipeline ¶
NewPipeline allocates and returns a new empty pipeline. If name is empty, one is generated by gstreamer.
func NewPipelineFromString ¶
NewPipelineFromString creates a new gstreamer pipeline from the given launch string.
func (*Pipeline) Destroy ¶
Destroy will attempt to stop the pipeline and then unref once the stream has fully completed.
func (*Pipeline) GetPipelineBus ¶ added in v0.0.2
GetPipelineBus returns the message bus for this pipeline.
func (*Pipeline) GetPipelineClock ¶ added in v0.0.2
GetPipelineClock returns the global clock for this pipeline.
func (*Pipeline) Instance ¶
func (p *Pipeline) Instance() *C.GstPipeline
Instance returns the native GstPipeline instance.
func (*Pipeline) SetAutoFlushBus ¶ added in v0.0.2
SetAutoFlushBus can be used to disable automatically flushing the message bus when a pipeline goes to StateNull.
Usually, when a pipeline goes from READY to NULL state, it automatically flushes all pending messages on the bus, which is done for refcounting purposes, to break circular references.
This means that applications that update state using (async) bus messages (e.g. do certain things when a pipeline goes from PAUSED to READY) might not get to see messages when the pipeline is shut down, because they might be flushed before they can be dispatched in the main thread. This behaviour can be disabled using this function.
It is important that all messages on the bus are handled when the automatic flushing is disabled else memory leaks will be introduced.
type Plugin ¶
type Plugin struct{ *Object }
Plugin is a go representation of a GstPlugin.
func (*Plugin) Description ¶
Description returns the description for this plugin.
type PluginFeature ¶
type PluginFeature struct{ *Object }
PluginFeature wraps the C GstPluginFeature.
func (*PluginFeature) GetPlugin ¶
func (p *PluginFeature) GetPlugin() *Plugin
GetPlugin returns the plugin that provides this feature or nil. Unref after usage.
func (*PluginFeature) GetPluginName ¶
func (p *PluginFeature) GetPluginName() string
GetPluginName returns the name of the plugin that provides this feature.
func (*PluginFeature) Instance ¶
func (p *PluginFeature) Instance() *C.GstPluginFeature
Instance returns the underlying GstPluginFeature instance
type Registry ¶
type Registry struct{ *Object }
Registry is a go representation of a GstRegistry.
func (*Registry) FindPlugin ¶
FindPlugin retrieves the plugin by the given name. Unref after usage.
func (*Registry) Instance ¶
func (r *Registry) Instance() *C.GstRegistry
Instance returns the underlying GstRegistry instance.
func (*Registry) LookupFeature ¶
func (r *Registry) LookupFeature(name string) (*PluginFeature, error)
LookupFeature looks up the given plugin feature by name. Unref after usage.
type Sample ¶
type Sample struct {
// contains filtered or unexported fields
}
Sample is a go wrapper around a GstSample object.
func FromGstSampleUnsafe ¶ added in v0.0.3
FromGstSampleUnsafe wraps the pointer to the given C GstSample with the go type. This is meant for internal usage and is exported for visibility to other packages.
type SeekFlags ¶
type SeekFlags int
SeekFlags is a representation of GstSeekFlags.
const ( SeekFlagNone SeekFlags = C.GST_SEEK_FLAG_NONE SeekFlagFlush SeekFlags = C.GST_SEEK_FLAG_FLUSH SeekFlagAccurate SeekFlags = C.GST_SEEK_FLAG_ACCURATE SeekFlagKeyUnit SeekFlags = C.GST_SEEK_FLAG_KEY_UNIT SeekFlagSegment SeekFlags = C.GST_SEEK_FLAG_SEGMENT SeekFlagSkip SeekFlags = C.GST_SEEK_FLAG_SKIP SeekFlagSnapBefore SeekFlags = C.GST_SEEK_FLAG_SNAP_BEFORE SeekFlagSnapAfter SeekFlags = C.GST_SEEK_FLAG_SNAP_AFTER SeekFlagSnapNearest SeekFlags = C.GST_SEEK_FLAG_SNAP_NEAREST )
Type casts of SeekFlags
type SeekType ¶
type SeekType int
SeekType is a representation of GstSeekType.
const ( SeekTypeNone SeekType = C.GST_SEEK_TYPE_NONE SeekTypeSet SeekType = C.GST_SEEK_TYPE_SET SeekTypeEnd SeekType = C.GST_SEEK_TYPE_END )
Type casts of seek types
type State ¶
type State int
State is a type cast of the C GstState
const ( VoidPending State = C.GST_STATE_VOID_PENDING // (0) – no pending state. StateNull State = C.GST_STATE_NULL // (1) – the NULL state or initial state of an element. StateReady State = C.GST_STATE_READY // (2) – the element is ready to go to PAUSED. StatePaused State = C.GST_STATE_PAUSED // (3) – the element is PAUSED, it is ready to accept and process data. Sink elements however only accept one buffer and then block. StatePlaying State = C.GST_STATE_PLAYING // (4) – the element is PLAYING, the GstClock is running and the data is flowing. )
Type casting for GstStates
type StateChangeReturn ¶
type StateChangeReturn int
StateChangeReturn is a representation of GstStateChangeReturn.
const ( StateChangeFailure StateChangeReturn = C.GST_STATE_CHANGE_FAILURE StateChangeSuccess StateChangeReturn = C.GST_STATE_CHANGE_SUCCESS StateChangeAsync StateChangeReturn = C.GST_STATE_CHANGE_ASYNC StateChangeNoPreroll StateChangeReturn = C.GST_STATE_CHANGE_NO_PREROLL )
Type casts of state change returns
type Structure ¶
type Structure struct {
// contains filtered or unexported fields
}
Structure is a go implementation of a C GstStructure.
func NewStructure ¶
NewStructure returns a new empty structure with the given name.
func NewStructureFromString ¶
NewStructureFromString builds a new GstStructure from the given string.
func StructureFromGValue ¶
StructureFromGValue extracts the GstStructure from a glib.Value, or nil if one does not exist.
func (*Structure) Free ¶
func (s *Structure) Free()
Free frees the memory for the underlying GstStructure.
func (*Structure) Instance ¶
func (s *Structure) Instance() *C.GstStructure
Instance returns the native GstStructure instance.
func (*Structure) RemoveValue ¶
RemoveValue removes the value at the given key. If the key does not exist, the structure is unchanged.
Source Files
¶
- c_util.go
- doc.go
- gst_bin.go
- gst_buffer.go
- gst_bus.go
- gst_caps.go
- gst_clock.go
- gst_constants.go
- gst_element.go
- gst_element_factory.go
- gst_memory.go
- gst_message.go
- gst_mini_object.go
- gst_object.go
- gst_pad.go
- gst_parameter_spec.go
- gst_pipeline.go
- gst_plugin.go
- gst_plugin_feature.go
- gst_registry.go
- gst_sample.go
- gst_structure.go
- gst_uri.go
- gst_wrappers.go
- init.go
- pkg_config.go
Directories
¶
Path | Synopsis |
---|---|
Package app contains bindings for the gstreamer-app C API.
|
Package app contains bindings for the gstreamer-app C API. |
Package gstauto contains helper methods and objects for building pipelines that satisfy most use cases.
|
Package gstauto contains helper methods and objects for building pipelines that satisfy most use cases. |
app
Package app provides interfaces from the gstauto package that use the gstreamer-app library for interacting with either end of the pipeline.
|
Package app provides interfaces from the gstauto package that use the gstreamer-app library for interacting with either end of the pipeline. |