de.humatic.dsj.src
Class NetworkSource

java.lang.Object
  extended by de.humatic.dsj.src.Source
      extended by de.humatic.dsj.src.NetworkSource
Direct Known Subclasses:
AsyncSource, ESNetworkSource, FLVSource, HTTPAudioSource, HTTPStreamingSource, MJPGNetworkSource, MKVSource, MPEG4Source, PSNetworkSource, RTMPSource, RTPSource, RTSPSource, ShoutcastSource, TSNetworkSource

public class NetworkSource
extends Source

Baseclass for network fed source objects.


Field Summary
static int BUFFER_OVERFLOW
          Source errors
static int CONNECTION_TIMEOUT
          Source errors
static int FASTSTART
          Source constructor options, subclasses define additional values.
static int H264_FASTSTART
          Source constructor options, subclasses define additional values.
static int H264_FORCE_INLINE_SPS
          Source constructor options, subclasses define additional values.
static int H264_OMMIT_SPS
          Source constructor options, subclasses define additional values.
static int H264_PASS_INLINE_SPS
          Source constructor options, subclasses define additional values.
static int IDLE_TIMEOUT
          time constraints
static int KF_NOTIFY
          Source constructor options, subclasses define additional values.
static int LIVE_SRC
          Source constructor options, subclasses define additional values.
static int MAX_BUFFER_TIME
          time constraints
static int MAX_DURATION
          Source errors
static int MAX_FRAME_TIME
          time constraints
static int NO_USER_PROMPT
          Source constructor options, subclasses define additional values.
static int READ_USER_DATA
          Source constructor options, subclasses define additional values.
static int RECEIVE_TIMEOUT
          Source errors
static int RTCP_RECEIVE_ERROR
          Source errors
static int SEEK_FAILURE
          Source errors
static int SOCKET_ERROR
          Source errors
static int STARVING
          Source errors
static int UDP_UNCONNECTED
          Source constructor options, subclasses define additional values.
 
Fields inherited from class de.humatic.dsj.src.Source
ASYNC, AUTO_GC, DIRECT, ES, FILTER_SETUP_ERROR, FLV, HTTP, HTTP_AUDIO, JAS, MJPG, MKV, MP4, PSNET, PULL, PUSH, RAW, RTMP, RTP, RTSP, SHOUTCAST, SS_CLOSED, SS_CONNECT, SS_CONNECTED, SS_DONE, SS_EOS, SS_FORMAT_READ, SS_RUNNING, SS_SEEKING, SS_SETUP, SS_STREAMS_READ, SS_TCP_ROLLOVER, TIMEOUT, TSFILE, TSNET, UNKNOWN
 
Constructor Summary
NetworkSource()
          Empty constructor, does nothing.
 
Method Summary
static void configurePasswordDialog(java.lang.String title, java.lang.String txt, java.lang.String lookAndFeel, javax.swing.ImageIcon icon)
          Changes the appearance of the authentication dialog brought up on password protected streams.
static java.net.InetAddress getDefaultInterfaceAddress()
           
static java.lang.Object[] getPasswordDialogOptions()
           
 java.lang.String getServerInfo()
           
static int getTimeConstraint(int constraint)
           
static void setConnectionTimeout(int msec)
          Adjusts the period, that connection attempts are given up after.
static void setHTTPConnector(HTTPConnector connector)
          Set an application defined HttpURLConnection factory class to be used by all subclasses that use URLConnection (MPEG4Source, FLVSource, AsyncSource, HTTPAudioSource, MJPGNetworkSource, PSNetworkSource, TSNetworkSource/http).
static void setNetworkInterface(java.net.NetworkInterface iface)
          Explicitely sets a network interface to be used by MulticastSockets.
static void setSocketFactory(javax.net.SocketFactory factory)
          Set the socket factory to be used by all subclasses that use java.net.Socket (RTSPSource, RTMPSource, HTTPStreamingSource).
static void setTimeConstraint(int constraint, int value)
           
static void setUserAgent(java.lang.String name)
          You can add an application specific prefix to the useragent string used when connecting to servers.
 
Methods inherited from class de.humatic.dsj.src.Source
addSourceFilter, asyncRead, canSeek, closeSource, createGraph, createGraph, createSourceFilter_async, createSourceFilter, getAvailable, getBuffered, getGraph, getID, getMaxTimeLoaded, getMediaTypes, getMinBufferTime, getNumChannels, getOffsetTime, getPath, getSourceDuration, getSourceFilter, getSourceFilters, getSourceFlags, getSourceTime, getTransport, getType, isLive, notifyChannelFailure, queryParameter_int, read, sendEvent, setOffsetTime, setSourceRate, setSourceTime, streamSeek, syncRead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIVE_SRC

public static final int LIVE_SRC
Source constructor options, subclasses define additional values.

See Also:
Constant Field Values

KF_NOTIFY

public static final int KF_NOTIFY
Source constructor options, subclasses define additional values.

