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 BufferingStats
- type Bus
- type BusWatchFunc
- 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() ClockTime
- func (c *Clock) IsSynced() bool
- func (c *Clock) String() string
- func (c *Clock) Time() ClockTime
- type ClockTime
- type Device
- func (d *Device) Caps() *Caps
- func (d *Device) CreateElement(name string) *Element
- func (d *Device) DeviceClass() string
- func (d *Device) DisplayName() string
- func (d *Device) HasClasses(classes []string) bool
- func (d *Device) Instance() *C.GstDevice
- func (d *Device) Properties() *Structure
- func (d *Device) ReconfigureElement(elem *Element) error
- 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 GError
- type GhostPad
- type MainContext
- type MainLoop
- 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) NumRedirectEntries() int64
- func (m *Message) ParseAsyncDone() time.Duration
- func (m *Message) ParseBuffering() int
- func (m *Message) ParseBufferingStats() *BufferingStats
- func (m *Message) ParseClockProvide() (clock *Clock, ready bool)
- func (m *Message) ParseDeviceAdded() *Device
- func (m *Message) ParseDeviceChanged() (newDevice, oldDevice *Device)
- func (m *Message) ParseDeviceRemoved() *Device
- func (m *Message) ParseError() *GError
- func (m *Message) ParseInfo() *GError
- func (m *Message) ParseNewClock() *Clock
- func (m *Message) ParseProgress() (progressType ProgressType, code, text string)
- func (m *Message) ParsePropertyNotify() (obj *Object, propertName string, propertyValue *glib.Value)
- func (m *Message) ParseQoS() *QoSValues
- func (m *Message) ParseRedirectEntryAt(idx int64) (location string, tags *TagList, structure *Structure)
- func (m *Message) ParseRequestState() State
- func (m *Message) ParseResetTime() time.Duration
- func (m *Message) ParseSegmentDone() (Format, int64)
- func (m *Message) ParseSegmentStart() (Format, int64)
- func (m *Message) ParseStateChanged() (oldState, newState State)
- func (m *Message) ParseStepDone() *StepDoneValues
- func (m *Message) ParseStepStart() *StepStartValues
- func (m *Message) ParseStreamCollection() *StreamCollection
- func (m *Message) ParseStreamStatus() (StreamStatusType, *Element)
- func (m *Message) ParseStreamsSelected() *StreamCollection
- func (m *Message) ParseStructureChange() (chgType StructureChangeType, owner *Element, busy bool)
- func (m *Message) ParseTags() *TagList
- func (m *Message) ParseWarning() *GError
- func (m *Message) Ref() *Message
- func (m *Message) Source() string
- func (m *Message) String() string
- 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 ProgressType
- type QoSValues
- type Registry
- type Sample
- type SeekFlags
- type SeekType
- type State
- type StateChangeReturn
- type StepDoneValues
- type StepStartValues
- type Stream
- func (s *Stream) Caps() *Caps
- func (s *Stream) Instance() *C.GstStream
- func (s *Stream) SetCaps(caps *Caps)
- func (s *Stream) SetStreamFlags(flags StreamFlags)
- func (s *Stream) SetStreamType(sType StreamType)
- func (s *Stream) SetTags(tags *TagList)
- func (s *Stream) StreamFlags() StreamFlags
- func (s *Stream) StreamID() string
- func (s *Stream) StreamType() StreamType
- func (s *Stream) Tags() *TagList
- type StreamCollection
- type StreamFlags
- type StreamStatusType
- type StreamType
- 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 StructureChangeType
- type TagList
- type ToC
- 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) or an otherwise unknown value. ClockTimeNone ClockTime = C.GST_CLOCK_TIME_NONE )
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 // (0) – a small amount of data is buffered BufferingDownload BufferingMode = C.GST_BUFFERING_DOWNLOAD // (1) – the stream is being downloaded BufferingTimeshift BufferingMode = C.GST_BUFFERING_TIMESHIFT // (2) – the stream is being downloaded in a ringbuffer BufferingLive BufferingMode = C.GST_BUFFERING_LIVE // (3) – the stream is a live stream )
Type casts of buffering modes
func (BufferingMode) String ¶ added in v0.0.8
func (b BufferingMode) String() string
String implements a stringer on a BufferingMode.
type BufferingStats ¶ added in v0.0.8
type BufferingStats struct { // The buffering mode BufferingMode BufferingMode // The average input rate AverageIn int // The average output rate AverageOut int // Amount of time until buffering is complete BufferingLeft time.Duration }
BufferingStats represents the buffering stats as retrieved from a GST_MESSAGE_TYPE_BUFFERING.
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) AddWatch ¶ added in v0.0.8
func (b *Bus) AddWatch(busFunc BusWatchFunc) bool
AddWatch adds a watch to the default MainContext for messages emitted on this bus. This function is used to receive asynchronous messages in the main loop. There can only be a single bus watch per bus, you must remove it before you can set a new one. It is safe to unref the Bus after setting this watch, since the watch itself will take it's own reference to the Bus.
The watch can be removed either by returning false from the function or by using RemoveWatch(). A MainLoop must be running for bus watches to work.
The return value reflects whether the watch was successfully added. False is returned if there is already a function registered.
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.
It is much safer and easier to use the AddWatch method. Only use this method if you are unable to also run a MainLoop.
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.
It is much safer and easier to use the AddWatch method. Only use this method if you are unable to also run a MainLoop.
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.
It is much safer and easier to use the AddWatch method. Only use this method if you are unable to also run a MainLoop.
func (*Bus) RemoveWatch ¶ added in v0.0.8
RemoveWatch will remove any watches installed on the bus. This can also be accomplished by returning false from a previously installed function.
The function returns false if there was no watch on the bus.
type BusWatchFunc ¶ added in v0.0.8
BusWatchFunc is a go representation of a GstBusFunc. It takes a message as a single argument and returns a bool value for whether to continue processing messages or not. There is no need to unref the message unless addtional references are placed on it during processing.
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 ClockTime ¶ added in v0.0.8
type ClockTime uint64
ClockTime is a go representation of a GstClockTime. Most of the time these are casted to time.Duration objects. It represents a time value in nanoseconds.
type Device ¶ added in v0.0.8
type Device struct{ *Object }
Device is a Go representation of a GstDevice.
func (*Device) Caps ¶ added in v0.0.8
Caps returns the caps that this device supports. Unref after usage.
func (*Device) CreateElement ¶ added in v0.0.8
CreateElement creates a new element with all the required parameters set to use this device. If name is empty, one is automatically generated.
func (*Device) DeviceClass ¶ added in v0.0.8
DeviceClass gets the "class" of a device. This is a "/" separated list of classes that represent this device. They are a subset of the classes of the GstDeviceProvider that produced this device.
func (*Device) DisplayName ¶ added in v0.0.8
DisplayName gets the user-friendly name of the device.
func (*Device) HasClasses ¶ added in v0.0.8
HasClasses checks if device matches all of the given classes.
func (*Device) Properties ¶ added in v0.0.8
Properties gets the extra properties of the device.
func (*Device) ReconfigureElement ¶ added in v0.0.8
ReconfigureElement tries to reconfigure an existing element to use the device. If this function fails, then one must destroy the element and create a new one using Device.CreateElement().
Note: This should only be implemented for elements that can change their device while in the PLAYING state.
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 // (0) – undefined format FormatDefault Format = C.GST_FORMAT_DEFAULT // (1) – the default format of the pad/element. This can be samples for raw audio, or frames/fields for raw video. FormatBytes Format = C.GST_FORMAT_BYTES // (2) - bytes FormatTime Format = C.GST_FORMAT_TIME // (3) – time in nanoseconds )
Type casts of formats
type GError ¶ added in v0.0.8
type GError struct {
// contains filtered or unexported fields
}
GError is a Go wrapper for a C GError. It implements the error interface and provides additional functions for retrieving debug strings and details.
func (*GError) DebugString ¶ added in v0.0.8
DebugString returns any debug info alongside the error.
func (*GError) Error ¶ added in v0.0.8
Error implements the error interface and returns the error message.
type MainContext ¶ added in v0.0.8
type MainContext struct {
// contains filtered or unexported fields
}
MainContext is a go representation of a GMainContext. Most of the time you will just want to use the default GMainContext which can be specified either via DefaultMainContext() or by passing nil to any function that requires it.
func DefaultMainContext ¶ added in v0.0.8
func DefaultMainContext() *MainContext
DefaultMainContext returns the default main context.
func NewMainContext ¶ added in v0.0.8
func NewMainContext() *MainContext
NewMainContext returns a new main context. This object is still not fully implemented and most of the time you will want to use the DefaultMainContext, or nil, when required.
func (*MainContext) Instance ¶ added in v0.0.8
func (m *MainContext) Instance() *C.GMainContext
Instance returns the underlying GMainContext instance.
func (*MainContext) Iteration ¶ added in v0.0.8
func (m *MainContext) Iteration(mayBlock bool) bool
Iteration runs a single iteration for the given main loop. This involves checking to see if any event sources are ready to be processed.
If no events sources are ready AND mayBlock is TRUE, it waits for a source to become ready, then dispatches the highest priority events sources that are ready.
Otherwise, if mayBlock is FALSE it does not wait for sources to become ready, only those highest priority events sources will be dispatched (if any), and then the function will return.
The return value reflects whether or not any event sources were dispatched.
func (*MainContext) Pending ¶ added in v0.0.8
func (m *MainContext) Pending() bool
Pending checks if any sources have pending events for this context.
func (*MainContext) Ref ¶ added in v0.0.8
func (m *MainContext) Ref() *MainContext
Ref increases the reference count on a GMainContext object by one.
func (*MainContext) Unref ¶ added in v0.0.8
func (m *MainContext) Unref()
Unref decreases the reference count on a GMainContext object by one. If the result is zero, it frees the context and all associated memory.
func (*MainContext) Wakeup ¶ added in v0.0.8
func (m *MainContext) Wakeup()
Wakeup either stops a currently running Iteration() or the next Iteration() from blocking.
type MainLoop ¶ added in v0.0.8
type MainLoop struct {
// contains filtered or unexported fields
}
MainLoop is a go representation of a GMainLoop. It can be used to block execution while a pipeline is running, and also allows for event sources and signals to be used across gstreamer objects.
func NewMainLoop ¶ added in v0.0.8
func NewMainLoop(ctx *MainContext, isRunning bool) *MainLoop
NewMainLoop creates a new GMainLoop. If ctx is nil then the default context is used. If isRunning is true the loop will automatically start, however, this function will not block. To block on the loop itself you will still need to call MainLoop.Run().
A MainLoop is required when wishing to handle signals to/from elements asynchronously. Otherwise you will need to iterate on the DefaultMainContext (or an external created one) manually.
func (*MainLoop) GetContext ¶ added in v0.0.8
func (m *MainLoop) GetContext() *MainContext
GetContext returns the GMainContext for this loop.
func (*MainLoop) IsRunning ¶ added in v0.0.8
IsRunning returns true if this main loop is currently running.
func (*MainLoop) Quit ¶ added in v0.0.8
func (m *MainLoop) Quit()
Quit stops a MainLoop from running. Any calls to Run() for the loop will return. Note that sources that have already been dispatched when Quit() is called will still be executed.
func (*MainLoop) Ref ¶ added in v0.0.8
Ref increases the ref count on the main loop by one. It returns the original main loop for convenience in return functions.
func (*MainLoop) Run ¶ added in v0.0.8
func (m *MainLoop) Run()
Run a main loop until Quit() is called on the loop. If this is called from the thread of the loop's GMainContext, it will process events from the loop, otherwise it will simply wait.
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) NumRedirectEntries ¶ added in v0.0.8
NumRedirectEntries returns the number of redirect entries in a MessageRedirect.
func (*Message) ParseAsyncDone ¶ added in v0.0.8
ParseAsyncDone extracts the running time from the async task done message.
func (*Message) ParseBuffering ¶ added in v0.0.8
ParseBuffering extracts the buffering percent from the GstMessage.
func (*Message) ParseBufferingStats ¶ added in v0.0.8
func (m *Message) ParseBufferingStats() *BufferingStats
ParseBufferingStats extracts the buffering stats values from message.
func (*Message) ParseClockProvide ¶ added in v0.0.8
ParseClockProvide extracts the clock and ready flag from the GstMessage. The clock object returned remains valid until the message is freed.
func (*Message) ParseDeviceAdded ¶ added in v0.0.8
ParseDeviceAdded parses a device-added message. The device-added message is produced by GstDeviceProvider or a GstDeviceMonitor. It announces the appearance of monitored devices.
func (*Message) ParseDeviceChanged ¶ added in v0.0.8
ParseDeviceChanged Parses a device-changed message. The device-changed message is produced by GstDeviceProvider or a GstDeviceMonitor. It announces that a device's properties have changed. The first device returned is the updated Device, and the second changedDevice represents the old state of the device.
func (*Message) ParseDeviceRemoved ¶ added in v0.0.8
ParseDeviceRemoved parses a device-removed message. The device-removed message is produced by GstDeviceProvider or a GstDeviceMonitor. It announces the disappearance of monitored devices.
func (*Message) ParseError ¶
ParseError will return a GError 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) ParseNewClock ¶ added in v0.0.8
ParseNewClock parses the new Clock in the message. The clock object returned remains valid until the message is freed.
func (*Message) ParseProgress ¶ added in v0.0.8
func (m *Message) ParseProgress() (progressType ProgressType, code, text string)
ParseProgress parses the progress type, code and text.
func (*Message) ParsePropertyNotify ¶ added in v0.0.8
func (m *Message) ParsePropertyNotify() (obj *Object, propertName string, propertyValue *glib.Value)
ParsePropertyNotify parses a property-notify message. These will be posted on the bus only when set up with Element.AddPropertyNotifyWatch (TODO) or Element.AddPropertyDeepNotifyWatch (TODO).
func (*Message) ParseQoS ¶ added in v0.0.8
ParseQoS extracts the timestamps and live status from the QoS message. The values reflect those of the dropped buffer. Values of ClockTimeNone or -1 mean unknown values.
func (*Message) ParseRedirectEntryAt ¶ added in v0.0.8
func (m *Message) ParseRedirectEntryAt(idx int64) (location string, tags *TagList, structure *Structure)
ParseRedirectEntryAt parses the redirect entry at the given index. Total indices can be retrieved with NumRedirectEntries().
func (*Message) ParseRequestState ¶ added in v0.0.8
ParseRequestState parses the requests state from the message.
func (*Message) ParseResetTime ¶ added in v0.0.8
ParseResetTime extracts the running-time from the ResetTime message.
func (*Message) ParseSegmentDone ¶ added in v0.0.8
ParseSegmentDone extracts the position and format of the SegmentDone message.
func (*Message) ParseSegmentStart ¶ added in v0.0.8
ParseSegmentStart extracts the position and format of the SegmentStart message.
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) ParseStepDone ¶ added in v0.0.8
func (m *Message) ParseStepDone() *StepDoneValues
ParseStepDone extracts the values for the StepDone message.
func (*Message) ParseStepStart ¶ added in v0.0.8
func (m *Message) ParseStepStart() *StepStartValues
ParseStepStart extracts the values for the StepStart message.
func (*Message) ParseStreamCollection ¶ added in v0.0.8
func (m *Message) ParseStreamCollection() *StreamCollection
ParseStreamCollection parses a stream-collection message.
func (*Message) ParseStreamStatus ¶ added in v0.0.8
func (m *Message) ParseStreamStatus() (StreamStatusType, *Element)
ParseStreamStatus parses the stream status type of the message as well as the element that produced it. The element returned should NOT be unrefed.
func (*Message) ParseStreamsSelected ¶ added in v0.0.8
func (m *Message) ParseStreamsSelected() *StreamCollection
ParseStreamsSelected parses a streams-selected message.
func (*Message) ParseStructureChange ¶ added in v0.0.8
func (m *Message) ParseStructureChange() (chgType StructureChangeType, owner *Element, busy bool)
ParseStructureChange extracts the change type and completion status from the GstMessage. If the returned bool is true, the change is still in progress.
func (*Message) ParseTags ¶ added in v0.0.8
ParseTags extracts the tag list from the GstMessage. Tags are copied and should be unrefed after usage.
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) String ¶ added in v0.0.8
String implements a stringer on the message. It iterates over the type of the message and applies the correct parser, then dumps a string of the basic contents of the message. This function can be expensive and should only be used for debugging purposes or in routines where latency is not a concern.
This stringer really just helps in keeping track of making sure all message types are accounted for in some way. It's the devil, writing it was the devil, and I hope you enjoy being able to `fmt.Println(msg)`.
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. See the official documentation for definitions of the messages: https://gstreamer.freedesktop.org/documentation/gstreamer/gstmessage.html?gi-language=c#GstMessageType
const ( MessageUnknown MessageType = C.GST_MESSAGE_UNKNOWN MessageEOS MessageType = C.GST_MESSAGE_EOS MessageError MessageType = C.GST_MESSAGE_ERROR MessageWarning MessageType = C.GST_MESSAGE_WARNING MessageInfo MessageType = C.GST_MESSAGE_INFO MessageTag MessageType = C.GST_MESSAGE_TAG MessageBuffering MessageType = C.GST_MESSAGE_BUFFERING MessageStateChanged MessageType = C.GST_MESSAGE_STATE_CHANGED MessageStateDirty MessageType = C.GST_MESSAGE_STATE_DIRTY MessageStepDone MessageType = C.GST_MESSAGE_STEP_DONE MessageClockProvide MessageType = C.GST_MESSAGE_CLOCK_PROVIDE MessageClockLost MessageType = C.GST_MESSAGE_CLOCK_LOST MessageNewClock MessageType = C.GST_MESSAGE_NEW_CLOCK MessageStructureChange MessageType = C.GST_MESSAGE_STRUCTURE_CHANGE MessageStreamStatus MessageType = C.GST_MESSAGE_STREAM_STATUS MessageApplication MessageType = C.GST_MESSAGE_APPLICATION MessageElement MessageType = C.GST_MESSAGE_ELEMENT MessageSegmentStart MessageType = C.GST_MESSAGE_SEGMENT_START MessageSegmentDone MessageType = C.GST_MESSAGE_SEGMENT_DONE MessageDurationChanged MessageType = C.GST_MESSAGE_DURATION_CHANGED MessageLatency MessageType = C.GST_MESSAGE_LATENCY MessageAsyncStart MessageType = C.GST_MESSAGE_ASYNC_START MessageAsyncDone MessageType = C.GST_MESSAGE_ASYNC_DONE MessageRequestState MessageType = C.GST_MESSAGE_REQUEST_STATE MessageStepStart MessageType = C.GST_MESSAGE_STEP_START MessageQoS MessageType = C.GST_MESSAGE_QOS MessageProgress MessageType = C.GST_MESSAGE_PROGRESS MessageTOC MessageType = C.GST_MESSAGE_TOC MessageResetTime MessageType = C.GST_MESSAGE_RESET_TIME MessageStreamStart MessageType = C.GST_MESSAGE_STREAM_START MessageNeedContext MessageType = C.GST_MESSAGE_NEED_CONTEXT MessageHaveContext MessageType = C.GST_MESSAGE_HAVE_CONTEXT MessageExtended MessageType = C.GST_MESSAGE_EXTENDED MessageDeviceAdded MessageType = C.GST_MESSAGE_DEVICE_ADDED MessageDeviceRemoved MessageType = C.GST_MESSAGE_DEVICE_REMOVED MessagePropertyNotify MessageType = C.GST_MESSAGE_PROPERTY_NOTIFY MessageStreamCollection MessageType = C.GST_MESSAGE_STREAM_COLLECTION MessageStreamsSelected MessageType = C.GST_MESSAGE_STREAMS_SELECTED MessageRedirect MessageType = C.GST_MESSAGE_REDIRECT MessageDeviceChanged MessageType = C.GST_MESSAGE_DEVICE_CHANGED MessageAny MessageType = C.GST_MESSAGE_ANY )
Type casting of GstMessageTypes See the official documentation for definitions of the messages: https://gstreamer.freedesktop.org/documentation/gstreamer/gstmessage.html?gi-language=c#GstMessageType
func (MessageType) String ¶ added in v0.0.8
func (m MessageType) String() string
String implements a stringer on MessageTypes
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 ProgressType ¶ added in v0.0.8
type ProgressType int
ProgressType is a go representation of a GstProgressType
const ( ProgressTypeStart ProgressType = C.GST_PROGRESS_TYPE_START // (0) – A new task started. ProgressTypeContinue ProgressType = C.GST_PROGRESS_TYPE_CONTINUE // (1) – A task completed and a new one continues. ProgressTypeComplete ProgressType = C.GST_PROGRESS_TYPE_COMPLETE // (2) – A task completed. ProgressTypeCancelled ProgressType = C.GST_PROGRESS_TYPE_CANCELED // (3) – A task was canceled. ProgressTypeError ProgressType = C.GST_PROGRESS_TYPE_ERROR // (4) – A task caused an error. An error message is also posted on the bus. )
Type castings of ProgressTypes
func (ProgressType) String ¶ added in v0.0.8
func (p ProgressType) String() string
String implements a stringer on ProgressTypes
type QoSValues ¶ added in v0.0.8
type QoSValues struct { // If the message was generated by a live element Live bool // The running time of the buffer that generated the message RunningTime time.Duration // The stream time of the buffer that generated the message StreamTime time.Duration // The timestamps of the buffer that generated the message Timestamp ClockTime // The duration of the buffer that generated the message Duration time.Duration }
QoSValues represents the values inside a QoS message.
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 StepDoneValues ¶ added in v0.0.8
type StepDoneValues struct { Format Format Amount uint64 Rate float64 Flush bool Intermediate bool Duration time.Duration EOS bool }
StepDoneValues represents the values inside a StepDone message.
type StepStartValues ¶ added in v0.0.8
type StepStartValues struct { Active bool Format Format Amount uint64 Rate float64 Flush bool Intermediate bool }
StepStartValues represents the values inside a StepStart message.
type Stream ¶ added in v0.0.8
type Stream struct{ *Object }
Stream is a Go representation of a GstStream.
func NewStream ¶ added in v0.0.8
func NewStream(id string, caps *Caps, sType StreamType, flags StreamFlags) *Stream
NewStream returns a new Stream with the given ID, caps, type, and flags.
func (*Stream) SetStreamFlags ¶ added in v0.0.8
func (s *Stream) SetStreamFlags(flags StreamFlags)
SetStreamFlags sets the flags for this stream.
func (*Stream) SetStreamType ¶ added in v0.0.8
func (s *Stream) SetStreamType(sType StreamType)
SetStreamType sets the type of this stream.
func (*Stream) StreamFlags ¶ added in v0.0.8
func (s *Stream) StreamFlags() StreamFlags
StreamFlags returns the flags for this stream.
func (*Stream) StreamType ¶ added in v0.0.8
func (s *Stream) StreamType() StreamType
StreamType returns the type of this stream.
type StreamCollection ¶ added in v0.0.8
type StreamCollection struct{ *Object }
StreamCollection is a Go representation of a GstStreamCollection.
func NewStreamCollection ¶ added in v0.0.8
func NewStreamCollection(upstreamID string) *StreamCollection
NewStreamCollection returns a new StreamCollection with an upstream parent of the given stream ID.
func (*StreamCollection) AddStream ¶ added in v0.0.8
func (s *StreamCollection) AddStream(stream *Stream) error
AddStream adds the given stream to this collection.
func (*StreamCollection) GetSize ¶ added in v0.0.8
func (s *StreamCollection) GetSize() uint
GetSize returns the size of this stream collection.
func (*StreamCollection) GetStreamAt ¶ added in v0.0.8
func (s *StreamCollection) GetStreamAt(idx uint) *Stream
GetStreamAt returns the stream at the given index in this collection.
func (*StreamCollection) GetUpstreamID ¶ added in v0.0.8
func (s *StreamCollection) GetUpstreamID() string
GetUpstreamID retrieves the upstream ID for this collection.
func (*StreamCollection) Instance ¶ added in v0.0.8
func (s *StreamCollection) Instance() *C.GstStreamCollection
Instance returns the underlying GstStreamCollection.
type StreamFlags ¶ added in v0.0.8
type StreamFlags int
StreamFlags represent configuration options for a new stream.
const ( StreamFlagNone StreamFlags = C.GST_STREAM_FLAG_NONE // (0) – This stream has no special attributes StreamFlagSparse StreamFlags = C.GST_STREAM_FLAG_SPARSE // (1) – This stream is a sparse stream (e.g. a subtitle stream), data may flow only in irregular intervals with large gaps in between. StreamFlagSelect StreamFlags = C.GST_STREAM_FLAG_SELECT // (2) – This stream should be selected by default. This flag may be used by demuxers to signal that a stream should be selected by default in a playback scenario. StreamFlagUnselect StreamFlags = C.GST_STREAM_FLAG_UNSELECT // (4) – This stream should not be selected by default. This flag may be used by demuxers to signal that a stream should not be selected by default in a playback scenario, but only if explicitly selected by the user (e.g. an audio track for the hard of hearing or a director's commentary track). )
Type castings of StreamFlags
type StreamStatusType ¶ added in v0.0.8
type StreamStatusType int
StreamStatusType represents a type of change in a stream's status
const ( StreamStatusCreate StreamStatusType = C.GST_STREAM_STATUS_TYPE_CREATE // (0) – A new thread need to be created. StreamStatusEnter StreamStatusType = C.GST_STREAM_STATUS_TYPE_ENTER // (1) – a thread entered its loop function StreamStatusLeave StreamStatusType = C.GST_STREAM_STATUS_TYPE_LEAVE // (2) – a thread left its loop function StreamStatusDestroy StreamStatusType = C.GST_STREAM_STATUS_TYPE_DESTROY // (3) – a thread is destroyed StreamStatusStart StreamStatusType = C.GST_STREAM_STATUS_TYPE_START // (8) – a thread is started StreamStatusPause StreamStatusType = C.GST_STREAM_STATUS_TYPE_PAUSE // (9) – a thread is paused StreamStatusStop StreamStatusType = C.GST_STREAM_STATUS_TYPE_STOP // (10) – a thread is stopped )
Type castings of the stream status types
func (StreamStatusType) String ¶ added in v0.0.8
func (s StreamStatusType) String() string
type StreamType ¶ added in v0.0.8
type StreamType int
StreamType is a go representation of a GstStreamType
const ( StreamTypeUnknown StreamType = C.GST_STREAM_TYPE_UNKNOWN // (1) – The stream is of unknown (unclassified) type. StreamTypeAudio StreamType = C.GST_STREAM_TYPE_AUDIO // (2) – The stream is of audio data StreamTypeVideo StreamType = C.GST_STREAM_TYPE_VIDEO // (4) – The stream carries video data StreamTypeContainer StreamType = C.GST_STREAM_TYPE_CONTAINER // (8) – The stream is a muxed container type StreamTypeText StreamType = C.GST_STREAM_TYPE_TEXT // (16) – The stream contains subtitle / subpicture data. )
Type castings of stream types
func (StreamType) String ¶ added in v0.0.8
func (s StreamType) String() string
String implements a stringer on StreamTypes.
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.
type StructureChangeType ¶ added in v0.0.8
type StructureChangeType int
StructureChangeType is a go representation of a GstStructureChangeType
const ( StructureChangePadLink StructureChangeType = C.GST_STRUCTURE_CHANGE_TYPE_PAD_LINK // (0) – Pad linking is starting or done. StructureChangePadUnlink StructureChangeType = C.GST_STRUCTURE_CHANGE_TYPE_PAD_UNLINK // (1) – Pad unlinking is starting or done. )
Type castings of StructureChangeTypes
func (StructureChangeType) String ¶ added in v0.0.8
func (s StructureChangeType) String() string
String implements a stringer on StructureChangeTypes.
type TagList ¶ added in v0.0.8
type TagList struct {
// contains filtered or unexported fields
}
TagList is a go wrapper around a GstTagList. For now, until the rest of the methods are implemnented, this struct is primarily used for retrieving serialized copies of the tags.
func (*TagList) Instance ¶ added in v0.0.8
func (t *TagList) Instance() *C.GstTagList
Instance returns the underlying GstTagList instance.
func (*TagList) NumValuesAt ¶ added in v0.0.8
NumValuesAt returns the number of tag values at the given tag key.
func (*TagList) String ¶ added in v0.0.8
String implements a stringer on the TagList and serializes it to a string.
Source Files
¶
- c_util.go
- doc.go
- g_error.go
- g_main_loop.go
- gst_bin.go
- gst_buffer.go
- gst_bus.go
- gst_caps.go
- gst_clock.go
- gst_constants.go
- gst_device.go
- gst_element.go
- gst_element_factory.go
- gst_memory.go
- gst_message.go
- gst_message_stringer.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_stream.go
- gst_stream_collection.go
- gst_structure.go
- gst_tag_list.go
- gst_toc.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. |