gst

package module
v0.0.0-...-0347858 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: BSD-3-Clause Imports: 8 Imported by: 1

README

Go bindings for GStreamer at a very early stage of maturity.

This package is based on GLib bindings. It should be goinstalable. Try

$ go get github.com/jbuchbinder/gst

If it does not compile on an x86_64 machine, try this first:

export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig

For Ubuntu 24.04+ you'll need to make sure you install:

  • libgtk2.0-dev
  • libgio-2.0-dev
  • libgstreamer1.0-dev
  • libgstreamer-plugins-base1.0-dev

Documentation

See examples directory and http://gopkgdoc.appspot.com/pkg/github.com/falinux/gst

To run examples use go run command:

$ cd examples
$ go run simple.go

To run live WebM example use go run live_webm.go and open http://127.0.0.1:8080 with your browser. You probably need to wait a long time for video because of small bitrate of this stream and big buffer in you browser.

Documentation

Overview

Bindings for GStreamer API

Bindings for GStreamer API

Index

Constants

View Source
const (
	GST_FLOW_OK             = FlowReturn(C.GST_FLOW_OK)
	GST_FLOW_FLUSHING       = FlowReturn(C.GST_FLOW_FLUSHING)
	GST_FLOW_NOT_LINKED     = FlowReturn(C.GST_FLOW_NOT_LINKED)
	GST_FLOW_NOT_NEGOTIATED = FlowReturn(C.GST_FLOW_NOT_NEGOTIATED)
	GST_FLOW_ERROR          = FlowReturn(C.GST_FLOW_ERROR)
	GST_FLOW_NOT_SUPPORTED  = FlowReturn(C.GST_FLOW_NOT_SUPPORTED)
)
View Source
const (
	FORMAT_UNDEFINED = Format(C.GST_FORMAT_UNDEFINED)
	FORMAT_DEFAULT   = Format(C.GST_FORMAT_DEFAULT)
	FORMAT_BYTES     = Format(C.GST_FORMAT_BYTES)
	FORMAT_TIME      = Format(C.GST_FORMAT_TIME)
	FORMAT_BUFFERS   = Format(C.GST_FORMAT_BUFFERS)
	FORMAT_PERCENT   = Format(C.GST_FORMAT_PERCENT)
)
View Source
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)
)
View Source
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)
)
View Source
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)
)
View Source
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)
)
View Source
const (
	PAD_UNKNOWN = PadDirection(C.GST_PAD_UNKNOWN)
	PAD_SRC     = PadDirection(C.GST_PAD_SRC)
	PAD_SINK    = PadDirection(C.GST_PAD_SINK)
)
View Source
const (
	SEEK_FLAG_NONE                = SeekFlag(C.GST_SEEK_FLAG_NONE)
	SEEK_FLAG_FLUSH               = SeekFlag(C.GST_SEEK_FLAG_FLUSH)
	SEEK_FLAG_ACCURATE            = SeekFlag(C.GST_SEEK_FLAG_ACCURATE)
	SEEK_FLAG_KEY_UNIT            = SeekFlag(C.GST_SEEK_FLAG_KEY_UNIT)
	SEEK_FLAG_SEGMENT             = SeekFlag(C.GST_SEEK_FLAG_SEGMENT)
	SEEK_FLAG_TRICKMODE           = SeekFlag(C.GST_SEEK_FLAG_TRICKMODE)
	SEEK_FLAG_SKIP                = SeekFlag(C.GST_SEEK_FLAG_SKIP)
	SEEK_FLAG_SNAP_BEFORE         = SeekFlag(C.GST_SEEK_FLAG_SNAP_BEFORE)
	SEEK_FLAG_SNAP_AFTER          = SeekFlag(C.GST_SEEK_FLAG_SNAP_AFTER)
	SEEK_FLAG_SNAP_NEAREST        = SeekFlag(C.GST_SEEK_FLAG_SNAP_NEAREST)
	SEEK_FLAG_TRICKMODE_KEY_UNITS = SeekFlag(C.GST_SEEK_FLAG_TRICKMODE_KEY_UNITS)
	SEEK_FLAG_TRICKMODE_NO_AUDIO  = SeekFlag(C.GST_SEEK_FLAG_TRICKMODE_NO_AUDIO)
)

