Documentation ¶
Index ¶
- Constants
- Variables
- func BufferGetData(gstBuffer *Buffer) (data []byte, err error)
- func CheckPlugins(plugins []string) error
- func MemSet(b []byte, v byte)
- func SetVideoIPTransformCallback(vti VideoIPTransformer)
- func SetVideoTransformCallback(vti VideoTransformer)
- func TestChainCallback(plugin *Plugin, pad *Pad, buf []byte) int
- type Bin
- type Buffer
- type BufferPool
- type Bus
- type BytePool
- type Caps
- type ChainCallback
- type Clock
- type Element
- func (e *Element) AddPad(pad *Pad) bool
- func (e *Element) AsObj() unsafe.Pointer
- func (e *Element) EmitSignal(signal string)
- func (e *Element) GetClock() (gstClock *Clock)
- func (e *Element) GetClockBaseTime() uint64
- func (e *Element) GetPadTemplate(name string) (padTemplate *PadTemplate)
- func (e *Element) GetRequestPad(padTemplate *PadTemplate, name string, caps *Caps) (pad *Pad)
- func (e *Element) GetState() StateOptions
- func (e *Element) GetStaticPad(name string) (pad *Pad)
- func (e *Element) IsEOS() bool
- func (e *Element) Link(dst *Element) bool
- func (e *Element) Name() (name string)
- func (e *Element) PullSample() (sample *Sample, err error)
- func (e *Element) PullSampleBB(bb *bytes.Buffer) (err error)
- func (e *Element) PullSampleOrSkip(buf []byte, skip bool) (result []byte, err error)
- func (e *Element) PushBB(data *bytes.Buffer) (err error)
- func (e *Element) PushBuffer(data []byte) error
- func (e *Element) PushBufferAsync(buffer []byte, framerate int, frames int) error
- func (e *Element) QueryDuration() (time.Duration, error)
- func (e *Element) QueryPosition() (time.Duration, error)
- func (e *Element) SendEvent(event *Event) bool
- func (e *Element) SetObject(name string, value interface{})
- func (e *Element) SetPadAddedCallback(callback PadAddedCallback)
- func (e *Element) VideoOverlayExpose()
- func (e *Element) VideoOverlayHandleEvents(handleEvents bool)
- func (e *Element) VideoOverlaySetWindowHandle(windowID uintptr)
- type Elementer
- type Event
- type GMainLoop
- type Message
- type MessageType
- type Pad
- func (p *Pad) GetCurrentCaps() (gstCaps *Caps)
- func (p *Pad) IsEOS() bool
- func (p *Pad) IsLinked() bool
- func (p *Pad) Link(sink *Pad) (padLinkReturn PadLinkReturn)
- func (p *Pad) Name() string
- func (e *Pad) SetObject(name string, value interface{})
- func (p *Pad) Unlink(sink *Pad) (padLinkReturn PadLinkReturn)
- type PadAddedCallback
- type PadDirection
- type PadLinkReturn
- type PadTemplate
- type Pipeline
- type Plugin
- type Sample
- type StateOptions
- type Structure
- func (s *Structure) GetBool(name string) (bool, error)
- func (s *Structure) GetInt(name string) (int, error)
- func (s *Structure) GetInt64(name string) (int64, error)
- func (s *Structure) GetName() string
- func (s *Structure) GetString(name string) (string, error)
- func (s *Structure) GetUint(name string) (uint, error)
- func (s *Structure) SetValue(name string, value interface{})
- func (s *Structure) ToString() (str string)
- type VideoFrame
- type VideoFramePlane
- type VideoIPTransformPlugin
- type VideoIPTransformer
- type VideoTransformer
Constants ¶
const ( PAD_UNKNOWN = PadDirection(C.GST_PAD_UNKNOWN) PAD_SRC = PadDirection(C.GST_PAD_SRC) PAD_SINK = PadDirection(C.GST_PAD_SINK) )
const ( PadLinkOk PadLinkReturn = C.GST_PAD_LINK_OK PadLinkWrongHierarchy = C.GST_PAD_LINK_WRONG_HIERARCHY PadLinkWasLinked = C.GST_PAD_LINK_WAS_LINKED PadLinkWrongDirection = C.GST_PAD_LINK_WRONG_DIRECTION PadLinkNoFormat = C.GST_PAD_LINK_NOFORMAT PadLinkNoSched = C.GST_PAD_LINK_NOSCHED PadLinkRefused = C.GST_PAD_LINK_REFUSED )
Variables ¶
var (
ErrEOS = errors.New("EOS")
)
Functions ¶
func BufferGetData ¶
func CheckPlugins ¶
func SetVideoIPTransformCallback ¶
func SetVideoIPTransformCallback(vti VideoIPTransformer)
func SetVideoTransformCallback ¶
func SetVideoTransformCallback(vti VideoTransformer)
Types ¶
type BufferPool ¶
type BufferPool struct {
// contains filtered or unexported fields
}
BufferPool implements a pool of bytes.Buffers in the form of a bounded channel.
func NewBufferPool ¶
func NewBufferPool(size int) (bp *BufferPool)
NewBufferPool creates a new BufferPool bounded to the given size.
func (*BufferPool) Get ¶
func (bp *BufferPool) Get() (b *bytes.Buffer)
Get gets a Buffer from the BufferPool, or creates a new one if none are available in the pool.
func (*BufferPool) NumPooled ¶
func (bp *BufferPool) NumPooled() int
NumPooled returns the number of items currently pooled.
func (*BufferPool) Put ¶
func (bp *BufferPool) Put(b *bytes.Buffer)
Put returns the given Buffer to the BufferPool.
type Bus ¶
func (*Bus) HavePending ¶
func (*Bus) Pull ¶
func (b *Bus) Pull(messageType MessageType) (message *Message)
type BytePool ¶
type BytePool struct {
// contains filtered or unexported fields
}
BytePool implements a leaky pool of []byte in the form of a bounded channel. It has to be for the similar arrays to avoid memory wasting
func NewBytePool ¶
NewBytePool creates a new BytePool bounded to the given maxSize, with new byte arrays sized based on width.
func (*BytePool) Get ¶
Get gets a []byte from the BytePool, or creates a new one if none are available in the pool.
type Clock ¶
func (*Clock) GetClockTime ¶
type Element ¶
type Element struct { GstElement *C.GstElement // contains filtered or unexported fields }
func ElementFactoryMake ¶
func (*Element) EmitSignal ¶
Emits signal without parametrs
func (*Element) GetClockBaseTime ¶
func (*Element) GetPadTemplate ¶
func (e *Element) GetPadTemplate(name string) (padTemplate *PadTemplate)
func (*Element) GetRequestPad ¶
func (e *Element) GetRequestPad(padTemplate *PadTemplate, name string, caps *Caps) (pad *Pad)
func (*Element) GetState ¶
func (e *Element) GetState() StateOptions
func (*Element) GetStaticPad ¶
func (*Element) PullSample ¶
func (*Element) PullSampleBB ¶
Pulls sample from the pipeline into *bytes.Buffer. To keep pipe running and don't exost memory, we need to pull samples. But if we doesn't nee them, we may pass nil to the function. In this case sample won't be copied, function just unref() it and returns nil error.
func (*Element) PullSampleOrSkip ¶
Pulls sanple to keep pipe run, but if skeep doesn't copy it just unref() and returns nil
func (*Element) PushBuffer ¶
func (*Element) PushBufferAsync ¶
Helper function for async pusher
func (*Element) SetPadAddedCallback ¶
func (e *Element) SetPadAddedCallback(callback PadAddedCallback)
func (*Element) VideoOverlayExpose ¶
func (e *Element) VideoOverlayExpose()
VideoOverlayExpose tells an overlay that it has been exposed. This will redraw the current frame in the drawable even if the pipeline is PAUSED.
func (*Element) VideoOverlayHandleEvents ¶
VideoOverlayHandleEvents tells an overlay that it should handle events from the window system. These events are forwarded upstream as navigation events. In some window system, events are not propagated in the window hierarchy if a client is listening for them. This method allows you to disable events handling completely from the GstVideoOverlay.
func (*Element) VideoOverlaySetWindowHandle ¶
VideoOverlaySetWindowHandle will call the video overlay's set_window_handle method. You should use this method to tell to an overlay to display video output to a specific window (e.g. an XWindow on X11). Passing 0 as the handle will tell the overlay to stop using that window and create an internal one. registers the windowID for video output of the element.
type Event ¶
func NewEosEvent ¶
func NewEosEvent() (event *Event)
type GMainLoop ¶
func MainLoopNew ¶
func MainLoopNew() (loop *GMainLoop)
type Message ¶
type Message struct {
C *C.GstMessage
}
func (*Message) GetStructure ¶
func (*Message) GetType ¶
func (message *Message) GetType() (messageType MessageType)
type MessageType ¶
type MessageType 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 MessageStructureChange 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 MessageAny MessageType = C.GST_MESSAGE_ANY )
type Pad ¶
type Pad struct {
// contains filtered or unexported fields
}
func (*Pad) GetCurrentCaps ¶
func (*Pad) Link ¶
func (p *Pad) Link(sink *Pad) (padLinkReturn PadLinkReturn)
func (*Pad) Unlink ¶
func (p *Pad) Unlink(sink *Pad) (padLinkReturn PadLinkReturn)
type PadAddedCallback ¶
type PadDirection ¶
type PadDirection C.GstPadDirection
func (PadDirection) String ¶
func (p PadDirection) String() string
type PadLinkReturn ¶
type PadLinkReturn int
type PadTemplate ¶
type PadTemplate struct {
C *C.GstPadTemplate
}
type Pipeline ¶
type Pipeline struct {
Bin
}
func ParseLaunch ¶
func PipelineNew ¶
func (*Pipeline) GetLatency ¶
func (*Pipeline) SetLatency ¶
func (*Pipeline) SetState ¶
func (p *Pipeline) SetState(state StateOptions)
type Plugin ¶
type Plugin struct { Element // contains filtered or unexported fields }
func (*Plugin) SetOnChainCallback ¶
func (e *Plugin) SetOnChainCallback(callback ChainCallback)
type StateOptions ¶
type StateOptions int
const ( StateVoidPending StateOptions = C.GST_STATE_VOID_PENDING StateNull StateOptions = C.GST_STATE_NULL StateReady StateOptions = C.GST_STATE_READY StatePaused StateOptions = C.GST_STATE_PAUSED StatePlaying StateOptions = C.GST_STATE_PLAYING )
type VideoFrame ¶
type VideoFrame struct { GstVideoFrame *C.GstVideoFrame Format int NPlanes int Size int }
func NewVideoFrame ¶
func NewVideoFrame(frame *C.GstVideoFrame) (vfr *VideoFrame)
func (*VideoFrame) Plane ¶
func (vfr *VideoFrame) Plane(n int) (plane VideoFramePlane)
type VideoFramePlane ¶
type VideoFramePlane struct { Pixels []byte Size int Stride int PixelStride int Height int Width int }
func (*VideoFramePlane) Close ¶
func (vfr *VideoFramePlane) Close()
type VideoIPTransformPlugin ¶
type VideoIPTransformPlugin struct {
Element
}
func (*VideoIPTransformPlugin) CallbackID ¶
func (vfp *VideoIPTransformPlugin) CallbackID() uintptr
func (*VideoIPTransformPlugin) GetElement ¶
func (vfp *VideoIPTransformPlugin) GetElement() Element
func (*VideoIPTransformPlugin) TransformIP ¶
func (vfp *VideoIPTransformPlugin) TransformIP(vf *VideoFrame) error
"Pure virtual method :)
type VideoIPTransformer ¶
type VideoIPTransformer interface { Elementer TransformIP(frame *VideoFrame) error }
type VideoTransformer ¶
type VideoTransformer interface { Elementer Transform(inframe, outframe *VideoFrame) error }