org.gstreamer.elements
Class RGBDataFileSink

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.Bin
                                  extended by org.gstreamer.elements.RGBDataFileSink

public class RGBDataFileSink
extends Bin

This bin encapsulates a pipeline that allows to encode RGB buffers into a video file. It uses the AppSrc element to inject the buffers into the gst pipeline.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.gstreamer.Bin
Bin.DO_LATENCY, Bin.ELEMENT_ADDED, Bin.ELEMENT_REMOVED
 
Nested classes/interfaces inherited from class org.gstreamer.Element
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.Bin
DEBUG_GRAPH_SHOW_ALL, DEBUG_GRAPH_SHOW_CAPS_DETAILS, DEBUG_GRAPH_SHOW_MEDIA_TYPE, DEBUG_GRAPH_SHOW_NON_DEFAULT_PARAMS, DEBUG_GRAPH_SHOW_STATES
 
Fields inherited from class org.gstreamer.lowlevel.NativeObject
defaultInit, ownsHandle
 
Constructor Summary
RGBDataFileSink(java.lang.String name, int width, int height, int fps, java.lang.String encoderStr, java.lang.String[] encoderPropertyNames, java.lang.Object[] encoderPropertyData, java.lang.String muxerStr, java.io.File file)
          Creates a new RGBDataFileSink.
 
Method Summary
 int getNumDroppedFrames()
          Returns the number of dropped frames until now.
 int getNumQueuedFrames()
          Returns the number of frames currently stored in pre-encoding queue, still not sent to the encoding pipeline.
 int getPreQueueSize()
          Returns the size of the pre-encoding queue.
 int getSrcQueueSize()
          Returns the current size of the AppSrc queue.
 void pushRGBFrame(Buffer buf)
          Pushes a buffer down the pipeline.
 void setPreQueueSize(int nFrames)
          Sets the size of the pre-encoding queue, which is stored on the Java side.
 void setSrcQueueSize(int nFrames)
          Sets the size of the AppSrc queue.
 StateChangeReturn start()
          Sets the state of the pipeline to PLAYING.
 StateChangeReturn stop()
          Sets the state of the pipeline to NULL and closes the stream.
 
Methods inherited from class org.gstreamer.Bin
add, addMany, connect, connect, connect, debugToDotFile, debugToDotFile, disconnect, disconnect, disconnect, getElementByInterface, getElementByName, getElementByNameRecurseUp, getElements, getElementsRecursive, getElementsSorted, getSinks, getSources, launch, remove, removeMany
 
Methods inherited from class org.gstreamer.Element
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, setCaps, setLockedState, setStartTime, setState, syncStateWithParent, unlink, unlinkMany, unlinkPads
 
Methods inherited from class org.gstreamer.GstObject
addListenerProxy, getName, getParent, initializer, initializer, ref, removeListenerProxy, setName, steal, toString, unref
 
Methods inherited from class org.gstreamer.GObject
addCallback, connect, connect, connect, disconnect, disconnect, disposeNativeHandle, emit, emit, g_signal_connect, get, getPointer, getPropertyDefaultValue, getPropertyMaximumValue, getPropertyMinimumValue, getType, 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, objectFor
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RGBDataFileSink

public RGBDataFileSink(java.lang.String name,
                       int width,
                       int height,
                       int fps,
                       java.lang.String encoderStr,
                       java.lang.String[] encoderPropertyNames,
                       java.lang.Object[] encoderPropertyData,
                       java.lang.String muxerStr,
                       java.io.File file)
Creates a new RGBDataFileSink.

Parameters:
name - The name used to identify this RGBDataFileSink.
width - The width of the buffers that will be sent.
height - The height of the buffers that will be sent.
fps - The framerate with which the buffers should be saved to file.
encoderStr - The name of the encoder to use.
encoderPropertyNames - Array of property names for the encoder.
encoderPropertyData - Array of property values for the encoder.
muxerStr - The name of the muxer to use
file - Output file where the stream is saved to.
Method Detail

pushRGBFrame

public void pushRGBFrame(Buffer buf)
Pushes a buffer down the pipeline.

Parameters:
buf - The buffer to push. Actually, it is not immediately pushed into the gst pipeline, but it is added to a fifo linked list that holds the buffer temporarily until the AppSrc requests more data for its internal queue.

start

public StateChangeReturn start()
Sets the state of the pipeline to PLAYING.


stop

public StateChangeReturn stop()
Sets the state of the pipeline to NULL and closes the stream.

Overrides:
stop in class Element

setPreQueueSize

public void setPreQueueSize(int nFrames)
Sets the size of the pre-encoding queue, which is stored on the Java side.

Parameters:
nFrames - Size of the buffer expressed in number of frames.

getPreQueueSize

public int getPreQueueSize()
Returns the size of the pre-encoding queue.


getNumQueuedFrames

public int getNumQueuedFrames()
Returns the number of frames currently stored in pre-encoding queue, still not sent to the encoding pipeline.


setSrcQueueSize

public void setSrcQueueSize(int nFrames)
Sets the size of the AppSrc queue.

Parameters:
nFrames - Size of the queue expressed in number of frames.

getSrcQueueSize

public int getSrcQueueSize()
Returns the current size of the AppSrc queue.


getNumDroppedFrames

public int getNumDroppedFrames()
Returns the number of dropped frames until now.