de.humatic.dsj.sink
Class JSink

java.lang.Object
  extended by de.humatic.dsj.sink.JSink
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener
Direct Known Subclasses:
HTTPAudioSink, MJPGSink, MKVSink, RTMPSink, RTPSink, TSNetworkSink

public class JSink
extends java.lang.Object
implements java.beans.PropertyChangeListener

Baseclass for non DirectShow Sinks. JSink provides the basic functionality for intercepting dataflow in a DSFiltergraph and will call its subclasses' sampleReceived method with video or audio samples. Subclasses then provide packetizing and network functionality according to the protocol they implement.
Unlike subclasses of Sink, JSinks will effectively be connected to the filtergraph after construction and DSFiltergraph.connectSink(..) is not needed.


Field Summary
static int AV_SYNC_IN
          Sink errors
static int BUFFER_OVERFLOW
          Sink errors
static int CLOSED
           
static int CONNECT
           
static int CONNECTED
           
static int CONNECTION_TIMEOUT
          Sink errors
static int DISPLAY_LOCAL
           
static int DUMP
          subtypes
static int ERROR
           
static int HTTP_AUDIO
          subtypes
static int LOCAL
           
static int MAX_BT_DROP
          Sink options
static int MAX_BT_WARN
          Sink options
static int MAX_DURATION
          Sink errors
static int MIN_BT
          Sink options
static int MJPG
          subtypes
static int MKV
          subtypes
static int NO_AUDIO
           
static int NO_VIDEO
           
static int OFFSET_TIME_IN
          Sink options
static int OFFSET_TIME_OUT
          Sink options
static int OPT_PKT_SIZE
           
static int PIPE_SIZE
          Sink options
static int pipeSize
           
static int PREVIEW
           
static int RTMP
          subtypes
static int RTP
          subtypes
static int SHOW_DLG_SAVE
           
static int SHOW_ENC_DLG
           
static int SOCKET_ERROR
          Sink errors
static int SOCKET_SBS
          Sink options
static int socketSendBufferSize
           
static int STARVING
          Sink errors
static int TSNET
          subtypes
static int UNCONNECTED
           
 
Method Summary
 void close()
          Shuts down the sink and frees all resources it allocated.
static JSink create(int type, DSFiltergraph src, java.io.OutputStream os, DSMediaType[] types, int sinkFlags)
           
 int getID()
           
 int getOutputBufferSize(int units)
          Returns the number of samples (units == 0) or the time worth of data (units == 1) currently in the output queue.
 DSMediaType getOutputMediaType(int majorType)
           
 void propertyChange(java.beans.PropertyChangeEvent pe)
           
 void sampleReceived(SampleBuffer buffer)
          Called from SampleAccessFilters used by this sink.
static void setNetworkInterface(java.net.NetworkInterface iface)
           
 void setSinkOption(int option, int value)
           
static void setSocketOption(int option, int value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MJPG

public static final int MJPG
subtypes

See Also:
Constant Field Values

RTP

public static final int RTP
subtypes

See Also:
Constant Field Values

RTMP

public static final int RTMP
subtypes

See Also:
Constant Field Values

TSNET

public static final int TSNET
subtypes

See Also:
Constant Field Values

HTTP_AUDIO

public static final int HTTP_AUDIO
subtypes

See Also:
Constant Field Values

MKV

public static final int MKV
subtypes

See Also:
Constant Field Values

DUMP

public static final int DUMP
subtypes

See Also:
Constant Field Values

LOCAL

public static final int LOCAL
See Also:
Constant Field Values

PREVIEW

public static final int PREVIEW
See Also:
Constant Field Values

DISPLAY_LOCAL

public static final int DISPLAY_LOCAL
See Also:
Constant Field Values

SHOW_ENC_DLG

public static final int SHOW_ENC_DLG
See Also:
Constant Field Values

SHOW_DLG_SAVE

public static final int SHOW_DLG_SAVE
See Also:
Constant Field Values

UNCONNECTED

public static final int UNCONNECTED
See Also:
Constant Field Values

NO_AUDIO

public static final int NO_AUDIO
See Also:
Constant Field Values

NO_VIDEO

public static final int NO_VIDEO
See Also:
Constant Field Values

OPT_PKT_SIZE

public static final int OPT_PKT_SIZE
See Also:
Constant Field Values

CONNECT

public static final int CONNECT
See Also:
Constant Field Values

CONNECTED

public static final int CONNECTED
See Also:
Constant Field Values

CLOSED

public static final int CLOSED
See Also:
Constant Field Values

ERROR

public static final int ERROR
See Also:
Constant Field Values

CONNECTION_TIMEOUT

public static final int CONNECTION_TIMEOUT
Sink errors

See Also:
Constant Field Values

BUFFER_OVERFLOW

public static final int BUFFER_OVERFLOW
Sink errors

See Also:
Constant Field Values

MAX_DURATION

public static final int MAX_DURATION
Sink errors

See Also:
Constant Field Values

STARVING

public static final int STARVING
Sink errors

See Also:
Constant Field Values

SOCKET_ERROR

public static final int SOCKET_ERROR
Sink errors

See Also:
Constant Field Values

AV_SYNC_IN

public static final int AV_SYNC_IN
Sink errors

See Also:
Constant Field Values

SOCKET_SBS

public static final int SOCKET_SBS
Sink options

See Also:
Constant Field Values

PIPE_SIZE

public static final int PIPE_SIZE
Sink options

See Also:
Constant Field Values

MIN_BT

public static final int MIN_BT
Sink options

See Also:
Constant Field Values

MAX_BT_WARN

public static final int MAX_BT_WARN
Sink options

See Also:
Constant Field Values

MAX_BT_DROP

public static final int MAX_BT_DROP
Sink options

See Also:
Constant Field Values

OFFSET_TIME_IN

public static final int OFFSET_TIME_IN
Sink options

See Also:
Constant Field Values

OFFSET_TIME_OUT

public static final int OFFSET_TIME_OUT
Sink options

See Also:
Constant Field Values

socketSendBufferSize

public static int socketSendBufferSize

pipeSize

public static int pipeSize
Method Detail

create

public static JSink create(int type,
                           DSFiltergraph src,
                           java.io.OutputStream os,
                           DSMediaType[] types,
                           int sinkFlags)
                    throws java.lang.Exception
Throws:
java.lang.Exception

setNetworkInterface

public static void setNetworkInterface(java.net.NetworkInterface iface)

getOutputMediaType

public DSMediaType getOutputMediaType(int majorType)

getOutputBufferSize

public int getOutputBufferSize(int units)
Returns the number of samples (units == 0) or the time worth of data (units == 1) currently in the output queue. Not all JSinks use an output queue so this may be 0 and it should also not be expected to be 100% accurate in other cases.


setSocketOption

public static void setSocketOption(int option,
                                   int value)

setSinkOption

public void setSinkOption(int option,
                          int value)

getID

public int getID()

close

public void close()
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.


propertyChange

public void propertyChange(java.beans.PropertyChangeEvent pe)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

sampleReceived

public void sampleReceived(SampleBuffer buffer)
Called from SampleAccessFilters used by this sink.