Variables

View Source
var CLOCK_TIME_NONE = uint64(C.GST_CLOCK_TIME_NONE)
View Source
var TYPE_FOURCC, TYPE_INT_RANGE, TYPE_FRACTION glib.Type

Functions

func FilenameToURI

func FilenameToURI(filename string) (string, error)

returns (uri, gerror)

func Free

func Free(ptr *Memory)

func GetFilenameToUri

func GetFilenameToUri(file string) (string, error)

func GetVersion

func GetVersion() (int, int, int, int)

Types

type AppSink

type AppSink struct {
	*Element
}

func NewAppSink

func NewAppSink(name string) *AppSink

func (*AppSink) IsEOS

func (a *AppSink) IsEOS() bool

func (*AppSink) PullSample

func (a *AppSink) PullSample() *Sample

func (*AppSink) SetCaps

func (a *AppSink) SetCaps(caps *Caps)

type AppSrc

type AppSrc struct {
	*Element
}

func NewAppSrc

func NewAppSrc(name string) *AppSrc

func (*AppSrc) EOS

func (a *AppSrc) EOS() error

func (*AppSrc) PushBuffer

func (b *AppSrc) PushBuffer(buffer *Buffer) int

func (*AppSrc) SetCaps

func (a *AppSrc) SetCaps(caps *Caps)

func (*AppSrc) Write

func (a *AppSrc) Write(d []byte) (int, error)

type Bin

type Bin struct {
	Element
}

func NewBin

func NewBin(name string) *Bin

func ParseBinFromDescription

func ParseBinFromDescription(desc string) (*Bin, error)

Similar to gst_parse_launch, but makes a bin instead of a pipeline

func (*Bin) Add

func (b *Bin) Add(els ...*Element) bool

func (*Bin) AsBin

func (b *Bin) AsBin() *Bin

func (*Bin) GetByName

func (b *Bin) GetByName(name string) *Element

GetByName returns the element with the given name from a bin. Returns nil if no element with the given name is found in the bin.

func (*Bin) Remove

func (b *Bin) Remove(els ...*Element) bool

type Buffer

type Buffer struct {
	GstBuffer  *GstBufferStruct
	GstMapInfo *MapInfo
}

func NewBuffer

func NewBuffer() *Buffer

func NewBufferAllocate

func NewBufferAllocate(size uint) *Buffer

func (*Buffer) AppendMemory

func (b *Buffer) AppendMemory(memory *Memory)

func (*Buffer) BufferMap

func (b *Buffer) BufferMap(flags MapFlags) *MapInfo

func (*Buffer) Bytes

func (b *Buffer) Bytes() []byte

func (*Buffer) Copy

func (b *Buffer) Copy() *Buffer

func (*Buffer) Fill

func (b *Buffer) Fill(offset uint, src unsafe.Pointer, size uint) int

func (*Buffer) FillWithGoSlice

func (b *Buffer) FillWithGoSlice(data []byte) int

func (*Buffer) GetSize

func (b *Buffer) GetSize() uint

func (*Buffer) MemSet

func (b *Buffer) MemSet(offset uint, val byte, size uint) int

func (*Buffer) SetDTS

func (b *Buffer) SetDTS(value uint64)

func (*Buffer) SetDuration

func (b *Buffer) SetDuration(value uint64)

func (*Buffer) SetOffset

func (b *Buffer) SetOffset(value uint64)

func (*Buffer) SetOffsetEnd

func (b *Buffer) SetOffsetEnd(value uint64)

func (*Buffer) SetPTS

func (b *Buffer) SetPTS(value uint64)

func (*Buffer) Unmap

func (b *Buffer) Unmap()

func (*Buffer) Unref

func (b *Buffer) Unref()

type Bus

type Bus struct {
	GstObj
}

func NewBus

func NewBus() *Bus

func (*Bus) AddSignalWatch

func (b *Bus) AddSignalWatch()

func (*Bus) AddSignalWatchFull

func (b *Bus) AddSignalWatchFull(priority int)

func (*Bus) AsBus

