Package com.wowza.wms.mediacaster
Interface IMediaCaster
-
public interface IMediaCaster
-
-
Field Summary
Fields Modifier and Type Field Description static int
MEDIACASTERTYPE_CUPERTINO
static int
MEDIACASTERTYPE_LIVEREPEATER
static int
MEDIACASTERTYPE_MPEGTSTCP
static int
MEDIACASTERTYPE_RTPLIVE
static int
MEDIACASTERTYPE_SHOUTCAST
static int
MEDIACASTERTYPE_SRTRECEIVER
static int
MEDIACASTERTYPE_UNKNOWN
static int
STREAMTIMEOUTREASON_GOOD
static int
STREAMTIMEOUTREASON_MISSING
static int
STREAMTIMEOUTREASON_NORTSPSESSION
static int
STREAMTIMEOUTREASON_NOSESSION
static int
STREAMTIMEOUTREASON_NOSTREAM
static int
STREAMTIMEOUTREASON_NOTIMEOUT
static int
STREAMTIMEOUTREASON_NOURL
static int
STREAMTIMEOUTREASON_RECONNECTRUNNING
static int
STREAMTIMEOUTREASON_UNKNOWN
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
doWatchdog()
Idle processorvoid
forceReset()
Force a reset/reconnect of this media casterIApplicationInstance
getAppInstance()
Get the application instance this media caster is associated withlong
getConnectLastAttempt()
Get system time in milliseconds of last connection attemptlong
getConnectLastForceReset()
Get system time in milliseconds of last time forceReset was calledlong
getConnectLastSuccess()
Get system time in milliseconds of last connection successint
getIdleTimeout()
Get the idle timeout for this media caster (milliseconds)MediaCasterItem
getMediaCasterDef()
Get the media caster definitionString
getMediaCasterId()
Get the media caster idMediaCasterStreamItem
getMediaCasterStreamItem()
Get the media caster item associated with this media casterint
getMediaCasterType()
Get the media caster type.int
getReconnectWaitTime()
Get the minimum time between reconnect attempts (milliseconds)IMediaStream
getStream()
Get the underlying stream being used by this media casterlong
getStreamLastSeq()
Get the AMFPacket sequence number of last watchdog processed packetlong
getStreamMissingTime()
Get the time in milliseconds the stream has been missinglong
getStreamRunningIndex()
Each time a MediaCaster stream switches from not running to running this value is incrementedint
getStreamTimeout()
Get the watchdog stream timeout (milliseconds)long
getStreamTimeoutLastReset()
Get system time in milliseconds of last time stream was reset due to stream timeout (debug)long
getStreamTimeoutLastTime()
Get system time in milliseconds of last time stream was considered in missing state (debug)int
getStreamTimeoutReason()
Get the reason the stream is in timeout condition (debug)IVHost
getVHost()
Get the virtual host associated with this media castervoid
init(MediaCasterStreamItem mediaCasterStreamItem, MediaCasterItem mediaCasterDef, IApplicationInstance appInstance, String mediaCasterId, String streamExt)
Initialize the media casterboolean
isSession()
Is there current a session attached to this MediaCasterboolean
isStream()
Is there a stream associated with this MediaCasterboolean
isStreamIsRunning()
Return true if stream is currently runningvoid
registerPlayer(IMediaStreamPlay player)
Register a player with this media castervoid
sessionClosed(org.apache.mina.common.IoSession session)
sessionClosed callbackvoid
sessionOpened(org.apache.mina.common.IoSession session)
sessionOpened callbackvoid
setAppInstance(IApplicationInstance appInstance)
Set the application instance this media caster is assoicated withvoid
setMediaCasterDef(MediaCasterItem mediaCasterDef)
Set the media caster definitionvoid
setMediaCasterId(String mediaCasterId)
Get the media caster idvoid
setMediaCasterType(int mediaCasterType)
Set the media caster type.void
setReconnectWaitTime(int reconnectWaitTime)
Set the minimum time between reconnect attempts (milliseconds)void
setStream(IMediaStream stream)
Set the underlying stream being used by this media castervoid
setStreamRunning(boolean streamRunning)
Called internally to track when streams are running or are stopped.void
setStreamTimeout(int streamTimeout)
Set the watchdog stream timeout (millseconds)void
shutdown(boolean isAppInstanceShutdown)
Shutdown media castervoid
unregisterPlayer(IMediaStreamPlay player)
Unregister a player with this media caster
-
-
-
Field Detail
-
STREAMTIMEOUTREASON_UNKNOWN
static final int STREAMTIMEOUTREASON_UNKNOWN
- See Also:
- Constant Field Values
-
STREAMTIMEOUTREASON_NOTIMEOUT
static final int STREAMTIMEOUTREASON_NOTIMEOUT
- See Also:
- Constant Field Values
-
STREAMTIMEOUTREASON_NOSESSION
static final int STREAMTIMEOUTREASON_NOSESSION
- See Also:
- Constant Field Values
-
STREAMTIMEOUTREASON_NOURL
static final int STREAMTIMEOUTREASON_NOURL
- See Also:
- Constant Field Values
-
STREAMTIMEOUTREASON_NOSTREAM
static final int STREAMTIMEOUTREASON_NOSTREAM
- See Also:
- Constant Field Values
-
STREAMTIMEOUTREASON_RECONNECTRUNNING
static final int STREAMTIMEOUTREASON_RECONNECTRUNNING
- See Also:
- Constant Field Values
-
STREAMTIMEOUTREASON_NORTSPSESSION
static final int STREAMTIMEOUTREASON_NORTSPSESSION
- See Also:
- Constant Field Values
-
STREAMTIMEOUTREASON_GOOD
static final int STREAMTIMEOUTREASON_GOOD
- See Also:
- Constant Field Values
-
STREAMTIMEOUTREASON_MISSING
static final int STREAMTIMEOUTREASON_MISSING
- See Also:
- Constant Field Values
-
MEDIACASTERTYPE_UNKNOWN
static final int MEDIACASTERTYPE_UNKNOWN
- See Also:
- Constant Field Values
-
MEDIACASTERTYPE_LIVEREPEATER
static final int MEDIACASTERTYPE_LIVEREPEATER
- See Also:
- Constant Field Values
-
MEDIACASTERTYPE_SHOUTCAST
static final int MEDIACASTERTYPE_SHOUTCAST
- See Also:
- Constant Field Values
-
MEDIACASTERTYPE_RTPLIVE
static final int MEDIACASTERTYPE_RTPLIVE
- See Also:
- Constant Field Values
-
MEDIACASTERTYPE_CUPERTINO
static final int MEDIACASTERTYPE_CUPERTINO
- See Also:
- Constant Field Values
-
MEDIACASTERTYPE_MPEGTSTCP
static final int MEDIACASTERTYPE_MPEGTSTCP
- See Also:
- Constant Field Values
-
MEDIACASTERTYPE_SRTRECEIVER
static final int MEDIACASTERTYPE_SRTRECEIVER
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
void init(MediaCasterStreamItem mediaCasterStreamItem, MediaCasterItem mediaCasterDef, IApplicationInstance appInstance, String mediaCasterId, String streamExt) throws Exception
Initialize the media caster- Parameters:
mediaCasterStreamItem
- media caster itemmediaCasterDef
- media caster definitionappInstance
- application instancemediaCasterId
- media caster idstreamExt
- stream ext or prefix- Throws:
Exception
-
getVHost
IVHost getVHost()
Get the virtual host associated with this media caster- Returns:
- virtual host associated with this media caster
-
getMediaCasterId
String getMediaCasterId()
Get the media caster id- Returns:
- media caster id
-
setMediaCasterId
void setMediaCasterId(String mediaCasterId)
Get the media caster id- Parameters:
mediaCasterId
- media caster id
-
getStream
IMediaStream getStream()
Get the underlying stream being used by this media caster- Returns:
- underlying stream being used by this media caster
-
setStream
void setStream(IMediaStream stream)
Set the underlying stream being used by this media caster- Parameters:
stream
- underlying stream being used by this media caster
-
getAppInstance
IApplicationInstance getAppInstance()
Get the application instance this media caster is associated with- Returns:
- application instance this media caster is associated with
-
setAppInstance
void setAppInstance(IApplicationInstance appInstance)
Set the application instance this media caster is assoicated with- Parameters:
appInstance
- application instance this media caster is assoicated with
-
getMediaCasterDef
MediaCasterItem getMediaCasterDef()
Get the media caster definition- Returns:
- media caster definition
-
setMediaCasterDef
void setMediaCasterDef(MediaCasterItem mediaCasterDef)
Set the media caster definition- Parameters:
mediaCasterDef
- media caster definition
-
shutdown
void shutdown(boolean isAppInstanceShutdown)
Shutdown media caster- Parameters:
isAppInstanceShutdown
- is server shutdown
-
registerPlayer
void registerPlayer(IMediaStreamPlay player)
Register a player with this media caster- Parameters:
player
- player to register
-
unregisterPlayer
void unregisterPlayer(IMediaStreamPlay player)
Unregister a player with this media caster- Parameters:
player
- player to unregister
-
getIdleTimeout
int getIdleTimeout()
Get the idle timeout for this media caster (milliseconds)- Returns:
- idle timeout for this media caster (milliseconds)
-
sessionOpened
void sessionOpened(org.apache.mina.common.IoSession session)
sessionOpened callback- Parameters:
session
- IO Session
-
sessionClosed
void sessionClosed(org.apache.mina.common.IoSession session)
sessionClosed callback- Parameters:
session
- IO Session
-
getMediaCasterStreamItem
MediaCasterStreamItem getMediaCasterStreamItem()
Get the media caster item associated with this media caster- Returns:
- media caster item associated with this media caster
-
forceReset
void forceReset()
Force a reset/reconnect of this media caster
-
doWatchdog
boolean doWatchdog()
Idle processor- Returns:
- return true if media caster unloaded due to idle event
-
getStreamTimeout
int getStreamTimeout()
Get the watchdog stream timeout (milliseconds)- Returns:
- stream timeout
-
setStreamTimeout
void setStreamTimeout(int streamTimeout)
Set the watchdog stream timeout (millseconds)- Parameters:
streamTimeout
- stream timeout
-
getStreamMissingTime
long getStreamMissingTime()
Get the time in milliseconds the stream has been missing- Returns:
- time in milliseconds the stream has been missing
-
getStreamLastSeq
long getStreamLastSeq()
Get the AMFPacket sequence number of last watchdog processed packet- Returns:
- AMFPacket sequence number
-
getStreamTimeoutReason
int getStreamTimeoutReason()
Get the reason the stream is in timeout condition (debug)- Returns:
- reason the stream is in timeout condition (debug)
-
getStreamTimeoutLastTime
long getStreamTimeoutLastTime()
Get system time in milliseconds of last time stream was considered in missing state (debug)- Returns:
- time in milliseconds of last time stream was considered in missing
-
getStreamTimeoutLastReset
long getStreamTimeoutLastReset()
Get system time in milliseconds of last time stream was reset due to stream timeout (debug)- Returns:
- time in milliseconds of last time stream was reset
-
isSession
boolean isSession()
Is there current a session attached to this MediaCaster- Returns:
- true is MediaCaster has session
-
isStream
boolean isStream()
Is there a stream associated with this MediaCaster- Returns:
- true if stream associated with this MediaCaster
-
getConnectLastAttempt
long getConnectLastAttempt()
Get system time in milliseconds of last connection attempt- Returns:
- system time in milliseconds of last connection attempt
-
getConnectLastSuccess
long getConnectLastSuccess()
Get system time in milliseconds of last connection success- Returns:
- system time in milliseconds of last connection success
-
getConnectLastForceReset
long getConnectLastForceReset()
Get system time in milliseconds of last time forceReset was called- Returns:
- system time in milliseconds of last time forceReset was called
-
isStreamIsRunning
boolean isStreamIsRunning()
Return true if stream is currently running- Returns:
- true if stream is currently running
-
getReconnectWaitTime
int getReconnectWaitTime()
Get the minimum time between reconnect attempts (milliseconds)- Returns:
- minimum time between reconnect attempts (milliseconds)
-
setReconnectWaitTime
void setReconnectWaitTime(int reconnectWaitTime)
Set the minimum time between reconnect attempts (milliseconds)- Parameters:
reconnectWaitTime
- minimum time between reconnect attempts (milliseconds)
-
getMediaCasterType
int getMediaCasterType()
Get the media caster type. See IMediaCaster.MEDIACASTERTYPE_*- Returns:
- media caster type
-
setMediaCasterType
void setMediaCasterType(int mediaCasterType)
Set the media caster type. See IMediaCaster.MEDIACASTERTYPE_*- Parameters:
mediaCasterType
- media caster type
-
setStreamRunning
void setStreamRunning(boolean streamRunning)
Called internally to track when streams are running or are stopped.- Parameters:
streamRunning
- set to true if stream is running
-
getStreamRunningIndex
long getStreamRunningIndex()
Each time a MediaCaster stream switches from not running to running this value is incremented- Returns:
- stream running index
-
-