Modifier and Type | Class and Description |
---|---|
static interface |
AppSink.EOS
Signal emitted when this
AppSink got EOS. |
static interface |
AppSink.NEW_BUFFER
Signal emitted when this
AppSink when a new buffer is ready. |
static interface |
AppSink.NEW_BUFFER_LIST
Signal emitted when this
AppSink when a new buffer is ready. |
static interface |
AppSink.NEW_PREROLL
Signal emitted when this
AppSink when a new buffer is ready. |
BaseSink.HANDOFF, BaseSink.PREROLL_HANDOFF
Element.NO_MORE_PADS, Element.PAD_ADDED, Element.PAD_REMOVED
GObject.GCallback
NativeObject.Initializer
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
GST_NAME |
defaultInit, ownsHandle
Constructor and Description |
---|
AppSink(NativeObject.Initializer init) |
Modifier and Type | Method and Description |
---|---|
void |
connect(AppSink.EOS listener)
Adds a listener for the
eos signal. |
void |
connect(AppSink.NEW_BUFFER_LIST listener)
Adds a listener for the
new-buffer-list signal. |
void |
connect(AppSink.NEW_BUFFER listener)
Adds a listener for the
new-buffer signal. |
void |
connect(AppSink.NEW_PREROLL listener)
Adds a listener for the
new-preroll signal. |
void |
disconnect(AppSink.EOS listener)
Removes a listener for the
eos signal |
void |
disconnect(AppSink.NEW_BUFFER_LIST listener)
Removes a listener for the
new-buffer-list signal |
void |
disconnect(AppSink.NEW_BUFFER listener)
Removes a listener for the
new-buffer signal |
void |
disconnect(AppSink.NEW_PREROLL listener)
Removes a listener for the
new-preroll signal |
Caps |
getCaps()
Gets the Caps configured on this AppSink
|
boolean |
isEOS()
Checks if this AppSink is end-of-stream.
|
Buffer |
pullBuffer()
Pulls a
Buffer from the AppSink. |
Buffer |
pullPreroll()
Get the last preroll buffer in this AppSink.
|
void |
setCaps(Caps caps)
Sets the capabilities on the appsink element.
|
connect, connect, disconnect, disconnect, enableAsync, enableLastBuffer, getBlocksize, getLastBuffer, getLatency, getMaximumLateness, getRenderDelay, getTsOffset, isAsync, isLastBufferEnabled, isQOSEnabled, isSync, preroll, queryLatency, setBlocksize, setMaximumLateness, setQOSEnabled, setRenderDelay, setSync, setTsOffset, waitClock, waitEOS, waitPreroll
addPad, connect, connect, connect, disconnect, disconnect, disconnect, getBaseTime, getBus, getClock, getFactory, getPad, getPads, getRequestPad, getSinkPads, getSrcPads, getStartTime, getState, getState, getState, getState, getStaticPad, isPlaying, link, link, linkMany, linkPads, linkPadsFiltered, makeRawElement, pause, play, postMessage, ready, releaseRequestPad, removePad, sendEvent, setBaseTime, setLockedState, setStartTime, setState, stop, syncStateWithParent, unlink, unlinkMany, unlinkPads
addListenerProxy, getName, getParent, initializer, initializer, ref, removeListenerProxy, setName, steal, toString, unref
addCallback, connect, connect, connect, disconnect, disconnect, disposeNativeHandle, emit, emit, g_signal_connect, get, getPointer, getPropertyDefaultValue, getPropertyMaximumValue, getPropertyMinimumValue, getType, invalidate, objectForX, removeCallback, set
classFor, disown, dispose, equals, finalize, getNativeAddress, handle, hashCode, initializer, instanceFor, isDisposed, nativeValue, objectFor, objectFor, objectFor, objectFor
public static final java.lang.String GST_NAME
public AppSink(NativeObject.Initializer init)
public void setCaps(Caps caps)
After calling this method, the sink will only accept caps that match caps. If caps is non-fixed, you must check the caps on the buffers to get the actual used caps.
public Caps getCaps()
public boolean isEOS()
If an EOS event has been received, no more buffers can be pulled.
public Buffer pullPreroll()
This was the buffer that caused the appsink to preroll in the PAUSED state. This buffer can be pulled many times and remains available to the application even after EOS.
This function is typically used when dealing with a pipeline in the PAUSED state. Calling this function after doing a seek will give the buffer right after the seek position.
Note that the preroll buffer will also be returned as the first buffer
when calling pullBuffer()
.
If an EOS event was received before any buffers, this function returns
null. Use isEOS()
to check for the EOS condition.
This function blocks until a preroll buffer or EOS is received or the appsink element is set to the READY/NULL state.
Buffer
or null when the appsink is stopped or EOS.public Buffer pullBuffer()
Buffer
from the AppSink.
This function blocks until a buffer or EOS becomes available or the appsink element is set to the READY/NULL state.
This function will only return buffers when the appsink is in the PLAYING state. All rendered buffers will be put in a queue so that the application can pull buffers at its own rate. Note that when the application does not pull buffers fast enough, the queued buffers could consume a lot of memory, especially when dealing with raw video frames.
If an EOS event was received before any buffers, this function returns
null. Use isEOS()
to check for the EOS condition.
Returns: a #GstBuffer or NULL when the appsink is stopped or EOS.
Buffer
or NULL when the appsink is stopped or EOS.public void connect(AppSink.EOS listener)
eos
signal.listener
- public void disconnect(AppSink.EOS listener)
eos
signallistener
- The listener that was previously added.public void connect(AppSink.NEW_PREROLL listener)
new-preroll
signal. If a blocking
behaviour is not desirable, setting the "emit-signals" property to TRUE
will make appsink emit the "new-buffer" and "new-preroll" signals when a
buffer can be pulled without blocking.listener
- public void disconnect(AppSink.NEW_PREROLL listener)
new-preroll
signallistener
- The listener that was previously added.public void connect(AppSink.NEW_BUFFER listener)
new-buffer
signal. If a blocking
behaviour is not desirable, setting the "emit-signals" property to TRUE
will make appsink emit the "new-buffer" and "new-preroll" signals when a
buffer can be pulled without blocking.listener
- public void disconnect(AppSink.NEW_BUFFER listener)
new-buffer
signallistener
- The listener that was previously added.public void connect(AppSink.NEW_BUFFER_LIST listener)
new-buffer-list
signal.listener
- public void disconnect(AppSink.NEW_BUFFER_LIST listener)
new-buffer-list
signallistener
- The listener that was previously added.