Class PushPublishRTMP
- Object
-
- com.wowza.wms.pushpublish.model.PushPublishBase
-
- com.wowza.wms.pushpublish.protocol.rtmp.PushPublishRTMP
-
- All Implemented Interfaces:
IPushPublish
- Direct Known Subclasses:
PushPublishRTMPProfileHandler
public class PushPublishRTMP extends PushPublishBase
PushPublish
Sample Code to push to Wowza Server or Adobe Media Server (no authentication)
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); }
Sample Code to push to Wowza Server or Adobe Media Server (RTMP username/password authentication)
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); }
Sample Code to push to Akamai
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); }
Sample Code to push to Limelight
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); }
Sample Code to push to BitGravity (streaming needs to be setup per instructions in BG Live 3rd Party Encoder Configuration guide.)
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); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PushPublishRTMP.STATE
-
Field Summary
-
Fields inherited from class com.wowza.wms.pushpublish.model.PushPublishBase
appInstance, 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
-
Fields inherited from interface com.wowza.wms.pushpublish.model.IPushPublish
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_UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description PushPublishRTMP()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConnectMetaData(String key, AMFData value)
Added metadata values to the connect metadata objectvoid
addListener(IPushPublishRTMPNotify listener)
Add IPushPublishRTMPNotify listenervoid
addOnMetadataItemToRemove(String name)
void
addSession(PushPublishRTMPNetConnectionSession sessionHolder)
Add sessionprotected void
bumpReconnectWaitTime()
Bump the reconnect wait timeprotected void
callConnect(PushPublishRTMPNetConnectionSession pushPublisherSession, String addQueryStr)
Internal connectvoid
connect()
Connect to serverAMFDataList
convertDataEvenToAMFData(AMFPacket packet)
AMFPacket
convertOnMetadataToSetDataFrame(AMFPacket packet)
protected PushPublishRTMPNetConnectionPublisher
createNetConnectionPublisher(PushPublishRTMPNetConnectionSession pushPublisherSession)
IPushPublishSession
createPushPublishSession()
void
disconnect()
Disconnect from servervoid
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 IPint
getAkamaiOriginPort()
Get Akamai Origin PortString
getAkamaiPassword()
Get Akamai passwordString
getAkamaiSessionKey(String sessionId)
Get Akamai session keyString
getAkamaiUserName()
Get Akamai user nameIApplicationInstance
getAppInstance()
Get appInstance interfaceString
getBindAddress()
long
getConnectAttemptCount()
int
getConnectedState()
String
getConnectionFlashVerion()
Get Flash version used in connection metadataString
getConnectionFlashVersion()
Get Flash version used in connection metadataString
getConnectionPageURL()
Get Page URL used in connection metadataString
getConnectionQueryStr()
Get the connection query stringString
getConnectionSwfURL()
Get SWF URL used in connection metadataint
getConnectionTimeout()
Get the connection timeout (milliseconds)long
getConnectLastAttempt()
Get timestamp of last connection attemptlong
getConnectLastSuccess()
Get timestamp of last successful connectionString
getContextStr()
Get the connection detailsString
getDstAppInstanceName()
Get destination appInstance nameString
getDstApplicationName()
Get destination application nameString
getDstStreamName()
Get destination stream nameString
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 interfacelong
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 listenersObject
getLock()
Get the synchronization locklong
getMessagesAttemptedCount()
long
getMessagesFailedCount()
long
getMessagesRetriedCount()
INetConnection
getNetConnection()
Get the underlying INetConnection interface for this sessionlong
getOnMetadataFilter()
long
getOriginalTimecodeOffset()
long
getOriginalTimecodeThreshold()
Get the original timecode threshold.long
getPacketsSentAudio()
long
getPacketsSentData()
long
getPacketsSentVideo()
long
getPacketsSentVideoKeyFrame()
int
getPort()
Get destination server portString
getQueryString()
Get the queryStringprotected int
getReconnectDelay(long currTime)
Get the reconnect delayjava.net.SocketAddress
getRemoteIpAddress()
IPushPublishRTMPAuthProvider
getRTMPAuthProvider()
Get RTMP authentication providerString
getSecureTokenSharedSecret()
Get SecureToken shared secretPushPublishRTMPNetConnectionSession
getSessionHolderByNetConnection(INetConnection netConnection)
Get the session holder by INetConnection interfacePushPublishRTMPNetConnectionSession
getSessionHolderBySession(org.apache.mina.common.IoSession session)
Get session holder by IoSessionString
getSessionListDebug()
Get the list of active IoSession ids for this publishing sessionlong
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 nameint
getStreamCloseWaitTime()
Get stream close timeout (milliseconds)int
getSyncPacketType()
long
getSyncTimecode()
int
getTimecodesOutOfOrderThreshold()
long
getTotalPacketsSent()
Get total number of packets sent during push publishing sessionlong
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 methodboolean
isCurrentSession(org.apache.mina.common.IoSession session)
Test to see if passed in session is current sessionboolean
isDebugLog()
Is debug logging turned onboolean
isDebugPackets()
Set to true to log every packet being sentstatic 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 callsboolean
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 serverboolean
isSendFCPublish()
If true call FCPublish(streamName) after connecting to serverboolean
isSendOnMetadata()
True if sending onMetadata event at start of streamboolean
isSendOriginalTimecodes()
true if sending the original timecodes of source stream.boolean
isSendReleaseStream()
If true call releaseStream(streamName) after connecting to serverboolean
isSendStreamCloseCommands()
If true will send FCUnpublish, closeStream, deleteStream on disconnectboolean
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 ClientLoginprotected void
notifyAkamaiSetChallenge(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
Notify Akamai SetChallengeprotected void
notifyAkamaiSetOriginConnectionInfo(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
Notify Akamai SetOriginConnectionInfoprotected void
notifyConnect(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
Notify connectprotected void
notifyConnectFailure(PushPublishRTMPNetConnectionSession pushPublisherSession)
Notify connect failureprotected void
notifyConnectStart(PushPublishRTMPNetConnectionSession pushPublisherSession)
Notify connect startprotected void
notifyConnectSuccess(PushPublishRTMPNetConnectionSession pushPublisherSession)
Notify connect successprotected void
notifyFCAnnounce(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
Notify FCAnnounceprotected void
notifyFCPublish(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
Notify FCPublishprotected void
notifyHandshakeResult(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
Notify handshake resultprotected void
notifyPublishHandlerPlay(PushPublishRTMPNetConnectionSession pushPublisherSession, java.io.OutputStream out, long[] playSizes)
Notify publish handler playprotected void
notifyPushPublisherSessionCreate(PushPublishRTMPNetConnectionSession pushPublisherSession)
Notify session createprotected void
notifyPushPublisherSessionDestroy(PushPublishRTMPNetConnectionSession pushPublisherSession)
Notify session destroyprotected void
notifySessionClosed(PushPublishRTMPNetConnectionSession pushPublisherSession)
Notify session closedprotected void
notifySessionIdle(PushPublishRTMPNetConnectionSession pushPublisherSession)
Notify session idle eventprotected void
notifySessionOpened(PushPublishRTMPNetConnectionSession pushPublisherSession)
Notify session openedprotected void
notifyStreamCreate(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
Notify stream createprotected void
notifyStreamOnPlayStatus(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
Notify OnPlayStatusprotected void
notifyStreamOnStatus(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
Notify StreamOnStatusprotected void
notifyValidateSession(PushPublishRTMPNetConnectionSession pushPublisherSession)
protected void
notifyValidateSessionResult(PushPublishRTMPNetConnectionSession pushPublisherSession, boolean result)
void
putOnMetadataItemToAdd(String name, AMFData value)
boolean
removeListener(IPushPublishRTMPNotify listener)
rempve IPushPublishRTMPNotify listenervoid
removeSession(PushPublishRTMPNetConnectionSession sessionHolder)
Remove sessionvoid
resetConnection()
Reset server connectionvoid
resetConnection(boolean noDelay)
Reset server connectionvoid
sessionClosed(org.apache.mina.common.IoSession session)
Internal callbackvoid
sessionOpened(org.apache.mina.common.IoSession session)
Internal callbackvoid
setAkamaiOriginIp(String akamaiOriginIp)
Set Akamai Origin IPvoid
setAkamaiOriginPort(int akamaiOriginPort)
Set Akamai Origin Portvoid
setAkamaiPassword(String akamaiPassword)
Set Akamai passwordvoid
setAkamaiUserName(String akamaiUserName)
Set Akamai user namevoid
setAppInstance(IApplicationInstance appInstance)
Set appInstance interfacevoid
setBindAddress(String bindAddress)
void
setConnectionFlashVerion(String connectionFlashVersion)
Set Flash version used in connection metadatavoid
setConnectionFlashVersion(String connectionFlashVersion)
Set Flash version used in connection metadatavoid
setConnectionPageURL(String connectionPageURL)
Set Page URL used in connection metadatavoid
setConnectionQueryStr(String connectionQueryStr)
Set the connection query stringvoid
setConnectionSwfURL(String connectionSwfURL)
Set SWF URL used in connection metadatavoid
setConnectionTimeout(int connectionTimeout)
Set the connection timeout (milliseconds)void
setConnectLastAttempt(long connectLastAttempt)
Set timestamp of last connection attemptvoid
setConnectLastSuccess(long connectLastSuccess)
Set timestamp of last successful connectionvoid
setDebugLog(boolean debugLog)
Set debug loggingvoid
setDebugPackets(boolean debugPackets)
Set to true to log every packet being sentvoid
setDstAppInstanceName(String dstAppInstanceName)
Set destination appInstance namevoid
setDstApplicationName(String dstApplicationName)
Set destination application namevoid
setDstStreamName(String dstStreamName)
Set destination stream namevoid
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 callsvoid
setOriginalTimecodeOffset(long originalTimecodeOffset)
void
setOriginalTimecodeThreshold(long originalTimecodeThreshold)
Set the original timecode threshold.void
setOriginalTimecodeThreshold(String i)
void
setPort(int port)
Set destination server portvoid
setQueryString(String queryString)
Set the queryString, as set in the map filevoid
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 providervoid
setSecureTokenSharedSecret(String secureTokenSharedSecret)
Set SecureToken shared secretvoid
setSendFCAnnounce(boolean sendFCAnnounce)
If true call FCAnnounce(streamName) after connecting to servervoid
setSendFCPublish(boolean sendFCPublish)
If true call FCPublish(streamName) after connecting to servervoid
setSendOnMetadata(boolean sendOnMetadata)
True if sending onMetadata event at start of streamvoid
setSendOriginalTimecodes(boolean sendOriginalTimecodes)
true if sending the original timecodes of source stream.void
setSendReleaseStream(boolean sendReleaseStream)
If true call releaseStream(streamName) after connecting to servervoid
setSendStreamCloseCommands(boolean sendStreamCloseCommands)
If true will send FCUnpublish, closeStream, deleteStream on disconnectvoid
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 namevoid
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-
Methods inherited from class com.wowza.wms.pushpublish.model.PushPublishBase
add, 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, resolveHostName, setAdaptiveStreaming, setAdaptiveStreaming, setDestinationName, setDestinationServer, setDestinationServer, setEntryName, setExternalRedundancy, setExternalRedundancy, setHost, setHostname, setImplementation, setInetAddr, setPassword, setPlaybackHostname, setPort, setProfile, setReconnectWaitTime, setSrcStream, setStreamName, setUserName, updateLoggingValues, updateUsageTracker
-
-
-
-
Field Detail
-
CLASS
public static final Class<PushPublishRTMP> CLASS
-
CLASSNAME
public static final String CLASSNAME
- See Also:
- Constant Field Values
-
CURRENTFMLEVERSION
public static final String CURRENTFMLEVERSION
- See Also:
- Constant Field Values
-
CURRENTFLASHVERSION
public static final String CURRENTFLASHVERSION
- See Also:
- Constant Field Values
-
rtmpDebugLog
protected boolean rtmpDebugLog
-
debugLogLastPacketCount
protected long debugLogLastPacketCount
-
debugPackets
protected boolean debugPackets
-
netconnectToSessionHolder
protected java.util.Map<INetConnection,PushPublishRTMPNetConnectionSession> netconnectToSessionHolder
-
ioSessionToSessionHolder
protected java.util.Map<org.apache.mina.common.IoSession,PushPublishRTMPNetConnectionSession> ioSessionToSessionHolder
-
sessionOrder
protected java.util.List<PushPublishRTMPNetConnectionSession> sessionOrder
-
listeners
protected java.util.List<IPushPublishRTMPNotify> listeners
-
dstApplicationName
protected String dstApplicationName
-
dstAppInstanceName
protected String dstAppInstanceName
-
lock
protected Object lock
-
howToPublish
protected String howToPublish
-
sendFCPublish
protected boolean sendFCPublish
-
sendFCAnnounce
protected boolean sendFCAnnounce
-
sendReleaseStream
protected boolean sendReleaseStream
-
sendStreamCloseCommands
protected boolean sendStreamCloseCommands
-
sendOnMetadata
protected boolean sendOnMetadata
-
onMetadataToSetDataFrame
protected boolean onMetadataToSetDataFrame
-
onMetadataFilter
protected long onMetadataFilter
-
onMetadataItemsToRemove
protected java.util.List<String> onMetadataItemsToRemove
-
onMetadataItemsToAdd
protected java.util.Map<String,AMFData> onMetadataItemsToAdd
-
timecodesOutOfOrderThreshold
protected int timecodesOutOfOrderThreshold
-
tryConnect
protected boolean tryConnect
-
isReconnectorRunning
protected boolean isReconnectorRunning
-
connectionQueryStr
protected String connectionQueryStr
-
queryString
protected String queryString
-
connectionFlashVersion
protected String connectionFlashVersion
-
connectionSwfURL
protected String connectionSwfURL
-
connectionPageURL
protected String connectionPageURL
-
secureTokenSharedSecret
protected String secureTokenSharedSecret
-
akamaiUserName
protected String akamaiUserName
-
akamaiPassword
protected String akamaiPassword
-
akamaiOriginIp
protected String akamaiOriginIp
-
akamaiOriginPort
protected Integer akamaiOriginPort
-
validationFrequency
protected long validationFrequency
-
sendOriginalTimecodes
protected boolean sendOriginalTimecodes
-
originalTimecodeThreshold
protected long originalTimecodeThreshold
-
originalTimecodeOffset
protected long originalTimecodeOffset
-
connectionTimeout
protected int connectionTimeout
-
connectLastAttempt
protected long connectLastAttempt
-
connectLastSuccess
protected long connectLastSuccess
-
connectionResetCount
protected long connectionResetCount
-
connectAttemptCount
protected long connectAttemptCount
-
connectionState
protected PushPublishRTMP.STATE connectionState
-
doSendOnMetaData
protected boolean doSendOnMetaData
-
removeDefaultAppInstance
protected boolean removeDefaultAppInstance
-
resetOnTimecodeOutOfOrder
protected boolean resetOnTimecodeOutOfOrder
-
sendStreamCloseCommandsSendTime
protected long sendStreamCloseCommandsSendTime
-
streamCloseWaitTime
protected int streamCloseWaitTime
-
lastIdleReadTime
protected long lastIdleReadTime
-
lastIdleWriteTime
protected long lastIdleWriteTime
-
totalPacketsSent
protected long totalPacketsSent
-
lastVideoTC
protected long lastVideoTC
-
lastVideoKeyFrameTC
protected long lastVideoKeyFrameTC
-
lastAudioTC
protected long lastAudioTC
-
lastDataTC
protected long lastDataTC
-
packetsSentAudio
protected long packetsSentAudio
-
packetsSentVideo
protected long packetsSentVideo
-
packetsSentVideoKeyFrame
protected long packetsSentVideoKeyFrame
-
packetsSentData
protected long packetsSentData
-
waitOnMetadataAvailable
protected boolean waitOnMetadataAvailable
-
waitOnMetadataVideo
protected boolean waitOnMetadataVideo
-
waitOnMetadataVideoDatarate
protected boolean waitOnMetadataVideoDatarate
-
waitOnMetadataAudio
protected boolean waitOnMetadataAudio
-
waitOnMetadataAudioDatarate
protected boolean waitOnMetadataAudioDatarate
-
waitOnMetadataTimeout
protected long waitOnMetadataTimeout
-
waitOnMetadataReady
protected boolean waitOnMetadataReady
-
waitOnMetadataStartime
protected long waitOnMetadataStartime
-
srcStreamBufferSize
protected long srcStreamBufferSize
-
bindAddress
protected String bindAddress
-
rtmpAuthProvider
protected IPushPublishRTMPAuthProvider rtmpAuthProvider
-
connectMetaData
protected java.util.Map<String,AMFData> connectMetaData
-
offlineTime
public long offlineTime
-
onlineTime
public long onlineTime
-
outprint
public int outprint
-
bytesAvg
public float[] bytesAvg
-
isSSL
protected boolean isSSL
-
usePingPong
protected boolean usePingPong
-
pingPongListenerRegistered
protected boolean pingPongListenerRegistered
-
syncTimecode
protected long syncTimecode
-
syncPacketType
protected int syncPacketType
-
-
Method Detail
-
createNetConnectionPublisher
protected PushPublishRTMPNetConnectionPublisher createNetConnectionPublisher(PushPublishRTMPNetConnectionSession pushPublisherSession)
-
getNetConnection
public INetConnection getNetConnection()
Get the underlying INetConnection interface for this session- Returns:
- INetConnection interface for this session
-
getLock
public Object getLock()
Get the synchronization lock- Returns:
- synchronization lock
-
getConnectionTimeout
public int getConnectionTimeout()
Get the connection timeout (milliseconds)- Returns:
- connection timeout (milliseconds)
-
setConnectionTimeout
public void setConnectionTimeout(int connectionTimeout)
Set the connection timeout (milliseconds)- Parameters:
connectionTimeout
- connection timeout (milliseconds)
-
getHowToPublish
public String getHowToPublish()
Get the howToPublish string (valid values are "live", "record" and "append")- Returns:
- howToPublish string
-
setHowToPublish
public void setHowToPublish(String howToPublish)
Set the howToPublish string (valid values are "live", "record" and "append")- Parameters:
howToPublish
- howToPublish string
-
isSendFCPublish
public boolean isSendFCPublish()
If true call FCPublish(streamName) after connecting to server- Returns:
- true if calling FCPublish(streamName) after connecting to server
-
setSendFCPublish
public void setSendFCPublish(boolean sendFCPublish)
If true call FCPublish(streamName) after connecting to server- Parameters:
sendFCPublish
- true if calling FCPublish(streamName) after connecting to server
-
isSendReleaseStream
public boolean isSendReleaseStream()
If true call releaseStream(streamName) after connecting to server- Returns:
- true if calling releaseStream(streamName) after connecting to server
-
setSendReleaseStream
public void setSendReleaseStream(boolean sendReleaseStream)
If true call releaseStream(streamName) after connecting to server- Parameters:
sendReleaseStream
- true if calling releaseStream(streamName) after connecting to server
-
getSessionListDebug
public String getSessionListDebug()
Get the list of active IoSession ids for this publishing session- Returns:
- list of active IoSession ids for this publishing session
-
isCurrentSession
public boolean isCurrentSession(org.apache.mina.common.IoSession session)
Test to see if passed in session is current session- Parameters:
session
- IoSession interface- Returns:
- true if current session
-
getLastSession
public PushPublishRTMPNetConnectionSession getLastSession()
Get the last session interface- Returns:
- last session interface
-
addSession
public void addSession(PushPublishRTMPNetConnectionSession sessionHolder)
Add session- Parameters:
sessionHolder
- session holder
-
removeSession
public void removeSession(PushPublishRTMPNetConnectionSession sessionHolder)
Remove session- Parameters:
sessionHolder
- session holder
-
getSessionHolderBySession
public PushPublishRTMPNetConnectionSession getSessionHolderBySession(org.apache.mina.common.IoSession session)
Get session holder by IoSession- Parameters:
session
- IoSession- Returns:
- session holder
-
getSessionHolderByNetConnection
public PushPublishRTMPNetConnectionSession getSessionHolderByNetConnection(INetConnection netConnection)
Get the session holder by INetConnection interface- Parameters:
netConnection
- INetConnection interface- Returns:
- session holder
-
sessionOpened
public void sessionOpened(org.apache.mina.common.IoSession session)
Internal callback- Parameters:
session
- IoSession
-
sessionClosed
public void sessionClosed(org.apache.mina.common.IoSession session)
Internal callback- Parameters:
session
- IoSession
-
tryToConnect
protected void tryToConnect(PushPublishRTMP.STATE connectionState)
Try to connect to server
-
resetConnection
public void resetConnection()
Reset server connection
-
resetConnection
public void resetConnection(boolean noDelay)
Reset server connection- Parameters:
noDelay
- if true reset immediately
-
getContextStr
public String getContextStr()
Get the connection details- Specified by:
getContextStr
in interfaceIPushPublish
- Specified by:
getContextStr
in classPushPublishBase
- Returns:
- connection details
-
internalConnect
protected org.apache.mina.common.IoSession internalConnect(PushPublishRTMPNetConnectionSession pushPublisherSession)
Internal connect method- Parameters:
pushPublisherSession
- session holder- Returns:
- Io session
-
getRemoteIpAddress
public java.net.SocketAddress getRemoteIpAddress()
-
getConnectionQueryStr
public String getConnectionQueryStr()
Get the connection query string- Returns:
- connection query string
-
setConnectionQueryStr
public void setConnectionQueryStr(String connectionQueryStr)
Set the connection query string- Parameters:
connectionQueryStr
- connection query string
-
getQueryString
public String getQueryString()
Get the queryString- Parameters:
queryString
-
-
setQueryString
public void setQueryString(String queryString)
Set the queryString, as set in the map file- Parameters:
queryString
-
-
connect
public void connect()
Connect to server
-
callConnect
protected void callConnect(PushPublishRTMPNetConnectionSession pushPublisherSession, String addQueryStr)
Internal connect- Parameters:
pushPublisherSession
- session holderaddQueryStr
- additional query params
-
getAkamaiSessionKey
public String getAkamaiSessionKey(String sessionId)
Get Akamai session key- Parameters:
sessionId
- session Id- Returns:
- Akamai session key
-
getConnectionFlashVerion
public String getConnectionFlashVerion()
Get Flash version used in connection metadata- Returns:
- Flash version used in connection metadata
-
getConnectionFlashVersion
public String getConnectionFlashVersion()
Get Flash version used in connection metadata- Returns:
- Flash version used in connection metadata
-
setConnectionFlashVersion
public void setConnectionFlashVersion(String connectionFlashVersion)
Set Flash version used in connection metadata- Parameters:
connectionFlashVersion
- Flash version used in connection metadata
-
setConnectionFlashVerion
public void setConnectionFlashVerion(String connectionFlashVersion)
Set Flash version used in connection metadata- Parameters:
connectionFlashVersion
- Flash version used in connection metadata
-
getConnectionSwfURL
public String getConnectionSwfURL()
Get SWF URL used in connection metadata- Returns:
- SWF URL used in connection metadata
-
setConnectionSwfURL
public void setConnectionSwfURL(String connectionSwfURL)
Set SWF URL used in connection metadata- Parameters:
connectionSwfURL
- SWF URL used in connection metadata
-
getConnectionPageURL
public String getConnectionPageURL()
Get Page URL used in connection metadata- Returns:
- Page URL used in connection metadata
-
setConnectionPageURL
public void setConnectionPageURL(String connectionPageURL)
Set Page URL used in connection metadata- Parameters:
connectionPageURL
- Page URL used in connection metadata
-
getSecureTokenSharedSecret
public String getSecureTokenSharedSecret()
Get SecureToken shared secret- Returns:
- SecureToken shared secret
-
setSecureTokenSharedSecret
public void setSecureTokenSharedSecret(String secureTokenSharedSecret)
Set SecureToken shared secret- Parameters:
secureTokenSharedSecret
- SecureToken shared secret
-
getAkamaiUserName
public String getAkamaiUserName()
Get Akamai user name- Returns:
- Akamai user name
-
setAkamaiUserName
public void setAkamaiUserName(String akamaiUserName)
Set Akamai user name- Parameters:
akamaiUserName
- Akamai user name
-
getAkamaiPassword
public String getAkamaiPassword()
Get Akamai password- Returns:
- Akamai password
-
setAkamaiPassword
public void setAkamaiPassword(String akamaiPassword)
Set Akamai password- Parameters:
akamaiPassword
- Akamai password
-
getAkamaiOriginIp
public String getAkamaiOriginIp()
Get Akamai Origin IP- Returns:
- Akamai Origin IP
-
setAkamaiOriginIp
public void setAkamaiOriginIp(String akamaiOriginIp)
Set Akamai Origin IP- Parameters:
akamaiOriginIp
- Akamai Origin IP
-
getAkamaiOriginPort
public int getAkamaiOriginPort()
Get Akamai Origin Port- Returns:
- Akamai Origin Port
-
setAkamaiOriginPort
public void setAkamaiOriginPort(int akamaiOriginPort)
Set Akamai Origin Port- Parameters:
akamaiOriginPort
- Akamai Origin Port
-
isSendFCAnnounce
public boolean isSendFCAnnounce()
If true call FCAnnounce(streamName) after connecting to server- Returns:
- true if calling FCAnnounce(streamName) after connecting to server
-
setSendFCAnnounce
public void setSendFCAnnounce(boolean sendFCAnnounce)
If true call FCAnnounce(streamName) after connecting to server- Parameters:
sendFCAnnounce
- true if calling FCAnnounce(streamName) after connecting to server
-
getValidationFrequency
public long getValidationFrequency()
Get connection validation frequency (millisecond). Zero to turn off validation.- Returns:
- connection validation frequency (millisecond)
-
setValidationFrequency
public void setValidationFrequency(long validationFrequency)
Set connection validation frequency (millisecond). Zero to turn off validation.- Parameters:
validationFrequency
- connection validation frequency (millisecond)
-
addListener
public void addListener(IPushPublishRTMPNotify listener)
Add IPushPublishRTMPNotify listener- Parameters:
listener
- IPushPublishRTMPNotify listener
-
removeListener
public boolean removeListener(IPushPublishRTMPNotify listener)
rempve IPushPublishRTMPNotify listener- Parameters:
listener
- IPushPublishRTMPNotify listener- Returns:
- true if removed
-
getLocalListeners
protected java.util.List<IPushPublishRTMPNotify> getLocalListeners()
Get a list of IPushPublishRTMPNotify listeners- Returns:
- list of IPushPublishRTMPNotify listeners
-
notifyConnectStart
protected void notifyConnectStart(PushPublishRTMPNetConnectionSession pushPublisherSession)
Notify connect start- Parameters:
pushPublisherSession
- session holder
-
notifyConnectSuccess
protected void notifyConnectSuccess(PushPublishRTMPNetConnectionSession pushPublisherSession)
Notify connect success- Parameters:
pushPublisherSession
- session holder
-
notifyConnectFailure
protected void notifyConnectFailure(PushPublishRTMPNetConnectionSession pushPublisherSession)
Notify connect failure- Parameters:
pushPublisherSession
- session holder
-
notifyHandshakeResult
protected void notifyHandshakeResult(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
Notify handshake result- Parameters:
pushPublisherSession
- session holderfunction
- functionparams
- params
-
notifyAkamaiSetChallenge
protected void notifyAkamaiSetChallenge(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
Notify Akamai SetChallenge- Parameters:
pushPublisherSession
- session holderfunction
- functionparams
- params
-
notifyAkamaiSetOriginConnectionInfo
protected void notifyAkamaiSetOriginConnectionInfo(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
Notify Akamai SetOriginConnectionInfo- Parameters:
pushPublisherSession
- session holderfunction
- functionparams
- params
-
notifyAkamaiClientLogin
protected void notifyAkamaiClientLogin(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
Notify Akamai ClientLogin- Parameters:
pushPublisherSession
- session holderfunction
- functionparams
- params
-
notifyFCPublish
protected void notifyFCPublish(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
Notify FCPublish- Parameters:
pushPublisherSession
- session holderfunction
- functionparams
- params
-
notifyFCAnnounce
protected void notifyFCAnnounce(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
Notify FCAnnounce- Parameters:
pushPublisherSession
- session holderfunction
- functionparams
- params
-
notifyConnect
protected void notifyConnect(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
Notify connect- Parameters:
pushPublisherSession
- session holderfunction
- functionparams
- params
-
notifyStreamCreate
protected void notifyStreamCreate(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
Notify stream create- Parameters:
pushPublisherSession
- session holderfunction
- functionparams
- params
-
notifyStreamOnPlayStatus
protected void notifyStreamOnPlayStatus(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
Notify OnPlayStatus- Parameters:
pushPublisherSession
- session holderfunction
- functionparams
- params
-
notifyStreamOnStatus
protected void notifyStreamOnStatus(PushPublishRTMPNetConnectionSession pushPublisherSession, com.wowza.wms.request.RequestFunction function, AMFDataList params)
Notify StreamOnStatus- Parameters:
pushPublisherSession
- session holderfunction
- functionparams
- params
-
notifyPublishHandlerPlay
protected void notifyPublishHandlerPlay(PushPublishRTMPNetConnectionSession pushPublisherSession, java.io.OutputStream out, long[] playSizes)
Notify publish handler play- Parameters:
pushPublisherSession
- session holderout
- output streamplaySizes
- play sizes
-
notifySessionIdle
protected void notifySessionIdle(PushPublishRTMPNetConnectionSession pushPublisherSession)
Notify session idle event- Parameters:
pushPublisherSession
- session holder
-
notifySessionOpened
protected void notifySessionOpened(PushPublishRTMPNetConnectionSession pushPublisherSession)
Notify session opened- Parameters:
pushPublisherSession
- session holder
-
notifySessionClosed
protected void notifySessionClosed(PushPublishRTMPNetConnectionSession pushPublisherSession)
Notify session closed- Parameters:
pushPublisherSession
- session holder
-
notifyValidateSession
protected void notifyValidateSession(PushPublishRTMPNetConnectionSession pushPublisherSession)
-
notifyValidateSessionResult
protected void notifyValidateSessionResult(PushPublishRTMPNetConnectionSession pushPublisherSession, boolean result)
-
notifyPushPublisherSessionCreate
protected void notifyPushPublisherSessionCreate(PushPublishRTMPNetConnectionSession pushPublisherSession)
Notify session create- Parameters:
pushPublisherSession
- session holder
-
notifyPushPublisherSessionDestroy
protected void notifyPushPublisherSessionDestroy(PushPublishRTMPNetConnectionSession pushPublisherSession)
Notify session destroy- Parameters:
pushPublisherSession
- session holder
-
getConnectLastAttempt
public long getConnectLastAttempt()
Get timestamp of last connection attempt- Returns:
- timestamp of last connection attempt
-
getConnectAttemptCount
public long getConnectAttemptCount()
-
setConnectLastAttempt
public void setConnectLastAttempt(long connectLastAttempt)
Set timestamp of last connection attempt- Parameters:
connectLastAttempt
- timestamp of last connection attempt
-
bumpReconnectWaitTime
protected void bumpReconnectWaitTime()
Bump the reconnect wait time
-
getReconnectDelay
protected int getReconnectDelay(long currTime)
Get the reconnect delay- Parameters:
currTime
- current timestamp- Returns:
- delay in milliseconds
-
getConnectLastSuccess
public long getConnectLastSuccess()
Get timestamp of last successful connection- Returns:
- timestamp of last successful connection
-
setConnectLastSuccess
public void setConnectLastSuccess(long connectLastSuccess)
Set timestamp of last successful connection- Parameters:
connectLastSuccess
- timestamp of last successful connection
-
isSendOriginalTimecodes
public boolean isSendOriginalTimecodes()
true if sending the original timecodes of source stream. false if starting at zero.- Returns:
- true if sending the original timecodes of source stream
-
setSendOriginalTimecodes
public void setSendOriginalTimecodes(boolean sendOriginalTimecodes)
true if sending the original timecodes of source stream. false if starting at zero.- Parameters:
sendOriginalTimecodes
- true if sending the original timecodes of source stream
-
getOriginalTimecodeThreshold
public long getOriginalTimecodeThreshold()
Get the original timecode threshold. This value will attempt to reduce the magnitude of absolute timecodes while keeping multiple-bitrate alignment. It is probably best to set this value quite high to a value such as 0x100000. The value is in milliseconds. The following forumla is used to calculate a timecode offset timecodeOffset = timecode - (timecode%originalTimecodeThreshold);- Returns:
- original timecode threshold
-
setOriginalTimecodeThreshold
public void setOriginalTimecodeThreshold(long originalTimecodeThreshold)
Set the original timecode threshold. This value will attempt to reduce the magnitude of absolute timecodes while keeping multiple-bitrate alignment. It is probably best to set this value quite high to a value such as 0x100000. The value is in milliseconds. The following forumla is used to calculate a timecode offset timecodeOffset = timecode - (timecode%originalTimecodeThreshold);- Parameters:
originalTimecodeThreshold
- original timecode threshold
-
setOriginalTimecodeThreshold
public void setOriginalTimecodeThreshold(String i)
-
isDebugLog
public boolean isDebugLog()
Is debug logging turned on- Specified by:
isDebugLog
in interfaceIPushPublish
- Overrides:
isDebugLog
in classPushPublishBase
- Returns:
- true if debug logging is turned on
-
setDebugLog
public void setDebugLog(boolean debugLog)
Set debug logging- Specified by:
setDebugLog
in interfaceIPushPublish
- Overrides:
setDebugLog
in classPushPublishBase
- Parameters:
debugLog
- debug logging
-
setStreamDebugLog
public void setStreamDebugLog(boolean debugLog)
-
getAppInstance
public IApplicationInstance getAppInstance()
Get appInstance interface- Overrides:
getAppInstance
in classPushPublishBase
- Returns:
- appInstance interface
-
setAppInstance
public void setAppInstance(IApplicationInstance appInstance)
Set appInstance interface- Overrides:
setAppInstance
in classPushPublishBase
- Parameters:
appInstance
- appInstance interface
-
getSrcStreamName
public String getSrcStreamName()
Get source stream name- Specified by:
getSrcStreamName
in interfaceIPushPublish
- Overrides:
getSrcStreamName
in classPushPublishBase
- Returns:
- source stream name
-
setSrcStreamName
public void setSrcStreamName(String srcStreamName)
Set source stream name- Specified by:
setSrcStreamName
in interfaceIPushPublish
- Overrides:
setSrcStreamName
in classPushPublishBase
- Parameters:
srcStreamName
- source stream name
-
getDstStreamName
public String getDstStreamName()
Get destination stream name- Specified by:
getDstStreamName
in interfaceIPushPublish
- Overrides:
getDstStreamName
in classPushPublishBase
- Returns:
- destination stream name
-
setDstStreamName
public void setDstStreamName(String dstStreamName)
Set destination stream name- Specified by:
setDstStreamName
in interfaceIPushPublish
- Overrides:
setDstStreamName
in classPushPublishBase
- Parameters:
dstStreamName
- destination stream name
-
getPort
public int getPort()
Get destination server port- Specified by:
getPort
in interfaceIPushPublish
- Overrides:
getPort
in classPushPublishBase
- Returns:
- destination server port
-
setPort
public void setPort(int port)
Set destination server port- Specified by:
setPort
in interfaceIPushPublish
- Overrides:
setPort
in classPushPublishBase
- Parameters:
port
- destination server port
-
getDstApplicationName
public String getDstApplicationName()
Get destination application name- Returns:
- destination application name
-
setDstApplicationName
public void setDstApplicationName(String dstApplicationName)
Set destination application name- Parameters:
dstApplicationName
- destination application name
-
getDstAppInstanceName
public String getDstAppInstanceName()
Get destination appInstance name- Returns:
- destination appInstance name
-
setDstAppInstanceName
public void setDstAppInstanceName(String dstAppInstanceName)
Set destination appInstance name- Parameters:
dstAppInstanceName
- destination appInstance name
-
getRTMPAuthProvider
public IPushPublishRTMPAuthProvider getRTMPAuthProvider()
Get RTMP authentication provider- Returns:
- RTMP authentication provider
-
setRTMPAuthProvider
public void setRTMPAuthProvider(IPushPublishRTMPAuthProvider rtmpAuthProvider)
Set RTMP authentication provider- Parameters:
rtmpAuthProvider
- RTMP authentication provider
-
isSendOnMetadata
public boolean isSendOnMetadata()
True if sending onMetadata event at start of stream- Returns:
- True if sending onMetadata event at start of stream
-
setSendOnMetadata
public void setSendOnMetadata(boolean sendOnMetadata)
True if sending onMetadata event at start of stream- Parameters:
sendOnMetadata
- True if sending onMetadata event at start of stream
-
isRemoveDefaultAppInstance
public 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.- Returns:
- true if omitting _definst_
-
setRemoveDefaultAppInstance
public 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.- Parameters:
removeDefaultAppInstance
- true if omitting _definst_
-
isOnMetadataToSetDataFrame
public boolean isOnMetadataToSetDataFrame()
If true all onMetadata events are converted to @setDataFrame calls- Returns:
- true all onMetadata events are converted to @setDataFrame calls
-
setOnMetadataToSetDataFrame
public void setOnMetadataToSetDataFrame(boolean onMetadataToSetDataFrame)
If true all onMetadata events are converted to @setDataFrame calls- Parameters:
onMetadataToSetDataFrame
- true all onMetadata events are converted to @setDataFrame calls
-
isSendStreamCloseCommands
public boolean isSendStreamCloseCommands()
If true will send FCUnpublish, closeStream, deleteStream on disconnect- Returns:
- true will send close commands
-
setSendStreamCloseCommands
public void setSendStreamCloseCommands(boolean sendStreamCloseCommands)
If true will send FCUnpublish, closeStream, deleteStream on disconnect- Parameters:
sendStreamCloseCommands
- true will send close commands
-
convertDataEvenToAMFData
public AMFDataList convertDataEvenToAMFData(AMFPacket packet)
-
filterOnMetadataEvent
public AMFPacket filterOnMetadataEvent(AMFPacket packet, long flags, java.util.List<String> itemsToRemove, java.util.Map<String,AMFData> itemsToAdd)
-
getStreamCloseWaitTime
public int getStreamCloseWaitTime()
Get stream close timeout (milliseconds)- Returns:
- stream close timeout (milliseconds)
-
setStreamCloseWaitTime
public void setStreamCloseWaitTime(int streamCloseWaitTime)
Set stream close timeout (milliseconds)- Parameters:
streamCloseWaitTime
- stream close timeout (milliseconds)
-
disconnect
public void disconnect()
Disconnect from server
-
disconnect
public void disconnect(boolean hard)
-
isFlashVerionFMLE
public 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/)- Parameters:
flashVersion
- true if Flash Media Live Encoder version- Returns:
- true if flash
-
isFlashVersionFMLE
public 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/)- Parameters:
flashVersion
- true if Flash Media Live Encoder version- Returns:
- true if flash
-
isDebugPackets
public boolean isDebugPackets()
Set to true to log every packet being sent- Returns:
- true to log every packet being sent
-
setDebugPackets
public void setDebugPackets(boolean debugPackets)
Set to true to log every packet being sent- Parameters:
debugPackets
- true to log every packet being sent
-
getTotalPacketsSent
public long getTotalPacketsSent()
Get total number of packets sent during push publishing session- Returns:
- total number of packets sent during push publishing session
-
isResetOnTimecodeOutOfOrder
public boolean isResetOnTimecodeOutOfOrder()
Set to true if you wish push to reset if timecodes jump out of order.- Returns:
- true if you wish push to reset if timecodes jump out of order
-
setResetOnTimecodeOutOfOrder
public void setResetOnTimecodeOutOfOrder(boolean resetOnTimecodeOutOfOrder)
Set to true if you wish push to reset if timecodes jump out of order.- Parameters:
resetOnTimecodeOutOfOrder
- true if you wish push to reset if timecodes jump out of order
-
getTimecodesOutOfOrderThreshold
public int getTimecodesOutOfOrderThreshold()
-
setTimecodesOutOfOrderThreshold
public void setTimecodesOutOfOrderThreshold(int timecodesOutOfOrderThreshold)
-
getLastVideoTC
public long getLastVideoTC()
Get the absolute timecode of the last sent video packet (milliseconds)- Returns:
- absolute timecode of the last sent video packet (milliseconds)
-
getLastVideoKeyFrameTC
public long getLastVideoKeyFrameTC()
Get the absolute timecode of the last sent video keyframe packet (milliseconds)- Returns:
- absolute timecode of the last sent video keyframe packet (milliseconds)
-
getLastAudioTC
public long getLastAudioTC()
Get the absolute timecode of the last sent audio packet (milliseconds)- Returns:
- absolute timecode of the last sent audio packet (milliseconds)
-
getLastDataTC
public long getLastDataTC()
Get the absolute timecode of the last sent data packet (milliseconds)- Returns:
- absolute timecode of the last sent data packet (milliseconds)
-
isOnMetadataReady
protected boolean isOnMetadataReady(IMediaStream stream, AMFPacket packet)
-
isWaitOnMetadataAvailable
public 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. Default is true. If stream is audio or video only, be sure to use setWaitOnMetadataVideo and setWaitOnMetadataAudio to properly turn off the channel you are not using or the system will always timeout.- Returns:
- true to turn on system that will monitor onMetadata packet
-
setWaitOnMetadataAvailable
public 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. Default is true. If stream is audio or video only, be sure to use setWaitOnMetadataVideo and setWaitOnMetadataAudio to properly turn off the channel you are not using or the system will always timeout.- Parameters:
waitOnMetadataAvailable
- true to turn on system that will monitor onMetadata packet
-
isWaitOnMetadataVideo
public boolean isWaitOnMetadataVideo()
If true and waitOnMetadataAvailable, publishing will not start until onMetadata packet is populated with video data.- Returns:
- publishing will not start until onMetadata packet is populated with video data
-
setWaitOnMetadataVideo
public void setWaitOnMetadataVideo(boolean waitOnMetadataVideo)
If true and waitOnMetadataAvailable, publishing will not start until onMetadata packet is populated with video data.- Parameters:
waitOnMetadataVideo
- publishing will not start until onMetadata packet is populated with video data
-
isWaitOnMetadataAudio
public boolean isWaitOnMetadataAudio()
If true and waitOnMetadataAvailable, publishing will not start until onMetadata packet is populated with audio data.- Returns:
- publishing will not start until onMetadata packet is populated with audio data
-
setWaitOnMetadataAudio
public void setWaitOnMetadataAudio(boolean waitOnMetadataAudio)
If true and waitOnMetadataAvailable, publishing will not start until onMetadata packet is populated with audio data.- Parameters:
waitOnMetadataAudio
- publishing will not start until onMetadata packet is populated with audio data
-
getWaitOnMetadataTimeout
public long getWaitOnMetadataTimeout()
Timeout (milliseconds) that the wait on onMetadata system will wait looking for video and audio data to be populated.- Returns:
- timeout (milliseconds) that the wait on onMetadata system will wait looking for video and audio data to be populated
-
setWaitOnMetadataTimeout
public void setWaitOnMetadataTimeout(long waitOnMetadataTimeout)
Timeout (milliseconds) that the wait on onMetadata system will wait looking for video and audio data to be populated.- Parameters:
waitOnMetadataTimeout
- timeout (milliseconds) that the wait on onMetadata system will wait looking for video and audio data to be populated
-
isWaitOnMetadataVideoDatarate
public boolean isWaitOnMetadataVideoDatarate()
-
setWaitOnMetadataVideoDatarate
public void setWaitOnMetadataVideoDatarate(boolean waitOnMetadataVideoDatarate)
-
isWaitOnMetadataAudioDatarate
public boolean isWaitOnMetadataAudioDatarate()
-
setWaitOnMetadataAudioDatarate
public void setWaitOnMetadataAudioDatarate(boolean waitOnMetadataAudioDatarate)
-
getSrcStreamBufferSize
public long getSrcStreamBufferSize()
The amount of audio/video in milliseconds that must be available in the source streams buffer before push publishing will being.- Returns:
- amount of audio/video in milliseconds that must be available
-
setSrcStreamBufferSize
public 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.- Parameters:
srcStreamBufferSize
- amount of audio/video in milliseconds that must be available
-
addConnectMetaData
public void addConnectMetaData(String key, AMFData value)
Added metadata values to the connect metadata object- Parameters:
key
- keyvalue
- AMFDataObj value
-
createPushPublishSession
public IPushPublishSession createPushPublishSession()
- Specified by:
createPushPublishSession
in interfaceIPushPublish
- Overrides:
createPushPublishSession
in classPushPublishBase
-
getPacketsSentAudio
public long getPacketsSentAudio()
-
getPacketsSentVideo
public long getPacketsSentVideo()
-
getPacketsSentVideoKeyFrame
public long getPacketsSentVideoKeyFrame()
-
getPacketsSentData
public long getPacketsSentData()
-
isSSL
public boolean isSSL()
-
setSSL
public void setSSL(boolean isSSL)
-
getBindAddress
public String getBindAddress()
-
setBindAddress
public void setBindAddress(String bindAddress)
-
getConnectedState
public int getConnectedState()
-
getMessagesAttemptedCount
public long getMessagesAttemptedCount()
-
getMessagesRetriedCount
public long getMessagesRetriedCount()
-
getMessagesFailedCount
public long getMessagesFailedCount()
-
getSyncTimecode
public long getSyncTimecode()
-
setSyncTimecode
public void setSyncTimecode(long syncTimecode)
-
getSyncPacketType
public int getSyncPacketType()
-
setSyncPacketType
public void setSyncPacketType(int syncPacketType)
-
getOnMetadataFilter
public long getOnMetadataFilter()
-
setOnMetadataFilter
public void setOnMetadataFilter(long onMetadataFilter)
-
addOnMetadataItemToRemove
public void addOnMetadataItemToRemove(String name)
-
putOnMetadataItemToAdd
public void putOnMetadataItemToAdd(String name, AMFData value)
-
getOriginalTimecodeOffset
public long getOriginalTimecodeOffset()
-
setOriginalTimecodeOffset
public void setOriginalTimecodeOffset(long originalTimecodeOffset)
-
-