func (b *Bus) AsBus() *Bus

func (*Bus) DisableSyncMessageEmission

func (b *Bus) DisableSyncMessageEmission()

func (*Bus) EnableSyncMessageEmission

func (b *Bus) EnableSyncMessageEmission()

func (*Bus) HavePending

func (b *Bus) HavePending() bool

func (*Bus) Peek

func (b *Bus) Peek() *Message

func (*Bus) Poll

func (b *Bus) Poll(events MessageType, timeout int64) *Message

func (*Bus) Pop

func (b *Bus) Pop() *Message

func (*Bus) PopFiltered

func (b *Bus) PopFiltered(types MessageType) *Message

func (*Bus) Post

func (b *Bus) Post(msg *Message) bool

func (*Bus) RemoveSignalWatch

func (b *Bus) RemoveSignalWatch()

func (*Bus) RemoveWatch

func (b *Bus) RemoveWatch()

func (*Bus) SetFlushing

func (b *Bus) SetFlushing(flushing bool)

func (*Bus) TimedPop

func (b *Bus) TimedPop(timeout uint64) *Message

func (*Bus) TimedPopFiltered

func (b *Bus) TimedPopFiltered(timeout uint64, types MessageType) *Message

type Caps

type Caps C.GstCaps

func CapsFromString

func CapsFromString(s string) *Caps

func NewCapsAny

func NewCapsAny() *Caps

func NewCapsEmpty

func NewCapsEmpty() *Caps

func NewCapsSimple

func NewCapsSimple(media_type string, fields glib.Params) *Caps

func (*Caps) AppendStructure

func (c *Caps) AppendStructure(media_type string, fields glib.Params)

func (*Caps) GetSize

func (c *Caps) GetSize() int

func (*Caps) Ref

func (c *Caps) Ref() *Caps

func (*Caps) RefCount

func (c *Caps) RefCount() int

func (*Caps) String

func (c *Caps) String() string

func (*Caps) Unref

func (c *Caps) Unref()

type Clock

type Clock struct {
	GstObj
}

func (*Clock) AsClock

func (c *Clock) AsClock() *Clock

type Discoverer

type Discoverer struct {
	GstObj
}

func NewDiscoverer

func NewDiscoverer(timeout int64) (*Discoverer, error)

func (*Discoverer) DiscoverUri

func (d *Discoverer) DiscoverUri(uri string) (*DiscovererInfo, error)

type DiscovererInfo

type DiscovererInfo C.GstDiscovererInfo

func (*DiscovererInfo) GetDuration

func (i *DiscovererInfo) GetDuration() time.Duration

func (*DiscovererInfo) GetResult

func (i *DiscovererInfo) GetResult() DiscovererResult

type DiscovererResult

type DiscovererResult C.GstDiscovererResult

func (DiscovererResult) String

func (s DiscovererResult) String() string

type Element

type Element struct {
	GstObj
}

func ElementFactoryMake

func ElementFactoryMake(factory_name, name string) *Element

TODO: Move ElementFactoryMake to element_factory.go

func (*Element) AddGhostPad

func (e *Element) AddGhostPad(p *GhostPad) bool

func (*Element) AddPad

func (e *Element) AddPad(p *Pad) bool

func (*Element) AsElement

func (e *Element) AsElement() *Element

func (*Element) ElementQuery

func (e *Element) ElementQuery(q *Query) bool

func (*Element) ElementQueryPosition

func (e *Element) ElementQueryPosition(f Format) int64

func (*Element) ElementSeekSimple

func (e *Element) ElementSeekSimple(format Format, f SeekFlag, pos int64) bool

func (*Element) GetActivePad

func (e *Element) GetActivePad(name string) *Pad

func (*Element) GetBus

func (e *Element) GetBus() *Bus

func (*Element) GetRequestPad

func (e *Element) GetRequestPad(name string) *Pad

func (*Element) GetState

func (e *Element) GetState(timeout_ns int64) (state, pending State,
	ret StateChangeReturn)

func (*Element) GetStaticPad

func (e *Element) GetStaticPad(name string) *Pad
func (e *Element) Link(next ...*Element) bool

func (*Element) LinkFiltered

