de.humatic.dsj.sink
Class MJPGSink

java.lang.Object
  extended by de.humatic.dsj.sink.JSink
      extended by de.humatic.dsj.sink.MJPGSink
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener

public class MJPGSink
extends JSink

Simple sink streaming video data in Motion JPG format via a HTTP server or to a supplied OutputStream. This effectively mimics a MJPEG IP camera.


Field Summary
 
Fields inherited from class de.humatic.dsj.sink.JSink
AV_SYNC_IN, BUFFER_OVERFLOW, CLOSED, CONNECT, CONNECTED, CONNECTION_TIMEOUT, DISPLAY_LOCAL, DUMP, ERROR, HTTP_AUDIO, LOCAL, MAX_BT_DROP, MAX_BT_WARN, MAX_DURATION, MIN_BT, MJPG, MKV, NO_AUDIO, NO_VIDEO, OFFSET_TIME_IN, OFFSET_TIME_OUT, OPT_PKT_SIZE, PIPE_SIZE, pipeSize, PREVIEW, RTMP, RTP, SHOW_DLG_SAVE, SHOW_ENC_DLG, SOCKET_ERROR, SOCKET_SBS, socketSendBufferSize, STARVING, TSNET, UNCONNECTED
 
Constructor Summary
MJPGSink(DSFiltergraph src, int port, DSFilterInfo videoEncoder, DSFilterInfo audioEncoder, int flags)
          Creates a server socket on the given port and streams the filtergraph's video in MJPG format to clients requesting any resource ending in ".mjpg" or accepting "image/jpeg" MIME types.
MJPGSink(DSFiltergraph src, java.io.OutputStream out, DSFilterInfo videoEncoder, DSFilterInfo audioEncoder, int flags)
          Streams the filtergraph's video in MJPG format to the given OutputStream.
 
Method Summary
 void close()
          Shuts down the sink and frees all resources it allocated.
 void sampleReceived(SampleBuffer inBuffer)
          Called from SampleAccessFilters used by this sink.
 
Methods inherited from class de.humatic.dsj.sink.JSink
create, getID, getOutputBufferSize, getOutputMediaType, propertyChange, setNetworkInterface, setSinkOption, setSocketOption
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MJPGSink

public MJPGSink(DSFiltergraph src,
                int port,
                DSFilterInfo videoEncoder,
                DSFilterInfo audioEncoder,
                int flags)
         throws java.lang.Exception
Creates a server socket on the given port and streams the filtergraph's video in MJPG format to clients requesting any resource ending in ".mjpg" or accepting "image/jpeg" MIME types. Audio is currently not supported and will be ignored.
If %videoEncoder is null or DSFilterInfo.doNotRender() this will use javax.imagio for jpeg encoding, otherwise the given native (MotionJPEG) compressor will be used.

Throws:
java.lang.Exception

MJPGSink

public MJPGSink(DSFiltergraph src,
                java.io.OutputStream out,
                DSFilterInfo videoEncoder,
                DSFilterInfo audioEncoder,
                int flags)
         throws java.lang.Exception
Streams the filtergraph's video in MJPG format to the given OutputStream. Audio is currently not supported and will be ignored.
If %videoEncoder is null or DSFilterInfo.doNotRender() this will use javax.imagio for jpeg encoding, otherwise the given native (MotionJPEG) compressor will be used.

Throws:
java.lang.Exception
Method Detail

close

public void close()
Description copied from class: JSink
Shuts down the sink and frees all resources it allocated. This method is called internally when disposing off the graph that was using this sink and is not normally used by application code.

Overrides:
close in class JSink

sampleReceived

public void sampleReceived(SampleBuffer inBuffer)
Description copied from class: JSink
Called from SampleAccessFilters used by this sink.

Overrides:
sampleReceived in class JSink