Package com.wowza.wms.mediacaster
Interface IMediaCaster
public interface IMediaCaster
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionbooleanIdle processorvoidForce a reset/reconnect of this media casterGet the application instance this media caster is associated withlongGet system time in milliseconds of last connection attemptlongGet system time in milliseconds of last time forceReset was calledlongGet system time in milliseconds of last connection successintGet the idle timeout for this media caster (milliseconds)Get the media caster definitionGet the media caster idGet the media caster item associated with this media casterintGet the media caster type.intGet the minimum time between reconnect attempts (milliseconds)Get the underlying stream being used by this media casterlongGet the AMFPacket sequence number of last watchdog processed packetlongGet the time in milliseconds the stream has been missinglongEach time a MediaCaster stream switches from not running to running this value is incrementedintGet the watchdog stream timeout (milliseconds)longGet system time in milliseconds of last time stream was reset due to stream timeout (debug)longGet system time in milliseconds of last time stream was considered in missing state (debug)intGet the reason the stream is in timeout condition (debug)getVHost()Get the virtual host associated with this media castervoidinit(MediaCasterStreamItem mediaCasterStreamItem, MediaCasterItem mediaCasterDef, IApplicationInstance appInstance, String mediaCasterId, String streamExt) Initialize the media casterbooleanIs there current a session attached to this MediaCasterbooleanisStream()Is there a stream associated with this MediaCasterbooleanReturn true if stream is currently runningvoidregisterPlayer(IMediaStreamPlay player) Register a player with this media castervoidsessionClosed(org.apache.mina.common.IoSession session) sessionClosed callbackvoidsessionOpened(org.apache.mina.common.IoSession session) sessionOpened callbackvoidsetAppInstance(IApplicationInstance appInstance) Set the application instance this media caster is assoicated withvoidsetMediaCasterDef(MediaCasterItem mediaCasterDef) Set the media caster definitionvoidsetMediaCasterId(String mediaCasterId) Get the media caster idvoidsetMediaCasterType(int mediaCasterType) Set the media caster type.voidsetReconnectWaitTime(int reconnectWaitTime) Set the minimum time between reconnect attempts (milliseconds)voidsetStream(IMediaStream stream) Set the underlying stream being used by this media castervoidsetStreamRunning(boolean streamRunning) Called internally to track when streams are running or are stopped.voidsetStreamTimeout(int streamTimeout) Set the watchdog stream timeout (millseconds)voidshutdown(boolean isAppInstanceShutdown) Shutdown media castervoidunregisterPlayer(IMediaStreamPlay player) Unregister a player with this media caster
-
Field Details
-
STREAMTIMEOUTREASON_UNKNOWN
static final int STREAMTIMEOUTREASON_UNKNOWN- See Also:
-
STREAMTIMEOUTREASON_NOTIMEOUT
static final int STREAMTIMEOUTREASON_NOTIMEOUT- See Also:
-
STREAMTIMEOUTREASON_NOSESSION
static final int STREAMTIMEOUTREASON_NOSESSION- See Also:
-
STREAMTIMEOUTREASON_NOURL
static final int STREAMTIMEOUTREASON_NOURL- See Also:
-
STREAMTIMEOUTREASON_NOSTREAM
static final int STREAMTIMEOUTREASON_NOSTREAM- See Also:
-
STREAMTIMEOUTREASON_RECONNECTRUNNING
static final int STREAMTIMEOUTREASON_RECONNECTRUNNING- See Also:
-
STREAMTIMEOUTREASON_NORTSPSESSION
static final int STREAMTIMEOUTREASON_NORTSPSESSION- See Also:
-
STREAMTIMEOUTREASON_GOOD
static final int STREAMTIMEOUTREASON_GOOD- See Also:
-
STREAMTIMEOUTREASON_MISSING
static final int STREAMTIMEOUTREASON_MISSING- See Also:
-
MEDIACASTERTYPE_UNKNOWN
static final int MEDIACASTERTYPE_UNKNOWN- See Also:
-
MEDIACASTERTYPE_LIVEREPEATER
static final int MEDIACASTERTYPE_LIVEREPEATER- See Also:
-
MEDIACASTERTYPE_SHOUTCAST
static final int MEDIACASTERTYPE_SHOUTCAST- See Also:
-
MEDIACASTERTYPE_RTPLIVE
static final int MEDIACASTERTYPE_RTPLIVE- See Also:
-
MEDIACASTERTYPE_CUPERTINO
static final int MEDIACASTERTYPE_CUPERTINO- See Also:
-
MEDIACASTERTYPE_MPEGTSTCP
static final int MEDIACASTERTYPE_MPEGTSTCP- See Also:
-
MEDIACASTERTYPE_SRTRECEIVER
static final int MEDIACASTERTYPE_SRTRECEIVER- See Also:
-
-
Method Details
-
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
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
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
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
Set the media caster definition- Parameters:
mediaCasterDef- media caster definition
-
shutdown
void shutdown(boolean isAppInstanceShutdown) Shutdown media caster- Parameters:
isAppInstanceShutdown- is server shutdown
-
registerPlayer
Register a player with this media caster- Parameters:
player- player to register
-
unregisterPlayer
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
-