|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.humatic.dsj.src.Source
de.humatic.dsj.src.NetworkSource
de.humatic.dsj.src.RTMPSource
public class RTMPSource
Source to read data from a rtmp connection as used by Flash for the transport of audio, video and
shared objects.
dsj 0_8_62 adds support for rtmp tunnelled via http (use a rtmpt:// path).
The source currently supports FLV1 (Sorenson Spark / H263) & FLV4 (On2 VP6) videostreams with mp3 & Nellymoser audio as well as
H264 mp4 streams with AAC or mp3 audio. dsj 0_8_6 adds support for flv tagged data over rtmp as used with .f4v streams.
Please note that all these formats require decoder filters to be installed. ffdShow / libavcodec should handle all
formats to be encountered and is explicitely required for Nellymoser audio. Other formats will also work with other
decoders.
This class supports plain unencrypted RTMP only and may be used for receiving streaming video, audio and/or data content
for display only. Intercepting RTMP streams for storage on any kind of medium as well as attempting to break
copy-protection measures on RTMP delivered content is not allowed under dsj licensing terms.
| Nested Class Summary | |
|---|---|
class |
RTMPSource.SharedObject
SharedObjects are both Flash's equivalent to cookies as well as a means for data persistance and data exchange between FMS clients. |
| Field Summary | |
|---|---|
static int |
INTERACTIVE
Source flags |
static int |
IS_SINK
Source flags |
static int |
NO_STREAM
Source flags |
static int |
RS_CONNECTED
RTMP Connection states |
static int |
RS_CREATE_STREAM
RTMP Connection states |
static int |
RS_GOT_STR_LENGTH
RTMP Connection states |
static int |
RS_HANDSHAKE_DONE
RTMP Connection states |
static int |
RS_QUERY_STR_LENGTH
RTMP Connection states |
static int |
RS_REQUEST_PLAY
RTMP Connection states |
static int |
RS_STREAM_CREATED
RTMP Connection states |
static java.lang.String |
STR_FALSE
|
static java.lang.String |
STR_TRUE
|
static java.lang.String |
STR_UNDEFINED
|
| 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 | |
|---|---|
RTMPSource(java.lang.String ip,
int port,
java.lang.String serverApp,
java.lang.String resourceName,
ConnectionParameter[] connectionParams,
int flags,
java.beans.PropertyChangeListener listener)
Creates a RTMPSource and connects to the given server application running on the host at %ip, requesting the given resource. |
|
RTMPSource(java.lang.String ip,
int port,
java.lang.String serverApp,
java.lang.String resourceName,
java.beans.PropertyChangeListener listener)
Creates a RTMPSource and connects to the given server application running on the host at %ip, requesting the given resource. |
|
RTMPSource(java.lang.String appUrl,
java.lang.String resourceName,
ConnectionParameter[] connectionParams,
int flags,
java.beans.PropertyChangeListener listener)
Creates a RTMPSource and connects to the server application at the given url, requesting %resource. Extended parameters as given in %connectionParams will be passed to the NetStream.connect() method, eventually overwriting the defaults that dsj would send as a minimum requirement (flashVer, swfUrl, tcUrl, audioCodecs, videoCodecs, videoFunction and objectEncoding plus for mp4 streams fpad and capabilities). |
|
RTMPSource(java.lang.String appUrl,
java.lang.String resourceName,
int flags,
java.beans.PropertyChangeListener listener)
Creates a RTMPSource and connects to the server application at the given url, requesting %resource. |
|
| Method Summary | |
|---|---|
void |
closeSource(boolean terminate)
Closes down the source. |
void |
connectionIntercept(int connectionState,
java.lang.Object data)
When set up with the INTERACTIVE flag, the source during connection will wait for a short time after issuing RTMP_STATE_CHANGED events and client code may call this method to have additional rtmp sent to the server. %connectionState takes the current state that you react on as transferred in the value field of RTMP_STATE_CHANGED events. %data should either be raw rtmp data in a byte array or a SharedObject. |
DSGraph |
createGraph(int graphFlags)
Use this to create a filtergraph from the source. |
DSGraph |
createGraph(int graphFlags,
DSFilterInfo videoDecoder,
DSFilterInfo audioDecoder)
Use this to create a filtergraph with the given decoders from the source. |
CompressedJavaSource |
createSourceFilter(int sf,
DSMediaType mediaType)
This is called by the various source implementations once they have determined, what kind of media they deal with etc. It basically calls through to DSGraph.insertCompressedSourceFilter(...). |
int |
getEncoding()
|
DSMediaType[] |
getMediaTypes()
Returns the media types created by this source. |
int |
getMinBufferTime()
Returns this Source's minimum buffer requirements in msec worth of data. |
RTMPSource.SharedObject |
getSharedObject(java.lang.String soName,
java.lang.String path,
int flags)
|
int |
getSourceTime()
|
void |
sendRTMP(byte[] msg)
|
void |
sendRTMP(byte[] msg,
int offset,
int length)
|
void |
sendRTMP(RTMPMessage msg)
|
void |
setActionScriptHandler(java.lang.Object t)
Application code can register a class as a handler for actionscript method calls from the server. |
static void |
setClientStream(int streamID)
Sets the client stream ID used when connecting to the server. |
static void |
setEncoding(int amfVersion)
Set AMF encoding (RTMP.AMF_0 or AMF_3). |
static void |
setHandShakeData(byte[] hsd)
Allows to set the initial 1536 bytes sent to the server during handshake. |
static void |
setLocalPort(int port)
Sets the local port used for connecting to the server, picked by the socket if not explicitely set. |
static void |
setMinBufferTime(int time)
|
void |
setSourceRate(float rate)
Starts and pauses the source, application code should rather not use this method directly, but stick with DSFiltergraph methods. |
void |
setSourceTime(int time)
Repositions the source, application code should rather not use this method directly, but stick with DSFiltergraph methods. |
| 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, getAvailable, getBuffered, getGraph, getID, getMaxTimeLoaded, getNumChannels, getOffsetTime, getPath, getSourceDuration, getSourceFilter, getSourceFilters, getSourceFlags, getTransport, getType, isLive, notifyChannelFailure, queryParameter_int, read, sendEvent, setOffsetTime, streamSeek, syncRead |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int RS_HANDSHAKE_DONE
public static final int RS_CONNECTED
public static final int RS_QUERY_STR_LENGTH
public static final int RS_GOT_STR_LENGTH
public static final int RS_CREATE_STREAM
public static final int RS_STREAM_CREATED
public static final int RS_REQUEST_PLAY
public static final int INTERACTIVE
public static final int NO_STREAM
public static final int IS_SINK
public static final java.lang.String STR_UNDEFINED
public static final java.lang.String STR_TRUE
public static final java.lang.String STR_FALSE
| Constructor Detail |
|---|
public RTMPSource(java.lang.String ip,
int port,
java.lang.String serverApp,
java.lang.String resourceName,
java.beans.PropertyChangeListener listener)
throws java.lang.Exception
java.lang.Exception
public RTMPSource(java.lang.String ip,
int port,
java.lang.String serverApp,
java.lang.String resourceName,
ConnectionParameter[] connectionParams,
int flags,
java.beans.PropertyChangeListener listener)
throws java.lang.Exception
java.lang.Exception
public RTMPSource(java.lang.String appUrl,
java.lang.String resourceName,
int flags,
java.beans.PropertyChangeListener listener)
throws java.lang.Exception
java.lang.Exception
public RTMPSource(java.lang.String appUrl,
java.lang.String resourceName,
ConnectionParameter[] connectionParams,
int flags,
java.beans.PropertyChangeListener listener)
throws java.lang.Exception
java.lang.Exception| Method Detail |
|---|
public static void setMinBufferTime(int time)
public int getMinBufferTime()
Source
getMinBufferTime in class Sourcepublic static void setLocalPort(int port)
public static void setClientStream(int streamID)
public static void setHandShakeData(byte[] hsd)
public static void setEncoding(int amfVersion)
public int getEncoding()
public void closeSource(boolean terminate)
Source
closeSource in class Sourcepublic int getSourceTime()
getSourceTime in class Sourcepublic void setSourceTime(int time)
Source
setSourceTime in class Sourcepublic void setSourceRate(float rate)
Source
setSourceRate in class Source
public DSGraph createGraph(int graphFlags)
throws DSJException
createGraph in class SourceDSJException
public DSGraph createGraph(int graphFlags,
DSFilterInfo videoDecoder,
DSFilterInfo audioDecoder)
throws DSJException
createGraph in class SourceDSJException
public CompressedJavaSource createSourceFilter(int sf,
DSMediaType mediaType)
Source
createSourceFilter in class Sourcepublic DSMediaType[] getMediaTypes()
Source
getMediaTypes in class Source
public void connectionIntercept(int connectionState,
java.lang.Object data)
public void sendRTMP(RTMPMessage msg)
throws java.lang.Exception
java.lang.Exception
public void sendRTMP(byte[] msg)
throws java.lang.Exception
java.lang.Exception
public void sendRTMP(byte[] msg,
int offset,
int length)
throws java.lang.Exception
java.lang.Exception
public RTMPSource.SharedObject getSharedObject(java.lang.String soName,
java.lang.String path,
int flags)
public void setActionScriptHandler(java.lang.Object t)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||