org.gstreamer.elements
Class AppSink

java.lang.Object
  extended by org.gstreamer.lowlevel.NativeValue
      extended by org.gstreamer.lowlevel.Handle
          extended by org.gstreamer.lowlevel.NativeObject
              extended by org.gstreamer.lowlevel.RefCountedObject
                  extended by org.gstreamer.GObject
                      extended by org.gstreamer.GstObject
                          extended by org.gstreamer.Element
                              extended by org.gstreamer.elements.BaseSink
                                  extended by org.gstreamer.elements.AppSink

public class AppSink
extends BaseSink

A sink Element that enables an application to pull data from a pipeline.


Nested Class Summary
 
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
org.gstreamer.lowlevel.NativeObject.Initializer
 
Field Summary
 
Fields inherited from class org.gstreamer.lowlevel.NativeObject
defaultInit, ownsHandle
 
Constructor Summary
AppSink(org.gstreamer.lowlevel.NativeObject.Initializer init)
           
 
Method Summary
 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, unlink, unlinkMany, unlinkPads
 
Methods inherited from class org.gstreamer.GstObject
addListenerProxy, getName, 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, 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

AppSink

public AppSink(org.gstreamer.lowlevel.NativeObject.Initializer init)
Method Detail

setCaps

public void setCaps(Caps caps)
Sets the capabilities on the appsink element.

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.

Overrides:
setCaps in class Element
Parameters:
caps - The Caps to set.

getCaps

public Caps getCaps()
Gets the Caps configured on this AppSink

Returns:
The caps configured on this AppSink

isEOS

public boolean isEOS()
Checks if this AppSink is end-of-stream.

If an EOS event has been received, no more buffers can be pulled.

Returns:
true if no more buffers can be pulled and this AppSink is EOS.

pullPreroll

public Buffer pullPreroll()
Get the last preroll buffer in this AppSink.

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.

Returns:
A Buffer or null when the appsink is stopped or EOS.

pullBuffer

public Buffer pullBuffer()
Pulls a 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.

Returns:
A Buffer or NULL when the appsink is stopped or EOS.