func (e *Element) LinkFiltered(dst *Element, filter *Caps) bool

func (*Element) LinkPads

func (e *Element) LinkPads(pad_name string, dst *Element, dst_pad_name string) bool

func (*Element) SendEvent

func (e *Element) SendEvent(event *Event) bool

func (*Element) SetCaps

func (e *Element) SetCaps(caps string)

func (*Element) SetState

func (e *Element) SetState(state State) StateChangeReturn
func (e *Element) Unlink(next ...*Element)

func (*Element) UnlinkPads

func (e *Element) UnlinkPads(pad_name string, dst *Element, dst_pad_name string)

type Event

type Event struct {
	GstEvent *GstEventStruct
}

func Eos

func Eos() *Event

type EventType

type EventType int

EventType casts GstEventType

const (
	EventUnknown                EventType = C.GST_EVENT_UNKNOWN      // (0) – unknown event
	EventFlushStart             EventType = C.GST_EVENT_FLUSH_START  // (2564)
	EventFlushStop              EventType = C.GST_EVENT_FLUSH_STOP   // (5127)
	EventStreamStart            EventType = C.GST_EVENT_STREAM_START // (10254)
	EventCaps                   EventType = C.GST_EVENT_CAPS         // (12814)
	EventSegment                EventType = C.GST_EVENT_SEGMENT      // (17934)
	EventTag                    EventType = C.GST_EVENT_TAG          // (20510)
	EventBuffersize             EventType = C.GST_EVENT_BUFFERSIZE   // (23054)
	EventSinkMessage            EventType = C.GST_EVENT_SINK_MESSAGE // (25630)
	EventEos                    EventType = C.GST_EVENT_EOS          // (28174)
	EventToc                    EventType = C.GST_EVENT_TOC
	EventProtection             EventType = C.GST_EVENT_PROTECTION
	EventSegmentDone            EventType = C.GST_EVENT_SEGMENT_DONE
	EventGap                    EventType = C.GST_EVENT_GAP
	EventQos                    EventType = C.GST_EVENT_QOS
	EventSeek                   EventType = C.GST_EVENT_SEEK
	EventNavigation             EventType = C.GST_EVENT_NAVIGATION
	EventLatency                EventType = C.GST_EVENT_LATENCY
	EventStep                   EventType = C.GST_EVENT_STEP
	EventReconfigure            EventType = C.GST_EVENT_RECONFIGURE
	EvnetTocSelect              EventType = C.GST_EVENT_TOC_SELECT
	EventCustomUpstream         EventType = C.GST_EVENT_CUSTOM_UPSTREAM
	EventCustomDownstream       EventType = C.GST_EVENT_CUSTOM_DOWNSTREAM
	EventCustomDownstreamOob    EventType = C.GST_EVENT_CUSTOM_DOWNSTREAM_OOB
	EventCustomDownstreamSticky EventType = C.GST_EVENT_CUSTOM_DOWNSTREAM_STICKY
	EventCustomBoth             EventType = C.GST_EVENT_CUSTOM_BOTH
	EventCustomBothOob          EventType = C.GST_EVENT_CUSTOM_BOTH_OOB
)

Type castrings of EventTypes

func GetEventType

func GetEventType(data unsafe.Pointer) EventType

type FlowReturn

type FlowReturn C.GstFlowReturn

func (FlowReturn) String

func (f FlowReturn) String() string

type Format

type Format C.GstFormat

type Fourcc

type Fourcc uint32

func MakeFourcc

func MakeFourcc(a, b, c, d byte) Fourcc

func StrFourcc

func StrFourcc(s string) Fourcc

func ValueFourcc

func ValueFourcc(v *glib.Value) Fourcc

func (Fourcc) String

func (f Fourcc) String() string

func (Fourcc) Type

func (f Fourcc) Type() glib.Type

func (Fourcc) Value

func (f Fourcc) Value() *glib.Value

type Fraction

type Fraction struct {
	Numer, Denom int
}

func ValueFraction

func ValueFraction(v *glib.Value) *Fraction

func (*Fraction) String

func (r *Fraction) String() string

func (*Fraction) Type

func (f *Fraction) Type() glib.Type