See Also:
Constant Field Values

READ_USER_DATA

public static final int READ_USER_DATA
Source constructor options, subclasses define additional values.

See Also:
Constant Field Values

NO_USER_PROMPT

public static final int NO_USER_PROMPT
Source constructor options, subclasses define additional values.

See Also:
Constant Field Values

UDP_UNCONNECTED

public static final int UDP_UNCONNECTED
Source constructor options, subclasses define additional values.

See Also:
Constant Field Values

FASTSTART

public static final int FASTSTART
Source constructor options, subclasses define additional values.

See Also:
Constant Field Values

H264_FASTSTART

public static final int H264_FASTSTART
Source constructor options, subclasses define additional values.

See Also:
Constant Field Values

H264_OMMIT_SPS

public static final int H264_OMMIT_SPS
Source constructor options, subclasses define additional values.

See Also:
Constant Field Values

H264_FORCE_INLINE_SPS

public static final int H264_FORCE_INLINE_SPS
Source constructor options, subclasses define additional values.

See Also:
Constant Field Values

H264_PASS_INLINE_SPS

public static final int H264_PASS_INLINE_SPS
Source constructor options, subclasses define additional values.

See Also:
Constant Field Values

CONNECTION_TIMEOUT

public static final int CONNECTION_TIMEOUT
Source errors

See Also:
Constant Field Values

RECEIVE_TIMEOUT

public static final int RECEIVE_TIMEOUT
Source errors

See Also:
Constant Field Values

BUFFER_OVERFLOW

public static final int BUFFER_OVERFLOW
Source errors

See Also:
Constant Field Values

RTCP_RECEIVE_ERROR

public static final int RTCP_RECEIVE_ERROR
Source errors

See Also:
Constant Field Values

SEEK_FAILURE

public static final int SEEK_FAILURE
Source errors

See Also:
Constant Field Values

MAX_DURATION

public static final int MAX_DURATION
Source errors

See Also:
Constant Field Values

STARVING

public static final int STARVING
Source errors

See Also:
Constant Field Values

SOCKET_ERROR

public static final int SOCKET_ERROR
Source errors

See Also:
Constant Field Values

MAX_FRAME_TIME

public static final int MAX_FRAME_TIME
time constraints

See Also:
Constant Field Values

MAX_BUFFER_TIME

public static final int MAX_BUFFER_TIME
time constraints

See Also:
Constant Field Values

IDLE_TIMEOUT

public static final int IDLE_TIMEOUT
time constraints

See Also:
Constant Field Values
Constructor Detail

NetworkSource

public NetworkSource()
              throws java.lang.Exception
Empty constructor, does nothing. You need to extend this class or use the existing implementations.

Throws:
java.lang.Exception
Method Detail

getServerInfo

public java.lang.String getServerInfo()

setConnectionTimeout

public static void setConnectionTimeout(int msec)
Adjusts the period, that connection attempts are given up after. The default is 10 sec.


setUserAgent

public static void setUserAgent(java.lang.String name)
You can add an application specific prefix to the useragent string used when connecting to servers. Must be set before constructing network sources.


configurePasswordDialog

public static void configurePasswordDialog(java.lang.String title,
                                           java.lang.String txt,
                                           java.lang.String lookAndFeel,
                                           javax.swing.ImageIcon icon)
Changes the appearance of the authentication dialog brought up on password protected streams.
The defaults are:
title - "Authorization required!"
text - "Please enter username & password"
LookAndFeel - com.sun.java.swing.plaf.windows.WindowsLookAndFeel icon - undefined (null), uses JOptionPane defaults
Any parameter that is set to null will not be changed.


getPasswordDialogOptions

public static java.lang.Object[] getPasswordDialogOptions()

setNetworkInterface

public static void setNetworkInterface(java.net.NetworkInterface iface)
Explicitely sets a network interface to be used by MulticastSockets.


getDefaultInterfaceAddress

public static java.net.InetAddress getDefaultInterfaceAddress()
                                                       throws java.lang.Exception
Throws:
java.lang.Exception

setTimeConstraint

public static void setTimeConstraint(int constraint,
                                     int value)

getTimeConstraint

public static int getTimeConstraint(int constraint)

setHTTPConnector

public static void setHTTPConnector(HTTPConnector connector)
Set an application defined HttpURLConnection factory class to be used by all subclasses that use URLConnection (MPEG4Source, FLVSource, AsyncSource, HTTPAudioSource, MJPGNetworkSource, PSNetworkSource, TSNetworkSource/http). This provides a way to make sources work with proxy servers. For more details see HTTPConnector. Call this method with a null argument to reset to defaults.


setSocketFactory

public static void setSocketFactory(javax.net.SocketFactory factory)
Set the socket factory to be used by all subclasses that use java.net.Socket (RTSPSource, RTMPSource, HTTPStreamingSource). This provides a way to make sources work with SOCKS proxy servers. Currently only supported for TCP connections. Call with a null argument to reset to defaults.