|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gstreamer.lowlevel.NativeValue
org.gstreamer.lowlevel.Handle
org.gstreamer.lowlevel.NativeObject
org.gstreamer.lowlevel.RefCountedObject
org.gstreamer.GObject
org.gstreamer.GstObject
org.gstreamer.Element
org.gstreamer.elements.BaseSink
org.gstreamer.elements.AppSink
public class AppSink
A sink Element
that enables an application to pull data
from a pipeline.
Nested Class Summary | |
---|---|
static interface |
AppSink.NEW_BUFFER
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. |
Nested classes/interfaces inherited from class org.gstreamer.Element |
---|
Element.HANDOFF, Element.NO_MORE_PADS, Element.PAD_ADDED, Element.PAD_REMOVED |
Nested classes/interfaces inherited from class org.gstreamer.GObject |
---|
GObject.GCallback |
Nested classes/interfaces inherited from class org.gstreamer.lowlevel.NativeObject |
---|
NativeObject.Initializer |
Field Summary |
---|
Fields inherited from class org.gstreamer.lowlevel.NativeObject |
---|
defaultInit, ownsHandle |
Constructor Summary | |
---|---|
AppSink(NativeObject.Initializer init)
|
Method Summary | |
---|---|
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.NEW_BUFFER listener)
Removes a listener for the new-buffer signal |
void |
disconnect(AppSink.NEW_PREROLL listener)
Removes a listener for the new-buffer 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. |
Methods inherited from class org.gstreamer.elements.BaseSink |
---|
getMaximumLateness, isQOSEnabled, isSync, setMaximumLateness, setQOSEnabled, setSync |
Methods inherited from class org.gstreamer.Element |
---|
addPad, connect, connect, connect, connect, disconnect, disconnect, disconnect, disconnect, getBaseTime, getBus, getClock, getFactory, getPad, getPads, getRequestPad, getSinkPads, getSrcPads, getState, getState, getState, getState, getStaticPad, link, link, linkMany, linkPads, linkPadsFiltered, makeRawElement, postMessage, releaseRequestPad, removePad, sendEvent, setState, syncStateWithParent, unlink, unlinkMany, unlinkPads |
Methods inherited from class org.gstreamer.GstObject |
---|
addListenerProxy, getName, getParent, initializer, initializer, objectFor, objectFor, ref, removeListenerProxy, setName, steal, toString, unref |
Methods inherited from class org.gstreamer.GObject |
---|
addCallback, connect, connect, connect, disconnect, disconnect, disposeNativeHandle, g_signal_connect, get, getPointer, getPropertyDefaultValue, getPropertyMaximumValue, getPropertyMinimumValue, invalidate, objectFor, removeCallback, set |
Methods inherited from class org.gstreamer.lowlevel.NativeObject |
---|
classFor, disown, dispose, equals, finalize, getNativeAddress, handle, hashCode, initializer, instanceFor, isDisposed, nativeValue, objectFor, objectFor |
Methods inherited from class java.lang.Object |
---|
clone, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AppSink(NativeObject.Initializer init)
Method Detail |
---|
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.
setCaps
in class Element
caps
- The Caps to set.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.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
signal
listener
- 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-buffer
signal
listener
- The listener that was previously added.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |