de.humatic.dsj.src
Class ShoutcastSource

java.lang.Object
  extended by de.humatic.dsj.src.Source
      extended by de.humatic.dsj.src.NetworkSource
          extended by de.humatic.dsj.src.ShoutcastSource

public class ShoutcastSource
extends NetworkSource

ShoutcastSource plays Shoutcast audiostreams in mp3 or aac/aac+ format from http connections. NSV streams are not supported, be it audio only or audio and video.


Field Summary
 
Fields inherited from class de.humatic.dsj.src.NetworkSource
BUFFER_OVERFLOW, CONNECTION_TIMEOUT, FASTSTART, H264_FASTSTART, H264_FORCE_INLINE_SPS, H264_OMMIT_SPS, H264_PASS_INLINE_SPS, IDLE_TIMEOUT, KF_NOTIFY, LIVE_SRC, MAX_BUFFER_TIME, MAX_DURATION, MAX_FRAME_TIME, NO_USER_PROMPT, READ_USER_DATA, RECEIVE_TIMEOUT, RTCP_RECEIVE_ERROR, SEEK_FAILURE, SOCKET_ERROR, STARVING, UDP_UNCONNECTED
 
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
ShoutcastSource(java.lang.String path, int flags, java.beans.PropertyChangeListener listener)
          Anonymously connects to the stream at the given address.
ShoutcastSource(java.lang.String path, java.lang.String userName, java.lang.String password, int flags, java.beans.PropertyChangeListener listener)
          Connects to the stream at the given address using the supplied authorization.
%path can either be the address of the streaming server (like http://xxx.xxx.xxx.xxx:yyyy) or the path to a .pls playlist.
ShoutcastSource(java.net.URL url, int flags, java.beans.PropertyChangeListener listener)
          Anonymously connects to the stream at the given http URL.
 
Method Summary
 void closeSource(boolean terminate)
          Closes down the source.
 DSGraph createGraph(int graphFlags)
          Creates a DSGraph object with CompressedJavaSource filters that are fed from this source.
 DSGraph createGraph(int graphFlags, DSFilterInfo videoDecoder, DSFilterInfo audioDecoder)
          Creates a DSGraph object with CompressedJavaSource filters, fed from this source and the given video and audio decoders.
 DSMediaType[] getMediaTypes()
          Returns the media types created by this source.
 
Methods inherited from class de.humatic.dsj.src.NetworkSource
configurePasswordDialog, getDefaultInterfaceAddress, getPasswordDialogOptions, getServerInfo, getTimeConstraint, setConnectionTimeout, setHTTPConnector, setNetworkInterface, setSocketFactory, setTimeConstraint, setUserAgent
 
Methods inherited from class de.humatic.dsj.src.Source
addSourceFilter, asyncRead, canSeek, createSourceFilter_async, createSourceFilter, getAvailable, getBuffered, getGraph, getID, getMaxTimeLoaded, 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
 

Constructor Detail

ShoutcastSource

public ShoutcastSource(java.lang.String path,
                       int flags,
                       java.beans.PropertyChangeListener listener)
                throws java.lang.Exception
Anonymously connects to the stream at the given address. %path can either be the address of the streaming server (like http://xxx.xxx.xxx.xxx:yyyy) or the path to a .pls playlist. In the latter case the list will be parsed, sent to listeners as a String[] in PropertyChangeEvents of type DSFiltergraph.PLAYLIST_PARSED and the first entry will be opened.
Shoutcast metadata is transfered to listeners as byte[][] under type DSFiltergraph.SOURCE_USER_DATA.
If the stream requires authorization a password dialog will be brought up. Alternatively credentials can be given with the url, either as a query string (http://...?username=xyz&password=abc) or in VLC style (http://username:password@...)
There are currently no flags defined for this class.

Throws:
java.lang.Exception

ShoutcastSource

public ShoutcastSource(java.net.URL url,
                       int flags,
                       java.beans.PropertyChangeListener listener)
                throws java.lang.Exception
Anonymously connects to the stream at the given http URL. %path can either be the address of the streaming server (like http://xxx.xxx.xxx.xxx:yyyy) or the path to a .pls playlist. In the latter case the list will be parsed and sent to listeners as a String[] in PropertyChangeEvents of type DSFiltergraph.PLAYLIST_PARSED before the first entry will be opened.
Shoutcast metadata is transfered to listeners as byte[][] under type DSFiltergraph.SOURCE_USER_DATA.
If the stream requires authorization a password dialog will be brought up. Alternatively credentials can be given with the url, either as a query string (http://...?username=xyz&password=abc) or in VLC style (http://username:password@...)
There are currently no flags defined for this class.

Throws:
java.lang.Exception

ShoutcastSource

public ShoutcastSource(java.lang.String path,
                       java.lang.String userName,
                       java.lang.String password,
                       int flags,
                       java.beans.PropertyChangeListener listener)
                throws java.lang.Exception
Connects to the stream at the given address using the supplied authorization.
%path can either be the address of the streaming server (like http://xxx.xxx.xxx.xxx:yyyy) or the path to a .pls playlist. In the latter case the list will be parsed and sent to listeners as a String[] in PropertyChangeEvents of type DSFiltergraph.PLAYLIST_PARSED before the first entry will be opened.
Shoutcast metadata is transfered to listeners as byte[][] under type DSFiltergraph.SOURCE_USER_DATA.
There are currently no flags defined for this class.

Throws:
java.lang.Exception
Method Detail

closeSource

public void closeSource(boolean terminate)
Description copied from class: Source
Closes down the source. When %terminate is true, all socket and stream resources etc. will also be freed. This method is called internally when disposing off the graph that was using this source and is not normally used by application code.

Overrides:
closeSource in class Source

createGraph

public DSGraph createGraph(int graphFlags)
Description copied from class: Source
Creates a DSGraph object with CompressedJavaSource filters that are fed from this source.

Overrides:
createGraph in class Source

createGraph

public DSGraph createGraph(int graphFlags,
                           DSFilterInfo videoDecoder,
                           DSFilterInfo audioDecoder)
                    throws DSJException
Description copied from class: Source
Creates a DSGraph object with CompressedJavaSource filters, fed from this source and the given video and audio decoders. This is for special use cases where you know exactly what media formats to expect. Any decoder you do not want to specify may be null or DSFilterInfo.doNotRender(). Failure to put a given decoder into the graph will be announced via GRAPH_ERROR events and dsj will try to automatically pick an alternative (no exception will be thrown!).

Overrides:
createGraph in class Source
Throws:
DSJException

getMediaTypes

public DSMediaType[] getMediaTypes()
Description copied from class: Source
Returns the media types created by this source. Depending on the time of calling, this method needs to be taken with care as during format negotiation mediatype information may not yet or only be partially available.

Overrides:
getMediaTypes in class Source