func (*Fraction) Value

func (f *Fraction) Value() *glib.Value

type GValueArray

type GValueArray []interface{}

* GstStructure

type GhostPad

type GhostPad struct {
	Pad
}

func NewGhostPad

func NewGhostPad(name string, target *Pad) *GhostPad

func NewGhostPadNoTarget

func NewGhostPadNoTarget(name string, dir PadDirection) *GhostPad

func (*GhostPad) AsGhostPad

func (p *GhostPad) AsGhostPad() *GhostPad

func (*GhostPad) Construct

func (p *GhostPad) Construct() bool

func (*GhostPad) GetTarget

func (p *GhostPad) GetTarget() *Pad

func (*GhostPad) SetTarget

func (p *GhostPad) SetTarget(new_target *Pad) bool

type GstBufferStruct

type GstBufferStruct C.GstBuffer

type GstEventStruct

type GstEventStruct C.GstEvent

type GstObj

type GstObj struct {
	glib.Object
}

func (*GstObj) AsGstObj

func (o *GstObj) AsGstObj() *GstObj

func (*GstObj) GetName

func (o *GstObj) GetName() string

MT safe.

func (*GstObj) GetParent

func (o *GstObj) GetParent() *GstObj

Returns the parent of o. Increases the refcount of the parent object so you should Unref it after usage.

func (*GstObj) GetPathString

func (o *GstObj) GetPathString() string

Generates a string describing the path of object in the object hierarchy. Only useful (or used) for debugging.

func (*GstObj) GstUnref

func (o *GstObj) GstUnref()

func (*GstObj) SetName

func (o *GstObj) SetName(name string) bool

Sets the name of object. Returns true if the name could be set. MT safe.

func (*GstObj) SetParent

func (o *GstObj) SetParent(p *GstObj) bool

Sets the parent of o to p. This function causes the parent-set signal to be emitted when the parent was successfully set.

func (*GstObj) Unparent

func (o *GstObj) Unparent()

Clear the parent of object, removing the associated reference. This function decreases the refcount of o. MT safe. Grabs and releases object's lock.

type IntRange

type IntRange struct {
	Start, End int
}

func ValueRange

func ValueRange(v *glib.Value) *IntRange

func (*IntRange) String

func (r *IntRange) String() string

func (*IntRange) Type

func (r *IntRange) Type() glib.Type

func (*IntRange) Value

func (r *IntRange) Value() *glib.Value

type MapFlags

type MapFlags int
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 {
	// contains filtered or unexported fields
}

MapInfo is a go representation of a GstMapInfo.

func (*MapInfo) Bytes

func (m *MapInfo) Bytes() []byte

func (*MapInfo) Data

func (m *MapInfo) Data() unsafe.Pointer

func (*MapInfo) Size

func (m *MapInfo) Size() int64

Size returrns the size of this map.

type Memory

type Memory C.GstMemory

func Allocate

func Allocate(size uint32) *Memory

type Message

type Message C.GstMessage

func (*Message) GetSrc

func (m *Message) GetSrc() *GstObj

func (*Message) GetStructure

func (m *Message) GetStructure() (string, glib.Params)

func (*Message) GetType

func (m *Message) GetType() MessageType

func (*Message) GetValueFromStructure

func (m *Message) GetValueFromStructure(param string) GValueArray

func (*Message) ParseError

func (m *Message) ParseError() (err *glib.Error, debug string)

func (*Message) ParseStateChanged

func (m *Message) ParseStateChanged() (oldState, newState, pending string)

func (*Message) Ref

func (m *Message) Ref() *Message

func (*Message) Type

func (m *Message) Type() glib.Type

func (*Message) Unref

func (m *Message) Unref()

type MessageType

type MessageType C.GstMessageType

func (MessageType) String

func (t MessageType) String() string

type Pad

type Pad struct {
	GstObj
}

func (*Pad) AddProbe

func (p *Pad) AddProbe(mask PadProbeType, f PadProbeCallback, ptr unsafe.Pointer) uint64

func (*Pad) AsPad

func (p *Pad) AsPad() *Pad
func (p *Pad) CanLink(sink_pad *Pad) bool

