public class RTMPSource extends NetworkSource
Modifier and Type | Class and Description |
---|---|
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.
|
Source.SubstreamInfo
Modifier and Type | Field and Description |
---|---|
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 |
BUFFER_OVERFLOW, CONNECTION_TIMEOUT, FASTSTART, H264_FASTSTART, H264_FORCE_INLINE_SPS, H264_OMMIT_SPS, H264_PASS_INLINE_SPS, HTTP_ERROR, IDLE_TIMEOUT, KF_NOTIFY, LIVE_SRC, MAX_BUFFER_TIME, MAX_DURATION, MAX_FRAME_TIME, MP4V_MP2_VIDEOINFO, MP4V_OMMIT_VOL, MP4V_SKIP_UD, myBufferTime, NO_USER_PROMPT, READ_USER_DATA, RECEIVE_TIMEOUT, RTCP_RECEIVE_ERROR, SEEK_FAILURE, SOCKET_ERROR, STARVING, UDP_UNCONNECTED
ASYNC, AUTO_GC, DIRECT, ES, FILTER_SETUP_ERROR, FLV, HTTP, HTTP_AUDIO, JAS, MJPG, MKV, MP4, PES_PRIVATE, PSNET, PULL, PUSH, RAW, RTMP, RTP, RTSP, SHOUTCAST, SS_CLOSED, SS_CONNECT, SS_CONNECTED, SS_DONE, SS_EOS, SS_FORMAT_READ, SS_REDIRECT, SS_RUNNING, SS_SEEKING, SS_SETUP, SS_STREAMS_READ, SS_TCP_ROLLOVER, TIMEOUT, TSFILE, TSNET, UNKNOWN
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
configurePasswordDialog, getDefaultInterfaceAddress, getPasswordDialogOptions, getServerInfo, getTimeConstraint, setConnectionTimeout, setHTTPConnector, setNetworkInterface, setSocketFactory, setTimeConstraint, setUserAgent
addSourceFilter, asyncRead, canSeek, configureFromSPS, 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
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
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
public static void setMinBufferTime(int time)
public int getMinBufferTime()
Source
getMinBufferTime
in class Source
public 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 Source
public int getSourceTime()
getSourceTime
in class Source
public void setSourceTime(int time)
Source
setSourceTime
in class Source
public void setSourceRate(float rate)
Source
setSourceRate
in class Source
public DSGraph createGraph(int graphFlags) throws DSJException
createGraph
in class Source
DSJException
public DSGraph createGraph(int graphFlags, DSFilterInfo videoDecoder, DSFilterInfo audioDecoder) throws DSJException
createGraph
in class Source
DSJException
public CompressedJavaSource createSourceFilter(int sf, DSMediaType mediaType)
Source
createSourceFilter
in class Source
public 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)