Documentation
¶
Overview ¶
Bindings for GStreamer API
Index ¶
- Constants
- Variables
- func Btoi(b bool) int
- func FilenameToURI(filename string) (string, error)
- func Free(ptr *Memory)
- func GetVersion() (int, int, int, int)
- func Itob(i int) bool
- type AppSink
- func (a *AppSink) AsAppSink() *AppSink
- func (a *AppSink) GetCaps() *Caps
- func (a *AppSink) GetDrop() bool
- func (a *AppSink) GetMaxBuffers() uint
- func (a *AppSink) PullSample() *Sample
- func (a *AppSink) SetCaps(caps *Caps)
- func (a *AppSink) SetDrop(drop bool)
- func (a *AppSink) SetEmitSignals(emit bool)
- func (a *AppSink) SetMaxBuffers(buffers int)
- func (a *AppSink) TryPullSample(timeout uint64) *Sample
- type AppSrc
- type BaseSink
- type BaseSrc
- type BaseTransform
- type Bin
- type Buffer
- func (b *Buffer) AppendMemory(memory *Memory)
- func (b *Buffer) Fill(offset uint, src unsafe.Pointer, size uint) int
- func (b *Buffer) GetDuration() uint64
- func (b *Buffer) GetSize() uint
- func (b *Buffer) Map(flags MapFlags) (bool, *MapInfo)
- func (b *Buffer) MemSet(offset uint, val byte, size uint) int
- func (b *Buffer) SetDTS(value uint64)
- func (b *Buffer) SetDuration(value uint64)
- func (b *Buffer) SetOffset(value uint64)
- func (b *Buffer) SetOffsetEnd(value uint64)
- func (b *Buffer) SetPTS(value uint64)
- func (b *Buffer) Unmap(mi *MapInfo)
- func (b *Buffer) Unref()
- type BufferPool
- type Bus
- func (b *Bus) AddSignalWatch()
- func (b *Bus) AddSignalWatchFull(priority int)
- func (b *Bus) AsBus() *Bus
- func (b *Bus) DisableSyncMessageEmission()
- func (b *Bus) EnableSyncMessageEmission()
- func (b *Bus) HavePending() bool
- func (b *Bus) Peek() *Message
- func (b *Bus) Poll(events MessageType, timeout int64) *Message
- func (b *Bus) Pop() *Message
- func (b *Bus) PopFiltered(types MessageType) *Message
- func (b *Bus) Post(msg *Message) bool
- func (b *Bus) RemoveSignalWatch()
- func (b *Bus) SetFlushing(flushing bool)
- func (b *Bus) TimedPop(timeout uint64) *Message
- func (b *Bus) TimedPopFiltered(timeout uint64, types MessageType) *Message
- type Caps
- type CapsFilter
- type Clock
- type Element
- func (e *Element) AddPad(p *Pad) bool
- func (e *Element) AsElement() *Element
- func (e *Element) GetBus() *Bus
- func (e *Element) GetRequestPad(name string) *Pad
- func (e *Element) GetState(timeout_ns int64) (state, pending State, ret StateChangeReturn)
- func (e *Element) GetStaticPad(name string) *Pad
- func (e *Element) Link(next ...*Element) bool
- func (e *Element) LinkFiltered(dst *Element, filter *Caps) bool
- func (e *Element) LinkPads(pad_name string, dst *Element, dst_pad_name string) bool
- func (e *Element) SetState(state State) StateChangeReturn
- func (e *Element) Unlink(next ...*Element)
- func (e *Element) UnlinkPads(pad_name string, dst *Element, dst_pad_name string)
- type Fourcc
- type Fraction
- type GhostPad
- type GstBufferPoolPrivate
- type GstBufferStruct
- type GstObj
- type GstSampleStruct
- type IntRange
- type MapFlags
- type MapInfo
- type Memory
- type Message
- func (m *Message) GetSrc() *GstObj
- func (m *Message) GetStructure() (string, glib.Params)
- func (m *Message) GetType() MessageType
- func (m *Message) ParseError() (err *glib.Error, debug string)
- func (m *Message) ParseWarning() (err *glib.Error, debug string)
- func (m *Message) Ref() *Message
- func (m *Message) Type() glib.Type
- func (m *Message) Unref()
- type MessageType
- type Pad
- type PadDirection
- type PadLinkReturn
- type Pipeline
- type QueueLeaky
- type Sample
- type State
- type StateChangeReturn
- type Structure
Constants ¶
const ( MAP_READ = MapFlags(C.GST_MAP_READ) MAP_WRITE = MapFlags(C.GST_MAP_WRITE) MAP_FLAG_LAST = MapFlags(C.GST_MAP_FLAG_LAST) )
const ( STATE_VOID_PENDING = State(C.GST_STATE_VOID_PENDING) STATE_NULL = State(C.GST_STATE_NULL) STATE_READY = State(C.GST_STATE_READY) STATE_PAUSED = State(C.GST_STATE_PAUSED) STATE_PLAYING = State(C.GST_STATE_PLAYING) )
const ( STATE_CHANGE_FAILURE = StateChangeReturn(C.GST_STATE_CHANGE_FAILURE) STATE_CHANGE_SUCCESS = StateChangeReturn(C.GST_STATE_CHANGE_SUCCESS) STATE_CHANGE_ASYNC = StateChangeReturn(C.GST_STATE_CHANGE_ASYNC) STATE_CHANGE_NO_PREROLL = StateChangeReturn(C.GST_STATE_CHANGE_NO_PREROLL) )
const ( MESSAGE_UNKNOWN = MessageType(C.GST_MESSAGE_UNKNOWN) MESSAGE_EOS = MessageType(C.GST_MESSAGE_EOS) MESSAGE_ERROR = MessageType(C.GST_MESSAGE_ERROR) MESSAGE_WARNING = MessageType(C.GST_MESSAGE_WARNING) MESSAGE_INFO = MessageType(C.GST_MESSAGE_INFO) MESSAGE_TAG = MessageType(C.GST_MESSAGE_TAG) MESSAGE_BUFFERING = MessageType(C.GST_MESSAGE_BUFFERING) MESSAGE_STATE_CHANGED = MessageType(C.GST_MESSAGE_STATE_CHANGED) MESSAGE_STATE_DIRTY = MessageType(C.GST_MESSAGE_STATE_DIRTY) MESSAGE_STEP_DONE = MessageType(C.GST_MESSAGE_STEP_DONE) MESSAGE_CLOCK_PROVIDE = MessageType(C.GST_MESSAGE_CLOCK_PROVIDE) MESSAGE_CLOCK_LOST = MessageType(C.GST_MESSAGE_CLOCK_LOST) MESSAGE_NEW_CLOCK = MessageType(C.GST_MESSAGE_NEW_CLOCK) MESSAGE_STRUCTURE_CHANGE = MessageType(C.GST_MESSAGE_STRUCTURE_CHANGE) MESSAGE_STREAM_STATUS = MessageType(C.GST_MESSAGE_STREAM_STATUS) MESSAGE_APPLICATION = MessageType(C.GST_MESSAGE_APPLICATION) MESSAGE_ELEMENT = MessageType(C.GST_MESSAGE_ELEMENT) MESSAGE_SEGMENT_START = MessageType(C.GST_MESSAGE_SEGMENT_START) MESSAGE_SEGMENT_DONE = MessageType(C.GST_MESSAGE_SEGMENT_DONE) MESSAGE_DURATION = MessageType(C.GST_MESSAGE_DURATION) MESSAGE_LATENCY = MessageType(C.GST_MESSAGE_LATENCY) MESSAGE_ASYNC_START = MessageType(C.GST_MESSAGE_ASYNC_START) MESSAGE_ASYNC_DONE = MessageType(C.GST_MESSAGE_ASYNC_DONE) MESSAGE_REQUEST_STATE = MessageType(C.GST_MESSAGE_REQUEST_STATE) MESSAGE_STEP_START = MessageType(C.GST_MESSAGE_STEP_START) MESSAGE_QOS = MessageType(C.GST_MESSAGE_QOS) //MESSAGE_PROGRESS = MessageType(C.GST_MESSAGE_PROGRESS) MESSAGE_ANY = MessageType(C.GST_MESSAGE_ANY) )
const ( PAD_LINK_OK = PadLinkReturn(C.GST_PAD_LINK_OK) PAD_LINK_WRONG_HIERARCHY = PadLinkReturn(C.GST_PAD_LINK_WRONG_HIERARCHY) PAD_LINK_WAS_LINKED = PadLinkReturn(C.GST_PAD_LINK_WAS_LINKED) PAD_LINK_WRONG_DIRECTION = PadLinkReturn(C.GST_PAD_LINK_WRONG_DIRECTION) PAD_LINK_NOFORMAT = PadLinkReturn(C.GST_PAD_LINK_NOFORMAT) PAD_LINK_NOSCHED = PadLinkReturn(C.GST_PAD_LINK_NOSCHED) PAD_LINK_REFUSED = PadLinkReturn(C.GST_PAD_LINK_REFUSED) )
const ( /* custom success starts here */ GST_FLOW_CUSTOM_SUCCESS_2 = C.GST_FLOW_CUSTOM_SUCCESS_2 GST_FLOW_CUSTOM_SUCCESS_1 = C.GST_FLOW_CUSTOM_SUCCESS_1 GST_FLOW_CUSTOM_SUCCESS = C.GST_FLOW_CUSTOM_SUCCESS /* core predefined */ GST_FLOW_OK = C.GST_FLOW_OK /* expected failures */ GST_FLOW_NOT_LINKED = C.GST_FLOW_NOT_LINKED GST_FLOW_FLUSHING = C.GST_FLOW_FLUSHING /* error cases */ GST_FLOW_EOS = C.GST_FLOW_EOS GST_FLOW_NOT_NEGOTIATED = C.GST_FLOW_NOT_NEGOTIATED GST_FLOW_ERROR = C.GST_FLOW_ERROR GST_FLOW_NOT_SUPPORTED = C.GST_FLOW_NOT_SUPPORTED /* custom error starts here */ GST_FLOW_CUSTOM_ERROR = C.GST_FLOW_CUSTOM_ERROR GST_FLOW_CUSTOM_ERROR_1 = C.GST_FLOW_CUSTOM_ERROR_1 GST_FLOW_CUSTOM_ERROR_2 = C.GST_FLOW_CUSTOM_ERROR_2 )
const ( PAD_UNKNOWN = PadDirection(C.GST_PAD_UNKNOWN) PAD_SRC = PadDirection(C.GST_PAD_SRC) PAD_SINK = PadDirection(C.GST_PAD_SINK) )
const ( QUEUE_NO_LEAK = 0 // TODO QueueLeaky(C.GST_QUEUE_NO_LEAK) QUEUE_LEAK_UPSTREAM = 1 // TODO QueueLeaky(C.GST_QUEUE_LEAK_UPSTREAM) QUEUE_LEAK_DOWNSTREAM = 2 // TODO QueueLeaky(C.GST_QUEUE_LEAK_DOWNSTREAM) )
const GST_PADDING = C.GST_PADDING
Variables ¶
var CLOCK_TIME_NONE = uint64(C.GST_CLOCK_TIME_NONE)
var TYPE_FOURCC, TYPE_INT_RANGE, TYPE_FRACTION glib.Type
Functions ¶
Types ¶
type AppSink ¶
type AppSink struct {
BaseSink
}
func NewAppSink ¶
func (*AppSink) GetMaxBuffers ¶
GetMaxBuffers implements guint gst_app_sink_get_max_buffers ()
func (*AppSink) PullSample ¶
PullSample implements GstSample * gst_app_sink_pull_sample ()
func (*AppSink) SetEmitSignals ¶
SetEmitSignals implements void gst_app_sink_set_emit_signals ()
func (*AppSink) SetMaxBuffers ¶
SetMaxBuffers implements void gst_app_sink_set_max_buffers ()
func (*AppSink) TryPullSample ¶
GstSample * gst_app_sink_try_pull_sample ()
type AppSrc ¶
type AppSrc struct {
BaseSrc
}
func (*AppSrc) EndOfStream ¶
func (*AppSrc) PushBuffer ¶
type BaseSink ¶
type BaseSink struct {
Element
}
func (*BaseSink) AsBaseSink ¶
type BaseTransform ¶
type BaseTransform struct {
Element
}
func (*BaseTransform) AsBaseTransform ¶
func (b *BaseTransform) AsBaseTransform() *BaseTransform
func (*BaseTransform) ReconfigureSink ¶
func (b *BaseTransform) ReconfigureSink()
func (*BaseTransform) ReconfigureSrc ¶
func (b *BaseTransform) ReconfigureSrc()
func (*BaseTransform) UpdateSrcCaps ¶
func (b *BaseTransform) UpdateSrcCaps(caps *Caps) bool
type Bin ¶
type Bin struct {
Element
}
func ParseBinFromDescription ¶
Similar to gst_parse_launch, but makes a bin instead of a pipeline
type Buffer ¶
type Buffer struct {
GstBuffer *GstBufferStruct
}
func NewBufferAllocate ¶
NewBufferAllocate implements GstBuffer * gst_buffer_new_allocate ()
func (*Buffer) AppendMemory ¶
AppendMemory implements void gst_buffer_append_memory ()
func (*Buffer) GetDuration ¶
func (*Buffer) SetDuration ¶
SetDuration implements #define GST_BUFFER_DURATION()
func (*Buffer) SetOffsetEnd ¶
SetOffsetEnd implements #define GST_BUFFER_OFFSET_END()
type BufferPool ¶
type BufferPool struct {
Object GstObj
Flushing gint
GstBufferPoolPrivate *GstBufferPoolPrivate
// contains filtered or unexported fields
}
type Bus ¶
type Bus struct {
GstObj
}
func (*Bus) AddSignalWatch ¶
func (b *Bus) AddSignalWatch()
func (*Bus) AddSignalWatchFull ¶
func (*Bus) DisableSyncMessageEmission ¶
func (b *Bus) DisableSyncMessageEmission()
func (*Bus) EnableSyncMessageEmission ¶
func (b *Bus) EnableSyncMessageEmission()
func (*Bus) HavePending ¶
func (*Bus) PopFiltered ¶
func (b *Bus) PopFiltered(types MessageType) *Message
func (*Bus) RemoveSignalWatch ¶
func (b *Bus) RemoveSignalWatch()
func (*Bus) SetFlushing ¶
func (*Bus) TimedPopFiltered ¶
func (b *Bus) TimedPopFiltered(timeout uint64, types MessageType) *Message
type Caps ¶
func CapsFromString ¶
func NewCapsAny ¶
func NewCapsAny() *Caps
func NewCapsEmpty ¶
func NewCapsEmpty() *Caps
func (*Caps) AppendStructure ¶
func (*Caps) GetStructure ¶
type CapsFilter ¶
type CapsFilter struct {
BaseTransform
}
func NewCapsFilter ¶
func NewCapsFilter(name string) *CapsFilter
func (*CapsFilter) SetCaps ¶
func (b *CapsFilter) SetCaps(caps *Caps)
func (*CapsFilter) SetResolution ¶
func (b *CapsFilter) SetResolution(width, height int)
type Element ¶
type Element struct {
GstObj
}
func ElementFactoryMake ¶
TODO: Move ElementFactoryMake to element_factory.go
func (*Element) GetRequestPad ¶
func (*Element) GetState ¶
func (e *Element) GetState(timeout_ns int64) (state, pending State, ret StateChangeReturn)
func (*Element) GetStaticPad ¶
func (*Element) SetState ¶
func (e *Element) SetState(state State) StateChangeReturn
type GhostPad ¶
type GhostPad struct {
Pad
}
func NewGhostPad ¶
func NewGhostPadNoTarget ¶
func NewGhostPadNoTarget(name string, dir PadDirection) *GhostPad
func (*GhostPad) AsGhostPad ¶
type GstBufferPoolPrivate ¶
type GstBufferPoolPrivate C.GstBufferPoolPrivate
type GstBufferStruct ¶
type GstObj ¶
func (*GstObj) GetParent ¶
Returns the parent of o. Increases the refcount of the parent object so you should Unref it after usage.
func (*GstObj) GetPathString ¶
Generates a string describing the path of object in the object hierarchy. Only useful (or used) for debugging.
type GstSampleStruct ¶
type MapFlags ¶
type MapFlags C.GstMapFlags
type MapInfo ¶
type MapInfo C.GstMapInfo
type Message ¶
type Message C.GstMessage
func (*Message) GetType ¶
func (m *Message) GetType() MessageType
type MessageType ¶
type MessageType C.GstMessageType
func (MessageType) String ¶
func (t MessageType) String() string
type Pad ¶
type Pad struct {
GstObj
}
func (*Pad) GetCurrentCaps ¶
func (*Pad) Link ¶
func (p *Pad) Link(sink_pad *Pad) PadLinkReturn
type PadDirection ¶
type PadDirection C.GstPadDirection
func (PadDirection) String ¶
func (p PadDirection) String() string
type PadLinkReturn ¶
type PadLinkReturn C.GstPadLinkReturn
func (PadLinkReturn) String ¶
func (p PadLinkReturn) String() string
type Pipeline ¶
type Pipeline struct {
Bin
}
func NewPipeline ¶
func ParseLaunch ¶
func (*Pipeline) AsPipeline ¶
type QueueLeaky ¶
type QueueLeaky int // TODO C.GstQueueLeaky
func (QueueLeaky) String ¶
func (q QueueLeaky) String() string
type Sample ¶
type Sample struct {
GstSample *GstSampleStruct
}
type StateChangeReturn ¶
type StateChangeReturn C.GstStateChangeReturn