func (*Pad) GetCurrentCaps

func (p *Pad) GetCurrentCaps() *Caps
func (p *Pad) Link(sink_pad *Pad) PadLinkReturn

func (*Pad) RemoveProbe

func (p *Pad) RemoveProbe(id uint64)

func (*Pad) SendEvent

func (p *Pad) SendEvent(event *Event) bool

func (*Pad) SetActive

func (p *Pad) SetActive(active bool) bool
func (p *Pad) Unlink(sink_pad *Pad) bool

Unlink() is a wrapper around gst_pad_unlink().

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 PadProbeCallback

type PadProbeCallback func(*Pad, *PadProbeInfo, unsafe.Pointer) PadProbeReturn

type PadProbeInfo

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

func (*PadProbeInfo) GetBuffer

func (p *PadProbeInfo) GetBuffer() *Buffer

func (*PadProbeInfo) GetData

func (p *PadProbeInfo) GetData() unsafe.Pointer

func (*PadProbeInfo) GetEvent

func (p *PadProbeInfo) GetEvent() *Event

func (*PadProbeInfo) ID

func (p *PadProbeInfo) ID() uint32

func (*PadProbeInfo) Offset

func (p *PadProbeInfo) Offset() uint64

func (*PadProbeInfo) Size

func (p *PadProbeInfo) Size() uint64

func (*PadProbeInfo) Type

func (p *PadProbeInfo) Type() PadProbeType

type PadProbeReturn

type PadProbeReturn int

PadProbeReturn casts GstPadProbeReturn

const (
	PadProbeDrop      PadProbeReturn = C.GST_PAD_PROBE_DROP    // (0) – drop data in data probes. For push mode this means that the data item is not sent downstream. For pull mode, it means that the data item is not passed upstream. In both cases, no other probes are called for this item and GST_FLOW_OK or TRUE is returned to the caller.
	PadProbeOK        PadProbeReturn = C.GST_PAD_PROBE_OK      // (1) – normal probe return value. This leaves the probe in place, and defers decisions about dropping or passing data to other probes, if any. If there are no other probes, the default behaviour for the probe type applies ('block' for blocking probes, and 'pass' for non-blocking probes).
	PadProbeRemove    PadProbeReturn = C.GST_PAD_PROBE_REMOVE  // (2) – remove this probe.
	PadProbePass      PadProbeReturn = C.GST_PAD_PROBE_PASS    // (3) – pass the data item in the block probe and block on the next item.
	PadProbeUnhandled PadProbeReturn = C.GST_PAD_PROBE_HANDLED // (4) – Data has been handled in the probe and will not be forwarded further. For events and buffers this is the same behaviour as GST_PAD_PROBE_DROP (except that in this case you need to unref the buffer or event yourself). For queries it will also return TRUE to the caller. The probe can also modify the GstFlowReturn value by using the GST_PAD_PROBE_INFO_FLOW_RETURN() accessor. Note that the resulting query must contain valid entries. Since: 1.6
)

Type castings of ProbeReturns

type PadProbeType

type PadProbeType int

PadProbeType casts GstPadProbeType

