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.ELEMENT_ADDED, Bin.ELEMENT_REMOVED
 
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
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 getNumQueuedFrames()
          Returns the number of buffers currently stored in the fifo linked list (still not pushed down the pipeline).
 int getQueueSize()
          Returns the current size of the AppSrc queue.
 void pushRGBFrame(Buffer buf)
          Pushes a buffer down the pipeline.
 void setQueueSize(int nFrames)
          Sets the size of the AppSrc queue.
 void start()
          Sets the state of the pipeline to PLAYING.
 void stop()
          Sets the state of the pipeline to PAUSED.
 
Methods inherited from class org.gstreamer.Bin
add, addMany, connect, connect, disconnect, disconnect, getElementByInterface, getElementByName, getElementByNameRecurseUp, getElements, getElementsRecursive, getElementsSorted, getSinks, getSources, remove, removeMany
 
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, setCaps, 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, getPointer, 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

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.
width - 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.
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 immediatelly 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 void start()
Sets the state of the pipeline to PLAYING.


stop

public void stop()
Sets the state of the pipeline to PAUSED.


setQueueSize

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

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

getQueueSize

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


getNumQueuedFrames

public int getNumQueuedFrames()
Returns the number of buffers currently stored in the fifo linked list (still not pushed down the pipeline).