IPushPublishPushPublishRTMPProfileHandlerpublic class PushPublishRTMP extends PushPublishBase
PushPublish
This method should work with Level 3 as well as long as the publishing application on not authenticated.
try
{
PushPublishRTMP publisher = new PushPublishRTMP();
// Source stream
publisher.setAppInstance(appInstance);
publisher.setSrcStreamName("myStream");
// Destination stream
publisher.setHostname("localhost");
publisher.setPort(1935);
publisher.setDstApplicationName("live");
publisher.setDstStreamName("myStream");
// Uncomment if pushing to Adobe Media Server
//publisher.setSendOriginalTimecodes(true);
//publisher.setOriginalTimecodeThreshold(0x100000);
// SecureToken shared secret
//publisher.setSecureTokenSharedSecret("#ed%h0#w@1");
publisher.setSendFCPublish(true);
publisher.setSendReleaseStream(true);
publisher.setDebugLog(true);
publisher.connect();
}
catch(Exception e)
{
WMSLoggerFactory.getLogger(null).info(CLASSNAME+"RTMP: ", e);
}
This method should work with Level 3 as well if the publishing application is protected using RTMP authentication.
try
{
PushPublishRTMP publisher = new PushPublishRTMP();
// Source stream
publisher.setAppInstance(appInstance);
publisher.setSrcStreamName("myStream");
// Destination stream
publisher.setHostname("localhost");
publisher.setPort(1935);
publisher.setDstApplicationName("live");
publisher.setDstStreamName("myStream");
publisher.setConnectionFlashVersion(PushPublishRTMP.CURRENTFMLEVERSION);
// Uncomment if pushing to Adobe Media Server
//publisher.setSendOriginalTimecodes(true);
//publisher.setOriginalTimecodeThreshold(0x100000);
// SecureToken shared secret
//publisher.setSecureTokenSharedSecret("#ed%h0#w@1");
publisher.setSendFCPublish(true);
publisher.setSendReleaseStream(true);
publisher.setDebugLog(true);
PushPublishRTMPAuthProviderAdobe adobeRTMPAuthProvider = new PushPublishRTMPAuthProviderAdobe();
adobeRTMPAuthProvider.init(publisher);
adobeRTMPAuthProvider.setUserName("username");
adobeRTMPAuthProvider.setPassword("password");
publisher.setRTMPAuthProvider(adobeRTMPAuthProvider);
publisher.connect();
}
catch(Exception e)
{
WMSLoggerFactory.getLogger(null).info(CLASSNAME+"RTMP: ", e);
}
try
{
PushPublishRTMP publisher = new PushPublishRTMP();
// Source stream
publisher.setAppInstance(appInstance);
publisher.setSrcStreamName("myStream");
// Destination stream
String streamId = "12345";
String akamaiUsername = "56789";
String akamaiPassword = "changeme";
boolean isPrimary = true;
String hostname = (isPrimary?"p":"b")+".ep"+streamId+".i.akamaientrypoint.net";
String dstApplicationName = "EntryPoint";
String dstStreamName = "myStream"+"@"+streamId;
publisher.setHostname(hostname);
publisher.setPort(1935);
publisher.setDstApplicationName(dstApplicationName);
publisher.setDstStreamName(dstStreamName);
publisher.setDebugLog(true);
publisher.setConnectionFlashVersion(PushPublishRTMP.getPushPublishVersionStr());
if (PushPublishRTMP.isFlashVersionFMLE(publisher.getConnectionFlashVersion()))
{
PushPublishRTMPAuthProviderAdobe adobeRTMPAuthProvider = new PushPublishRTMPAuthProviderAdobe();
adobeRTMPAuthProvider.init(publisher);
adobeRTMPAuthProvider.setUserName(akamaiUsername);
adobeRTMPAuthProvider.setPassword(akamaiPassword);
publisher.setRTMPAuthProvider(adobeRTMPAuthProvider);
}
else
{
publisher.setAkamaiUserName(akamaiUsername);
publisher.setAkamaiPassword(akamaiPassword);
}
publisher.setSendFCPublish(true);
publisher.setSendReleaseStream(true);
publisher.setSendStreamCloseCommands(true);
publisher.setSendOriginalTimecodes(true);
publisher.setOriginalTimecodeThreshold(0x100000);
publisher.connect();
}
catch(Exception e)
{
WMSLoggerFactory.getLogger(null).info(CLASSNAME+"RTMP: ", e);
}
try
{
PushPublishRTMP publisher = new PushPublishRTMP();
// Source stream
publisher.setAppInstance(appInstance);
publisher.setSrcStreamName("myStream");
// Destination stream
publisher.setHostname("fmspush.lax.llnw.net");
publisher.setPort(1935);
publisher.setDstApplicationName("live");
publisher.setDstStreamName("myStream");
publisher.setSendFCPublish(true);
publisher.setSendReleaseStream(true);
publisher.setDebugLog(true);
publisher.setSendOriginalTimecodes(true);
publisher.setOriginalTimecodeThreshold(0x100000);
PushPublishRTMPAuthProviderLimelight limelightRTMPAuthProvider = new PushPublishRTMPAuthProviderLimelight();
limelightRTMPAuthProvider.init(publisher);
limelightRTMPAuthProvider.setUserName("username");
limelightRTMPAuthProvider.setPassword("password");
publisher.setRTMPAuthProvider(limelightRTMPAuthProvider);
publisher.connect();
}
catch(Exception e)
{
WMSLoggerFactory.getLogger(null).info(CLASSNAME+"RTMP: ", e);
}
try
{
PushPublishRTMP publisher = new PushPublishRTMP();
// Source stream
publisher.setAppInstance(client.getAppInstance());
publisher.setSrcStreamName("myStream");
// Destination stream
publisher.setHostname("rtpdev1.iad1.bitgravity.com");
publisher.setPort(1935);
publisher.setDstApplicationName("rtmp");
publisher.setDstAppInstanceName("push");
publisher.setDstStreamName("test@test.com/71d73d4cfd1e2f2fed77238021a2cbbe/test/live/feed01");
publisher.setSendFCPublish(true);
publisher.setSendReleaseStream(true);
publisher.setDebugLog(true);
publisher.connect();
}
catch(Exception e)
{
WMSLoggerFactory.getLogger(null).info(CLASSNAME+"RTMP: ", e);
}
| Modifier and Type | Class | Description |
|---|---|---|
static class |
PushPublishRTMP.STATE |
CONNECTED_STATE_CONNECTED, CONNECTED_STATE_CONNECTING, CONNECTED_STATE_NOT_CONNECTED, CONNECTED_STATE_WAITING, PUSHPUBLISH_TYPE_CUPERTINO, PUSHPUBLISH_TYPE_MPEGDASH, PUSHPUBLISH_TYPE_NOTIFY_PACKET, PUSHPUBLISH_TYPE_RTMP, PUSHPUBLISH_TYPE_RTP, PUSHPUBLISH_TYPE_RTP_BUFFERED, PUSHPUBLISH_TYPE_SANJOSE, PUSHPUBLISH_TYPE_SRT, PUSHPUBLISH_TYPE_UNKNOWNappInstance, className, DESTINATION_BAK, DESTINATION_PRI, DESTINATION_RED, destinationName, destinationServer, dstStreamName, entryName, hostname, inetAddr, isAdaptiveStreaming, isExternalRedundancy, logger, mImplementation, myMap, password, playbackHostname, port, profile, properties, pushPublishSession, pushPublishStreamDebug, pushPublishType, reconnectWaitTime, sendingPerformance, srcStream, srcStreamName, totalIOPerformance2Last, totalIOPerformanceLast, userName| Constructor | Description |
|---|---|
PushPublishRTMP() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addConnectMetaData(String key,
AMFData value) |
Added metadata values to the connect metadata object
|
void |
addListener(IPushPublishRTMPNotify listener) |
Add IPushPublishRTMPNotify listener
|
void |
addOnMetadataItemToRemove(String name) |
|
void |
addSession(PushPublishRTMPNetConnectionSession sessionHolder) |
Add session
|
protected void |
bumpReconnectWaitTime() |
Bump the reconnect wait time
|
protected void |
callConnect(PushPublishRTMPNetConnectionSession pushPublisherSession,
String addQueryStr) |
Internal connect
|
void |
connect() |
Connect to server
|
AMFDataList |
convertDataEvenToAMFData(AMFPacket packet) |
|
AMFPacket |
convertOnMetadataToSetDataFrame(AMFPacket packet) |
|
protected PushPublishRTMPNetConnectionPublisher |
createNetConnectionPublisher(PushPublishRTMPNetConnectionSession pushPublisherSession) |
|
IPushPublishSession |
createPushPublishSession() |
|
void |
disconnect() |
Disconnect from server
|
void |
disconnect(boolean hard) |
|
AMFPacket |
filterOnMetadataEvent(AMFPacket packet,
long flags,
java.util.List<String> itemsToRemove,
java.util.Map<String,AMFData> itemsToAdd) |
|
String |
getAkamaiOriginIp() |
Get Akamai Origin IP
|
int |
getAkamaiOriginPort() |
Get Akamai Origin Port
|
String |
getAkamaiPassword() |
Get Akamai password
|
String |
getAkamaiSessionKey(String sessionId) |
Get Akamai session key
|
String |
getAkamaiUserName() |
Get Akamai user name
|
IApplicationInstance |
getAppInstance() |
Get appInstance interface
|
String |
getBindAddress() |
|
long |
getConnectAttemptCount() |
|
int |
getConnectedState() |
|
String |
getConnectionFlashVerion() |
Get Flash version used in connection metadata
|
String |
getConnectionFlashVersion() |
Get Flash version used in connection metadata
|
String |
getConnectionPageURL() |
Get Page URL used in connection metadata
|
String |
getConnectionQueryStr() |
Get the connection query string
|
String |
getConnectionSwfURL() |
Get SWF URL used in connection metadata
|
int |
getConnectionTimeout() |
Get the connection timeout (milliseconds)
|
long |
getConnectLastAttempt() |
Get timestamp of last connection attempt
|
long |
getConnectLastSuccess() |
Get timestamp of last successful connection
|
String |
getContextStr() |
Get the connection details
|
String |
getDstAppInstanceName() |
Get destination appInstance name
|
String |
getDstApplicationName() |
Get destination application name
|
String |
getDstStreamName() |
Get destination stream name
|
String |
getHowToPublish() |
Get the howToPublish string (valid values are "live", "record" and "append")
|
long |
getLastAudioTC() |
Get the absolute timecode of the last sent audio packet (milliseconds)
|
long |
getLastDataTC() |
Get the absolute timecode of the last sent data packet (milliseconds)
|
PushPublishRTMPNetConnectionSession |
getLastSession() |
Get the last session interface
|
long |
getLastVideoKeyFrameTC() |
Get the absolute timecode of the last sent video keyframe packet (milliseconds)
|
long |
getLastVideoTC() |
Get the absolute timecode of the last sent video packet (milliseconds)
|
protected java.util.List<IPushPublishRTMPNotify> |
getLocalListeners() |
Get a list of IPushPublishRTMPNotify listeners
|
Object |
getLock() |
Get the synchronization lock
|
long |
getMessagesAttemptedCount() |
|
long |
getMessagesFailedCount() |
|
long |
getMessagesRetriedCount() |
|
INetConnection |
getNetConnection() |
Get the underlying INetConnection interface for this session
|
long |
getOnMetadataFilter() |
|
long |
getOriginalTimecodeOffset() |
|
long |
getOriginalTimecodeThreshold() |
Get the original timecode threshold.
|
long |
getPacketsSentAudio() |
|
long |
getPacketsSentData() |
|
long |
getPacketsSentVideo() |
|
long |
getPacketsSentVideoKeyFrame() |
|
int |
getPort() |
Get destination server port
|
String |
getQueryString() |
Get the queryString
|
protected int |
getReconnectDelay(long currTime) |
Get the reconnect delay
|
java.net.SocketAddress |
getRemoteIpAddress() |
|
IPushPublishRTMPAuthProvider |
getRTMPAuthProvider() |
Get RTMP authentication provider
|
String |
getSecureTokenSharedSecret() |
Get SecureToken shared secret
|
PushPublishRTMPNetConnectionSession |
getSessionHolderByNetConnection(INetConnection netConnection) |
Get the session holder by INetConnection interface
|
PushPublishRTMPNetConnectionSession |
getSessionHolderBySession(org.apache.mina.common.IoSession session) |
Get session holder by IoSession
|
String |
getSessionListDebug() |
Get the list of active IoSession ids for this publishing session
|
long |
getSrcStreamBufferSize() |
The amount of audio/video in milliseconds that must be available in the source streams buffer before push publishing will being.
|
String |
getSrcStreamName() |
Get source stream name
|
int |
getStreamCloseWaitTime() |
Get stream close timeout (milliseconds)
|
int |
getSyncPacketType() |
|
long |
getSyncTimecode() |
|
int |
getTimecodesOutOfOrderThreshold() |
|
long |
getTotalPacketsSent() |
Get total number of packets sent during push publishing session
|
long |
getValidationFrequency() |
Get connection validation frequency (millisecond).
|
long |
getWaitOnMetadataTimeout() |
Timeout (milliseconds) that the wait on onMetadata system will wait looking for video and audio data to be populated.
|
protected org.apache.mina.common.IoSession |
internalConnect(PushPublishRTMPNetConnectionSession pushPublisherSession) |
Internal connect method
|
boolean |
isCurrentSession(org.apache.mina.common.IoSession session) |
Test to see if passed in session is current session
|
boolean |
isDebugLog() |
Is debug logging turned on
|
boolean |
isDebugPackets() |
Set to true to log every packet being sent
|
static boolean |
isFlashVerionFMLE(String flashVersion) |
Returns true if the Flash player version string is a Flash Media Live Encoder version (start with FMLE/ or FME/)
|
static boolean |
isFlashVersionFMLE(String flashVersion) |
Returns true if the Flash player version string is a Flash Media Live Encoder version (start with FMLE/ or FME/)
|
protected boolean |
isOnMetadataReady(IMediaStream stream,
AMFPacket packet) |
|
boolean |
isOnMetadataToSetDataFrame() |
If true all onMetadata events are converted to @setDataFrame calls
|
boolean |
isRemoveDefaultAppInstance() |
If true and destination application instance is _definst_ then the application instance name will not be sent to the remove server as part of the connection information.
|
boolean |
isResetOnTimecodeOutOfOrder() |
Set to true if you wish push to reset if timecodes jump out of order.
|
boolean |
isSendFCAnnounce() |
If true call FCAnnounce(streamName) after connecting to server
|
boolean |
isSendFCPublish() |
If true call FCPublish(streamName) after connecting to server
|
boolean |
isSendOnMetadata() |
True if sending onMetadata event at start of stream
|
boolean |
isSendOriginalTimecodes() |
true if sending the original timecodes of source stream.
|
boolean |
isSendReleaseStream() |
If true call releaseStream(streamName) after connecting to server
|
boolean |
isSendStreamCloseCommands() |
If true will send FCUnpublish, closeStream, deleteStream on disconnect
|
boolean |
isSSL() |
|
boolean |
isWaitOnMetadataAudio() |
If true and waitOnMetadataAvailable, publishing will not start until onMetadata packet is populated with audio data.
|
boolean |
isWaitOnMetadataAudioDatarate() |
|
boolean |
isWaitOnMetadataAvailable() |
Set to true to turn on system that will monitor onMetadata packet and wait for it to be populated before it starts sending the stream.
|
boolean |
isWaitOnMetadataVideo() |
If true and waitOnMetadataAvailable, publishing will not start until onMetadata packet is populated with video data.
|
boolean |
isWaitOnMetadataVideoDatarate() |
|
protected void |
notifyAkamaiClientLogin(PushPublishRTMPNetConnectionSession pushPublisherSession,
com.wowza.wms.request.RequestFunction function,
AMFDataList params) |
Notify Akamai ClientLogin
|
protected void |
notifyAkamaiSetChallenge(PushPublishRTMPNetConnectionSession pushPublisherSession,
com.wowza.wms.request.RequestFunction function,
AMFDataList params) |
Notify Akamai SetChallenge
|
protected void |
notifyAkamaiSetOriginConnectionInfo(PushPublishRTMPNetConnectionSession pushPublisherSession,
com.wowza.wms.request.RequestFunction function,
AMFDataList params) |
Notify Akamai SetOriginConnectionInfo
|
protected void |
notifyConnect(PushPublishRTMPNetConnectionSession pushPublisherSession,
com.wowza.wms.request.RequestFunction function,
AMFDataList params) |
Notify connect
|
protected void |
notifyConnectFailure(PushPublishRTMPNetConnectionSession pushPublisherSession) |
Notify connect failure
|
protected void |
notifyConnectStart(PushPublishRTMPNetConnectionSession pushPublisherSession) |
Notify connect start
|
protected void |
notifyConnectSuccess(PushPublishRTMPNetConnectionSession pushPublisherSession) |
Notify connect success
|
protected void |
notifyFCAnnounce(PushPublishRTMPNetConnectionSession pushPublisherSession,
com.wowza.wms.request.RequestFunction function,
AMFDataList params) |
Notify FCAnnounce
|
protected void |
notifyFCPublish(PushPublishRTMPNetConnectionSession pushPublisherSession,
com.wowza.wms.request.RequestFunction function,
AMFDataList params) |
Notify FCPublish
|
protected void |
notifyHandshakeResult(PushPublishRTMPNetConnectionSession pushPublisherSession,
com.wowza.wms.request.RequestFunction function,
AMFDataList params) |
Notify handshake result
|
protected void |
notifyPublishHandlerPlay(PushPublishRTMPNetConnectionSession pushPublisherSession,
java.io.OutputStream out,
long[] playSizes) |
Notify publish handler play
|
protected void |
notifyPushPublisherSessionCreate(PushPublishRTMPNetConnectionSession pushPublisherSession) |
Notify session create
|
protected void |
notifyPushPublisherSessionDestroy(PushPublishRTMPNetConnectionSession pushPublisherSession) |
Notify session destroy
|
protected void |
notifySessionClosed(PushPublishRTMPNetConnectionSession pushPublisherSession) |
Notify session closed
|
protected void |
notifySessionIdle(PushPublishRTMPNetConnectionSession pushPublisherSession) |
Notify session idle event
|
protected void |
notifySessionOpened(PushPublishRTMPNetConnectionSession pushPublisherSession) |
Notify session opened
|
protected void |
notifyStreamCreate(PushPublishRTMPNetConnectionSession pushPublisherSession,
com.wowza.wms.request.RequestFunction function,
AMFDataList params) |
Notify stream create
|
protected void |
notifyStreamOnPlayStatus(PushPublishRTMPNetConnectionSession pushPublisherSession,
com.wowza.wms.request.RequestFunction function,
AMFDataList params) |
Notify OnPlayStatus
|
protected void |
notifyStreamOnStatus(PushPublishRTMPNetConnectionSession pushPublisherSession,
com.wowza.wms.request.RequestFunction function,
AMFDataList params) |
Notify StreamOnStatus
|
protected void |
notifyValidateSession(PushPublishRTMPNetConnectionSession pushPublisherSession) |
|
protected void |
notifyValidateSessionResult(PushPublishRTMPNetConnectionSession pushPublisherSession,
boolean result) |
|
void |
putOnMetadataItemToAdd(String name,
AMFData value) |
|
boolean |
removeListener(IPushPublishRTMPNotify listener) |
rempve IPushPublishRTMPNotify listener
|
void |
removeSession(PushPublishRTMPNetConnectionSession sessionHolder) |
Remove session
|
void |
resetConnection() |
Reset server connection
|
void |
resetConnection(boolean noDelay) |
Reset server connection
|
protected String |
resolveHostName() |
Resolve host name to connect to
|
void |
sessionClosed(org.apache.mina.common.IoSession session) |
Internal callback
|
void |
sessionOpened(org.apache.mina.common.IoSession session) |
Internal callback
|
void |
setAkamaiOriginIp(String akamaiOriginIp) |
Set Akamai Origin IP
|
void |
setAkamaiOriginPort(int akamaiOriginPort) |
Set Akamai Origin Port
|
void |
setAkamaiPassword(String akamaiPassword) |
Set Akamai password
|
void |
setAkamaiUserName(String akamaiUserName) |
Set Akamai user name
|
void |
setAppInstance(IApplicationInstance appInstance) |
Set appInstance interface
|
void |
setBindAddress(String bindAddress) |
|
void |
setConnectionFlashVerion(String connectionFlashVersion) |
Set Flash version used in connection metadata
|
void |
setConnectionFlashVersion(String connectionFlashVersion) |
Set Flash version used in connection metadata
|
void |
setConnectionPageURL(String connectionPageURL) |
Set Page URL used in connection metadata
|
void |
setConnectionQueryStr(String connectionQueryStr) |
Set the connection query string
|
void |
setConnectionSwfURL(String connectionSwfURL) |
Set SWF URL used in connection metadata
|
void |
setConnectionTimeout(int connectionTimeout) |
Set the connection timeout (milliseconds)
|
void |
setConnectLastAttempt(long connectLastAttempt) |
Set timestamp of last connection attempt
|
void |
setConnectLastSuccess(long connectLastSuccess) |
Set timestamp of last successful connection
|
void |
setDebugLog(boolean debugLog) |
Set debug logging
|
void |
setDebugPackets(boolean debugPackets) |
Set to true to log every packet being sent
|
void |
setDstAppInstanceName(String dstAppInstanceName) |
Set destination appInstance name
|
void |
setDstApplicationName(String dstApplicationName) |
Set destination application name
|
void |
setDstStreamName(String dstStreamName) |
Set destination stream name
|
void |
setHowToPublish(String howToPublish) |
Set the howToPublish string (valid values are "live", "record" and "append")
|
void |
setOnMetadataFilter(long onMetadataFilter) |
|
void |
setOnMetadataToSetDataFrame(boolean onMetadataToSetDataFrame) |
If true all onMetadata events are converted to @setDataFrame calls
|
void |
setOriginalTimecodeOffset(long originalTimecodeOffset) |
|
void |
setOriginalTimecodeThreshold(long originalTimecodeThreshold) |
Set the original timecode threshold.
|
void |
setOriginalTimecodeThreshold(String i) |
|
void |
setPort(int port) |
Set destination server port
|
void |
setQueryString(String queryString) |
Set the queryString, as set in the map file
|
void |
setRemoveDefaultAppInstance(boolean removeDefaultAppInstance) |
If true and destination application instance is _definst_ then the application instance name will not be sent to the remove server as part of the connection information.
|
void |
setResetOnTimecodeOutOfOrder(boolean resetOnTimecodeOutOfOrder) |
Set to true if you wish push to reset if timecodes jump out of order.
|
void |
setRTMPAuthProvider(IPushPublishRTMPAuthProvider rtmpAuthProvider) |
Set RTMP authentication provider
|
void |
setSecureTokenSharedSecret(String secureTokenSharedSecret) |
Set SecureToken shared secret
|
void |
setSendFCAnnounce(boolean sendFCAnnounce) |
If true call FCAnnounce(streamName) after connecting to server
|
void |
setSendFCPublish(boolean sendFCPublish) |
If true call FCPublish(streamName) after connecting to server
|
void |
setSendOnMetadata(boolean sendOnMetadata) |
True if sending onMetadata event at start of stream
|
void |
setSendOriginalTimecodes(boolean sendOriginalTimecodes) |
true if sending the original timecodes of source stream.
|
void |
setSendReleaseStream(boolean sendReleaseStream) |
If true call releaseStream(streamName) after connecting to server
|
void |
setSendStreamCloseCommands(boolean sendStreamCloseCommands) |
If true will send FCUnpublish, closeStream, deleteStream on disconnect
|
void |
setSrcStreamBufferSize(long srcStreamBufferSize) |
The amount of audio/video in milliseconds that must be available in the source streams buffer before push publishing will being.
|
void |
setSrcStreamName(String srcStreamName) |
Set source stream name
|
void |
setSSL(boolean isSSL) |
|
void |
setStreamCloseWaitTime(int streamCloseWaitTime) |
Set stream close timeout (milliseconds)
|
void |
setStreamDebugLog(boolean debugLog) |
|
void |
setSyncPacketType(int syncPacketType) |
|
void |
setSyncTimecode(long syncTimecode) |
|
void |
setTimecodesOutOfOrderThreshold(int timecodesOutOfOrderThreshold) |
|
void |
setValidationFrequency(long validationFrequency) |
Set connection validation frequency (millisecond).
|
void |
setWaitOnMetadataAudio(boolean waitOnMetadataAudio) |
If true and waitOnMetadataAvailable, publishing will not start until onMetadata packet is populated with audio data.
|
void |
setWaitOnMetadataAudioDatarate(boolean waitOnMetadataAudioDatarate) |
|
void |
setWaitOnMetadataAvailable(boolean waitOnMetadataAvailable) |
Set to true to turn on system that will monitor onMetadata packet and wait for it to be populated before it starts sending the stream.
|
void |
setWaitOnMetadataTimeout(long waitOnMetadataTimeout) |
Timeout (milliseconds) that the wait on onMetadata system will wait looking for video and audio data to be populated.
|
void |
setWaitOnMetadataVideo(boolean waitOnMetadataVideo) |
If true and waitOnMetadataAvailable, publishing will not start until onMetadata packet is populated with video data.
|
void |
setWaitOnMetadataVideoDatarate(boolean waitOnMetadataVideoDatarate) |
|
protected void |
tryToConnect(PushPublishRTMP.STATE connectionState) |
Try to connect to server
|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadd, addIOPerformance2, clearLoggingValues, getBandwidth, getBaseParams, getDestinationID, getDestinationName, getDestinationServer, getEntryName, getHostname, getImplementation, getInetAddr, getMap, getMessagesOutBytes, getMessagesOutCount, getPassword, getPlaybackHostname, getProfile, getProperties, getPushPublishType, getReconnectWaitTime, getSrcStream, getUserName, getWowzaStreamingEngineVersionStr, incrementMessagesOut, init, isAdaptiveStreaming, isExternalRedundancy, load, logDebug, logError, logError, logError, logInfo, logWarn, setAdaptiveStreaming, setAdaptiveStreaming, setDestinationName, setDestinationServer, setDestinationServer, setEntryName, setExternalRedundancy, setExternalRedundancy, setHost, setHostname, setImplementation, setInetAddr, setPassword, setPlaybackHostname, setPort, setProfile, setReconnectWaitTime, setSrcStream, setStreamName, setUserName, updateLoggingValues, updateUsageTrackerprotected String akamaiOriginIp
protected Integer akamaiOriginPort
protected String akamaiPassword
protected String akamaiUserName
protected String bindAddress
public float[] bytesAvg
public static final Class<PushPublishRTMP> CLASS
public static final String CLASSNAME
protected long connectAttemptCount
protected String connectionFlashVersion
protected String connectionPageURL
protected String connectionQueryStr
protected long connectionResetCount
protected PushPublishRTMP.STATE connectionState
protected String connectionSwfURL
protected int connectionTimeout
protected long connectLastAttempt
protected long connectLastSuccess
protected java.util.Map<String,AMFData> connectMetaData
public static final String CURRENTFLASHVERSION
public static final String CURRENTFMLEVERSION
protected long debugLogLastPacketCount
protected boolean debugPackets
protected boolean doSendOnMetaData
protected String dstAppInstanceName
protected String dstApplicationName
protected String howToPublish
protected java.util.Map<org.apache.mina.common.IoSession,PushPublishRTMPNetConnectionSession> ioSessionToSessionHolder
protected boolean isReconnectorRunning
protected boolean isSSL
protected long lastAudioTC
protected long lastDataTC
protected long lastIdleReadTime
protected long lastIdleWriteTime
protected long lastVideoKeyFrameTC
protected long lastVideoTC
protected java.util.List<IPushPublishRTMPNotify> listeners
protected Object lock
protected java.util.Map<INetConnection,PushPublishRTMPNetConnectionSession> netconnectToSessionHolder
public long offlineTime
public long onlineTime
protected long onMetadataFilter
protected java.util.Map<String,AMFData> onMetadataItemsToAdd
protected java.util.List<String> onMetadataItemsToRemove
protected boolean onMetadataToSetDataFrame
protected long originalTimecodeOffset
protected long originalTimecodeThreshold
public int outprint
protected long packetsSentAudio
protected long packetsSentData
protected long packetsSentVideo
protected long packetsSentVideoKeyFrame
protected boolean pingPongListenerRegistered
protected String queryString
protected boolean removeDefaultAppInstance
protected boolean resetOnTimecodeOutOfOrder
protected IPushPublishRTMPAuthProvider rtmpAuthProvider
protected boolean rtmpDebugLog
protected String secureTokenSharedSecret
protected boolean sendFCAnnounce
protected boolean sendFCPublish
protected boolean sendOnMetadata
protected boolean sendOriginalTimecodes
protected boolean sendReleaseStream
protected boolean sendStreamCloseCommands
protected long sendStreamCloseCommandsSendTime
protected java.util.List<PushPublishRTMPNetConnectionSession> sessionOrder
protected long srcStreamBufferSize
protected int streamCloseWaitTime
protected int syncPacketType
protected long syncTimecode
protected int timecodesOutOfOrderThreshold
protected long totalPacketsSent
protected boolean tryConnect
protected boolean usePingPong
protected long validationFrequency
protected boolean waitOnMetadataAudio
protected boolean waitOnMetadataAudioDatarate
protected boolean waitOnMetadataAvailable
protected boolean waitOnMetadataReady
protected long waitOnMetadataStartime
protected long waitOnMetadataTimeout
protected boolean waitOnMetadataVideo
protected boolean waitOnMetadataVideoDatarate
public PushPublishRTMP()
throws com.wowza.wms.server.LicensingException
com.wowza.wms.server.LicensingExceptionpublic void addConnectMetaData(String key,
AMFData value)
key - keyvalue - AMFDataObj valuepublic void addListener(IPushPublishRTMPNotify listener)
listener - IPushPublishRTMPNotify listenerpublic void addOnMetadataItemToRemove(String name)
public void addSession(PushPublishRTMPNetConnectionSession sessionHolder)
sessionHolder - session holderprotected void bumpReconnectWaitTime()
protected void callConnect(PushPublishRTMPNetConnectionSession pushPublisherSession, String addQueryStr)
pushPublisherSession - session holderaddQueryStr - additional query paramspublic void connect()
public AMFDataList convertDataEvenToAMFData(AMFPacket packet)
protected PushPublishRTMPNetConnectionPublisher createNetConnectionPublisher(PushPublishRTMPNetConnectionSession pushPublisherSession)
public IPushPublishSession createPushPublishSession()
createPushPublishSession in interface IPushPublishcreatePushPublishSession in class PushPublishBasepublic void disconnect()
public void disconnect(boolean hard)
public AMFPacket filterOnMetadataEvent(AMFPacket packet, long flags, java.util.List<String> itemsToRemove, java.util.Map<String,AMFData> itemsToAdd)
public String getAkamaiOriginIp()
public int getAkamaiOriginPort()
public String getAkamaiPassword()
public String getAkamaiSessionKey(String sessionId)
sessionId - session Idpublic String getAkamaiUserName()
public IApplicationInstance getAppInstance()
getAppInstance in class PushPublishBasepublic String getBindAddress()
public long getConnectAttemptCount()
public int getConnectedState()
public String getConnectionFlashVerion()
public String getConnectionFlashVersion()
public String getConnectionPageURL()
public String getConnectionQueryStr()
public String getConnectionSwfURL()
public int getConnectionTimeout()
public long getConnectLastAttempt()
public long getConnectLastSuccess()
public String getContextStr()
getContextStr in interface IPushPublishgetContextStr in class PushPublishBasepublic String getDstAppInstanceName()
public String getDstApplicationName()
public String getDstStreamName()
getDstStreamName in interface IPushPublishgetDstStreamName in class PushPublishBasepublic String getHowToPublish()
public long getLastAudioTC()
public long getLastDataTC()
public PushPublishRTMPNetConnectionSession getLastSession()
public long getLastVideoKeyFrameTC()
public long getLastVideoTC()
protected java.util.List<IPushPublishRTMPNotify> getLocalListeners()
public Object getLock()
public long getMessagesAttemptedCount()
public long getMessagesFailedCount()
public long getMessagesRetriedCount()
public INetConnection getNetConnection()
public long getOnMetadataFilter()
public long getOriginalTimecodeOffset()
public long getOriginalTimecodeThreshold()
public long getPacketsSentAudio()
public long getPacketsSentData()
public long getPacketsSentVideo()
public long getPacketsSentVideoKeyFrame()
public int getPort()
getPort in interface IPushPublishgetPort in class PushPublishBasepublic String getQueryString()
queryString - protected int getReconnectDelay(long currTime)
currTime - current timestamppublic java.net.SocketAddress getRemoteIpAddress()
public IPushPublishRTMPAuthProvider getRTMPAuthProvider()
public String getSecureTokenSharedSecret()
public PushPublishRTMPNetConnectionSession getSessionHolderByNetConnection(INetConnection netConnection)
netConnection - INetConnection interfacepublic PushPublishRTMPNetConnectionSession getSessionHolderBySession(org.apache.mina.common.IoSession session)
session - IoSessionpublic String getSessionListDebug()
public long getSrcStreamBufferSize()
public String getSrcStreamName()
getSrcStreamName in interface IPushPublishgetSrcStreamName in class PushPublishBasepublic int getStreamCloseWaitTime()
public int getSyncPacketType()
public long getSyncTimecode()
public int getTimecodesOutOfOrderThreshold()
public long getTotalPacketsSent()
public long getValidationFrequency()
public long getWaitOnMetadataTimeout()
protected org.apache.mina.common.IoSession internalConnect(PushPublishRTMPNetConnectionSession pushPublisherSession)
pushPublisherSession - session holderpublic boolean isCurrentSession(org.apache.mina.common.IoSession session)
session - IoSession interfacepublic boolean isDebugLog()
isDebugLog in interface IPushPublishisDebugLog in class PushPublishBasepublic boolean isDebugPackets()
public static boolean isFlashVerionFMLE(String flashVersion)
flashVersion - true if Flash Media Live Encoder versionpublic static boolean isFlashVersionFMLE(String flashVersion)
flashVersion - true if Flash Media Live Encoder versionprotected boolean isOnMetadataReady(IMediaStream stream, AMFPacket packet)
public boolean isOnMetadataToSetDataFrame()
public boolean isRemoveDefaultAppInstance()
public boolean isResetOnTimecodeOutOfOrder()
public boolean isSendFCAnnounce()
public boolean isSendFCPublish()
public boolean isSendOnMetadata()
public boolean isSendOriginalTimecodes()
public boolean isSendReleaseStream()
public boolean isSendStreamCloseCommands()
public boolean isSSL()
public boolean isWaitOnMetadataAudio()
public boolean isWaitOnMetadataAudioDatarate()
public boolean isWaitOnMetadataAvailable()
public boolean isWaitOnMetadataVideo()
public boolean isWaitOnMetadataVideoDatarate()
protected void notifyAkamaiClientLogin(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
pushPublisherSession - session holderfunction - functionparams - paramsprotected void notifyAkamaiSetChallenge(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
pushPublisherSession - session holderfunction - functionparams - paramsprotected void notifyAkamaiSetOriginConnectionInfo(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
pushPublisherSession - session holderfunction - functionparams - paramsprotected void notifyConnect(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
pushPublisherSession - session holderfunction - functionparams - paramsprotected void notifyConnectFailure(PushPublishRTMPNetConnectionSession pushPublisherSession)
pushPublisherSession - session holderprotected void notifyConnectStart(PushPublishRTMPNetConnectionSession pushPublisherSession)
pushPublisherSession - session holderprotected void notifyConnectSuccess(PushPublishRTMPNetConnectionSession pushPublisherSession)
pushPublisherSession - session holderprotected void notifyFCAnnounce(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
pushPublisherSession - session holderfunction - functionparams - paramsprotected void notifyFCPublish(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
pushPublisherSession - session holderfunction - functionparams - paramsprotected void notifyHandshakeResult(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
pushPublisherSession - session holderfunction - functionparams - paramsprotected void notifyPublishHandlerPlay(PushPublishRTMPNetConnectionSession pushPublisherSession, java.io.OutputStream out, long[] playSizes)
pushPublisherSession - session holderout - output streamplaySizes - play sizesprotected void notifyPushPublisherSessionCreate(PushPublishRTMPNetConnectionSession pushPublisherSession)
pushPublisherSession - session holderprotected void notifyPushPublisherSessionDestroy(PushPublishRTMPNetConnectionSession pushPublisherSession)
pushPublisherSession - session holderprotected void notifySessionClosed(PushPublishRTMPNetConnectionSession pushPublisherSession)
pushPublisherSession - session holderprotected void notifySessionIdle(PushPublishRTMPNetConnectionSession pushPublisherSession)
pushPublisherSession - session holderprotected void notifySessionOpened(PushPublishRTMPNetConnectionSession pushPublisherSession)
pushPublisherSession - session holderprotected void notifyStreamCreate(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
pushPublisherSession - session holderfunction - functionparams - paramsprotected void notifyStreamOnPlayStatus(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
pushPublisherSession - session holderfunction - functionparams - paramsprotected void notifyStreamOnStatus(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
pushPublisherSession - session holderfunction - functionparams - paramsprotected void notifyValidateSession(PushPublishRTMPNetConnectionSession pushPublisherSession)
protected void notifyValidateSessionResult(PushPublishRTMPNetConnectionSession pushPublisherSession, boolean result)
public void putOnMetadataItemToAdd(String name,
AMFData value)
public boolean removeListener(IPushPublishRTMPNotify listener)
listener - IPushPublishRTMPNotify listenerpublic void removeSession(PushPublishRTMPNetConnectionSession sessionHolder)
sessionHolder - session holderpublic void resetConnection()
public void resetConnection(boolean noDelay)
noDelay - if true reset immediatelyprotected String resolveHostName()
public void sessionClosed(org.apache.mina.common.IoSession session)
session - IoSessionpublic void sessionOpened(org.apache.mina.common.IoSession session)
session - IoSessionpublic void setAkamaiOriginIp(String akamaiOriginIp)
akamaiOriginIp - Akamai Origin IPpublic void setAkamaiOriginPort(int akamaiOriginPort)
akamaiOriginPort - Akamai Origin Portpublic void setAkamaiPassword(String akamaiPassword)
akamaiPassword - Akamai passwordpublic void setAkamaiUserName(String akamaiUserName)
akamaiUserName - Akamai user namepublic void setAppInstance(IApplicationInstance appInstance)
setAppInstance in class PushPublishBaseappInstance - appInstance interfacepublic void setBindAddress(String bindAddress)
public void setConnectionFlashVerion(String connectionFlashVersion)
connectionFlashVersion - Flash version used in connection metadatapublic void setConnectionFlashVersion(String connectionFlashVersion)
connectionFlashVersion - Flash version used in connection metadatapublic void setConnectionPageURL(String connectionPageURL)
connectionPageURL - Page URL used in connection metadatapublic void setConnectionQueryStr(String connectionQueryStr)
connectionQueryStr - connection query stringpublic void setConnectionSwfURL(String connectionSwfURL)
connectionSwfURL - SWF URL used in connection metadatapublic void setConnectionTimeout(int connectionTimeout)
connectionTimeout - connection timeout (milliseconds)public void setConnectLastAttempt(long connectLastAttempt)
connectLastAttempt - timestamp of last connection attemptpublic void setConnectLastSuccess(long connectLastSuccess)
connectLastSuccess - timestamp of last successful connectionpublic void setDebugLog(boolean debugLog)
setDebugLog in interface IPushPublishsetDebugLog in class PushPublishBasedebugLog - debug loggingpublic void setDebugPackets(boolean debugPackets)
debugPackets - true to log every packet being sentpublic void setDstAppInstanceName(String dstAppInstanceName)
dstAppInstanceName - destination appInstance namepublic void setDstApplicationName(String dstApplicationName)
dstApplicationName - destination application namepublic void setDstStreamName(String dstStreamName)
setDstStreamName in interface IPushPublishsetDstStreamName in class PushPublishBasedstStreamName - destination stream namepublic void setHowToPublish(String howToPublish)
howToPublish - howToPublish stringpublic void setOnMetadataFilter(long onMetadataFilter)
public void setOnMetadataToSetDataFrame(boolean onMetadataToSetDataFrame)
onMetadataToSetDataFrame - true all onMetadata events are converted to @setDataFrame callspublic void setOriginalTimecodeOffset(long originalTimecodeOffset)
public void setOriginalTimecodeThreshold(long originalTimecodeThreshold)
originalTimecodeThreshold - original timecode thresholdpublic void setOriginalTimecodeThreshold(String i)
public void setPort(int port)
setPort in interface IPushPublishsetPort in class PushPublishBaseport - destination server portpublic void setQueryString(String queryString)
queryString - public void setRemoveDefaultAppInstance(boolean removeDefaultAppInstance)
removeDefaultAppInstance - true if omitting _definst_public void setResetOnTimecodeOutOfOrder(boolean resetOnTimecodeOutOfOrder)
resetOnTimecodeOutOfOrder - true if you wish push to reset if timecodes jump out of orderpublic void setRTMPAuthProvider(IPushPublishRTMPAuthProvider rtmpAuthProvider)
rtmpAuthProvider - RTMP authentication providerpublic void setSecureTokenSharedSecret(String secureTokenSharedSecret)
secureTokenSharedSecret - SecureToken shared secretpublic void setSendFCAnnounce(boolean sendFCAnnounce)
sendFCAnnounce - true if calling FCAnnounce(streamName) after connecting to serverpublic void setSendFCPublish(boolean sendFCPublish)
sendFCPublish - true if calling FCPublish(streamName) after connecting to serverpublic void setSendOnMetadata(boolean sendOnMetadata)
sendOnMetadata - True if sending onMetadata event at start of streampublic void setSendOriginalTimecodes(boolean sendOriginalTimecodes)
sendOriginalTimecodes - true if sending the original timecodes of source streampublic void setSendReleaseStream(boolean sendReleaseStream)
sendReleaseStream - true if calling releaseStream(streamName) after connecting to serverpublic void setSendStreamCloseCommands(boolean sendStreamCloseCommands)
sendStreamCloseCommands - true will send close commandspublic void setSrcStreamBufferSize(long srcStreamBufferSize)
srcStreamBufferSize - amount of audio/video in milliseconds that must be availablepublic void setSrcStreamName(String srcStreamName)
setSrcStreamName in interface IPushPublishsetSrcStreamName in class PushPublishBasesrcStreamName - source stream namepublic void setSSL(boolean isSSL)
public void setStreamCloseWaitTime(int streamCloseWaitTime)
streamCloseWaitTime - stream close timeout (milliseconds)public void setStreamDebugLog(boolean debugLog)
public void setSyncPacketType(int syncPacketType)
public void setSyncTimecode(long syncTimecode)
public void setTimecodesOutOfOrderThreshold(int timecodesOutOfOrderThreshold)
public void setValidationFrequency(long validationFrequency)
validationFrequency - connection validation frequency (millisecond)public void setWaitOnMetadataAudio(boolean waitOnMetadataAudio)
waitOnMetadataAudio - publishing will not start until onMetadata packet is populated with audio datapublic void setWaitOnMetadataAudioDatarate(boolean waitOnMetadataAudioDatarate)
public void setWaitOnMetadataAvailable(boolean waitOnMetadataAvailable)
waitOnMetadataAvailable - true to turn on system that will monitor onMetadata packetpublic void setWaitOnMetadataTimeout(long waitOnMetadataTimeout)
waitOnMetadataTimeout - timeout (milliseconds) that the wait on onMetadata system will wait looking for video and audio data to be populatedpublic void setWaitOnMetadataVideo(boolean waitOnMetadataVideo)
waitOnMetadataVideo - publishing will not start until onMetadata packet is populated with video datapublic void setWaitOnMetadataVideoDatarate(boolean waitOnMetadataVideoDatarate)
protected void tryToConnect(PushPublishRTMP.STATE connectionState)