const (
	PadProbeTypeInvalid         PadProbeType = C.GST_PAD_PROBE_TYPE_INVALID          // (0) – invalid probe type
	PadProbeTypeIdle            PadProbeType = C.GST_PAD_PROBE_TYPE_IDLE             // (1) – probe idle pads and block while the callback is called
	PadProbeTypeBlock           PadProbeType = C.GST_PAD_PROBE_TYPE_BLOCK            // (2) – probe and block pads
	PadProbeTypeBuffer          PadProbeType = C.GST_PAD_PROBE_TYPE_BUFFER           // (16) – probe buffers
	PadProbeTypeBufferList      PadProbeType = C.GST_PAD_PROBE_TYPE_BUFFER_LIST      // (32) – probe buffer lists
	PadProbeTypeEventDownstream PadProbeType = C.GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM // (64) – probe downstream events
	PadProbeTypeEventUpstream   PadProbeType = C.GST_PAD_PROBE_TYPE_EVENT_UPSTREAM   // (128) – probe upstream events
	PadProbeTypeEventFlush      PadProbeType = C.GST_PAD_PROBE_TYPE_EVENT_FLUSH      // (256) – probe flush events. This probe has to be explicitly enabled and is not included in the @GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM or @GST_PAD_PROBE_TYPE_EVENT_UPSTREAM probe types.
	PadProbeTypeQueryDownstream PadProbeType = C.GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM // (512) – probe downstream queries
	PadProbeTypeQueryUpstream   PadProbeType = C.GST_PAD_PROBE_TYPE_QUERY_UPSTREAM   // (1024) – probe upstream queries
	PadProbeTypePush            PadProbeType = C.GST_PAD_PROBE_TYPE_PUSH             // (4096) – probe push
	PadProbeTypePull            PadProbeType = C.GST_PAD_PROBE_TYPE_PULL             // (8192) – probe pull
	PadProbeTypeBlocking        PadProbeType = C.GST_PAD_PROBE_TYPE_BLOCKING         // (3) – probe and block at the next opportunity, at data flow or when idle
	PadProbeTypeDataDownstream  PadProbeType = C.GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM  // (112) – probe downstream data (buffers, buffer lists, and events)
	PadProbeTypeDataUpstream    PadProbeType = C.GST_PAD_PROBE_TYPE_DATA_UPSTREAM    // (128) – probe upstream data (events)
	PadProbeTypeDataBoth        PadProbeType = C.GST_PAD_PROBE_TYPE_DATA_BOTH        // (240) – probe upstream and downstream data (buffers, buffer lists, and events)
	PadProbeTypeBlockDownstream PadProbeType = C.GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM // (114) – probe and block downstream data (buffers, buffer lists, and events)
	PadProbeTypeBlockUpstream   PadProbeType = C.GST_PAD_PROBE_TYPE_BLOCK_UPSTREAM   // (130) – probe and block upstream data (events)
	PadProbeTypeEventBoth       PadProbeType = C.GST_PAD_PROBE_TYPE_EVENT_BOTH       // (192) – probe upstream and downstream events
	PadProbeTypeQueryBoth       PadProbeType = C.GST_PAD_PROBE_TYPE_QUERY_BOTH       // (1536) – probe upstream and downstream queries
	PadProbeTypeAllBoth         PadProbeType = C.GST_PAD_PROBE_TYPE_ALL_BOTH         // (1776) – probe upstream events and queries and downstream buffers, buffer lists, events and queries
	PadProbeTypeScheduling      PadProbeType = C.GST_PAD_PROBE_TYPE_SCHEDULING       // (12288) – probe push and pull
)

Type castings of PadProbeTypes

type Pipeline

type Pipeline struct {
	Bin
}

func NewPipeline

func NewPipeline(name string) *Pipeline

func ParseLaunch

func ParseLaunch(pipeline_description string) (*Pipeline, error)

func (*Pipeline) AsPipeline

func (p *Pipeline) AsPipeline() *Pipeline

type Query

type Query struct {
	GstObj
}

func QueryNewSeeking

func QueryNewSeeking(f Format) *Query

func (*Query) ParseSeeking

func (q *Query) ParseSeeking() (bool, int64, int64)

func (*Query) Unref

func (q *Query) Unref()

type Sample

type Sample C.GstSample

func NewSample

func NewSample(buffer *Buffer, caps *Caps) *Sample

func (*Sample) GetBuffer

func (s *Sample) GetBuffer() *Buffer

func (*Sample) GetCaps

func (s *Sample) GetCaps() *Caps

func (*Sample) Unref

func (s *Sample) Unref()

type SeekFlag

type SeekFlag C.GstSeekFlags

type Socket

type Socket struct {
	GstObj
}

func (*Socket) AsSocket

func (s *Socket) AsSocket() *Socket

type State

type State C.GstState

func (State) String

func (s State) String() string

type StateChangeReturn

type StateChangeReturn C.GstStateChangeReturn

type UserData

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

Directories

Path Synopsis
This simple test application create live H264 (or WebM - see commented lines) content from test source, decode it and display.
This simple test application create live H264 (or WebM - see commented lines) content from test source, decode it and display.

Jump to

Keyboard shortcuts

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