com.wowza.wms.mediacaster
Interface IMediaCaster


public interface IMediaCaster


Field Summary
static int MEDIACASTERTYPE_LIVEREPEATER
           
static int MEDIACASTERTYPE_RTPLIVE
           
static int MEDIACASTERTYPE_SHOUTCAST
           
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
 boolean doWatchdog()
          Idle processor
 void forceReset()
          Force a reset/reconnect of this media caster
 IApplicationInstance getAppInstance()
          Get the application instance this media caster is associated with
 long getConnectLastAttempt()
          Get system time in milliseconds of last connection attempt
 long getConnectLastForceReset()
          Get system time in milliseconds of last time forceReset was called
 long getConnectLastSuccess()
          Get system time in milliseconds of last connection success
 int getIdleTimeout()
          Get the idle timeout for this media caster (milliseconds)
 MediaCasterItem getMediaCasterDef()
          Get the media caster definition
 String getMediaCasterId()
          Get the media caster id
 MediaCasterStreamItem getMediaCasterStreamItem()
          Get the media caster item associated with this media caster
 int 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 caster
 Object getStreamIsRunningLock()
          Get stream running lock
 long getStreamLastSeq()
          Get the AMFPacket sequence number of last watchdog processed packet
 long getStreamMissingTime()
          Get the time in milliseconds the stream has been missing
 int 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 caster
 void init(MediaCasterStreamItem mediaCasterStreamItem, MediaCasterItem mediaCasterDef, IApplicationInstance appInstance, String mediaCasterId, String streamExt)
          Initialize the media caster
 boolean isSession()
          Is there current a session attached to this MediaCaster
 boolean isStream()
          Is there a stream associated with this MediaCaster
 boolean isStreamIsRunning()
          Return true if stream is currently running
 void registerPlayer(IMediaStreamPlay player)
          Register a player with this media caster
 void sessionClosed(org.apache.mina.common.IoSession session)
          sessionClosed callback
 void sessionOpened(org.apache.mina.common.IoSession session)
          sessionOpened callback
 void setAppInstance(IApplicationInstance appInstance)
          Set the application instance this media caster is assoicated with
 void setMediaCasterDef(MediaCasterItem mediaCasterDef)
          Set the media caster definition
 void setMediaCasterId(String mediaCasterId)
          Get the media caster id
 void 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 caster
 void setStreamTimeout(int streamTimeout)
          Set the watchdog stream timeout (millseconds)
 void shutdown(boolean isAppInstanceShutdown)
          Shutdown media caster
 void unregisterPlayer(IMediaStreamPlay player)
          Unregister a player with this media caster
 

Field Detail

MEDIACASTERTYPE_LIVEREPEATER

static final int MEDIACASTERTYPE_LIVEREPEATER
See Also:
Constant Field Values

MEDIACASTERTYPE_RTPLIVE

static final int MEDIACASTERTYPE_RTPLIVE
See Also:
Constant Field Values

MEDIACASTERTYPE_SHOUTCAST

static final int MEDIACASTERTYPE_SHOUTCAST
See Also:
Constant Field Values

MEDIACASTERTYPE_UNKNOWN

static final int MEDIACASTERTYPE_UNKNOWN
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

STREAMTIMEOUTREASON_NORTSPSESSION

static final int STREAMTIMEOUTREASON_NORTSPSESSION
See Also:
Constant Field Values

STREAMTIMEOUTREASON_NOSESSION

static final int STREAMTIMEOUTREASON_NOSESSION
See Also:
Constant Field Values

STREAMTIMEOUTREASON_NOSTREAM

static final int STREAMTIMEOUTREASON_NOSTREAM
See Also:
Constant Field Values

STREAMTIMEOUTREASON_NOTIMEOUT

static final int STREAMTIMEOUTREASON_NOTIMEOUT
See Also:
Constant Field Values

STREAMTIMEOUTREASON_NOURL

static final int STREAMTIMEOUTREASON_NOURL
See Also:
Constant Field Values

STREAMTIMEOUTREASON_RECONNECTRUNNING

static final int STREAMTIMEOUTREASON_RECONNECTRUNNING
See Also:
Constant Field Values

STREAMTIMEOUTREASON_UNKNOWN

static final int STREAMTIMEOUTREASON_UNKNOWN
See Also:
Constant Field Values
Method Detail

doWatchdog

boolean doWatchdog()
Idle processor

Returns:
return true if media caster unloaded due to idle event

forceReset

void forceReset()
Force a reset/reconnect of 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

getConnectLastAttempt

long getConnectLastAttempt()
Get system time in milliseconds of last connection attempt

Returns:
system time in milliseconds of last connection attempt

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

getConnectLastSuccess

long getConnectLastSuccess()
Get system time in milliseconds of last connection success

Returns:
system time in milliseconds of last connection success

getIdleTimeout

int getIdleTimeout()
Get the idle timeout for this media caster (milliseconds)

Returns:
idle timeout for this media caster (milliseconds)

getMediaCasterDef

MediaCasterItem getMediaCasterDef()
Get the media caster definition

Returns:
media caster definition

getMediaCasterId

String getMediaCasterId()
Get the media caster id

Returns:
media caster id

getMediaCasterStreamItem

MediaCasterStreamItem getMediaCasterStreamItem()
Get the media caster item associated with this media caster

Returns:
media caster item associated with this media caster

getMediaCasterType

int getMediaCasterType()
Get the media caster type. See IMediaCaster.MEDIACASTERTYPE_*

Returns:
media caster type

getReconnectWaitTime

int getReconnectWaitTime()
Get the minimum time between reconnect attempts (milliseconds)

Returns:
minimum time between reconnect attempts (milliseconds)

getStream

IMediaStream getStream()
Get the underlying stream being used by this media caster

Returns:
underlying stream being used by this media caster

getStreamIsRunningLock

Object getStreamIsRunningLock()
Get stream running lock

Returns:
stream running lock

getStreamLastSeq

long getStreamLastSeq()
Get the AMFPacket sequence number of last watchdog processed packet

Returns:
AMFPacket sequence number

getStreamMissingTime

long getStreamMissingTime()
Get the time in milliseconds the stream has been missing

Returns:
time in milliseconds the stream has been missing

getStreamTimeout

int getStreamTimeout()
Get the watchdog stream timeout (milliseconds)

Returns:
stream timeout

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

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

getStreamTimeoutReason

int getStreamTimeoutReason()
Get the reason the stream is in timeout condition (debug)

Returns:
reason the stream is in timeout condition (debug)

getVHost

IVHost getVHost()
Get the virtual host associated with this media caster

Returns:
virtual host associated with this media caster

init

void init(MediaCasterStreamItem mediaCasterStreamItem,
          MediaCasterItem mediaCasterDef,
          IApplicationInstance appInstance,
          String mediaCasterId,
          String streamExt)
Initialize the media caster

Parameters:
mediaCasterStreamItem - media caster item
mediaCasterDef - media caster definition
appInstance - application instance
mediaCasterId - media caster id
streamExt - stream ext or prefix

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

isStreamIsRunning

boolean isStreamIsRunning()
Return true if stream is currently running

Returns:
true if stream is currently running

registerPlayer

void registerPlayer(IMediaStreamPlay player)
Register a player with this media caster

Parameters:
player - player to register

sessionClosed

void sessionClosed(org.apache.mina.common.IoSession session)
sessionClosed callback

Parameters:
session - IO Session

sessionOpened

void sessionOpened(org.apache.mina.common.IoSession session)
sessionOpened callback

Parameters:
session - IO Session

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

setMediaCasterDef

void setMediaCasterDef(MediaCasterItem mediaCasterDef)
Set the media caster definition

Parameters:
mediaCasterDef - media caster definition

setMediaCasterId

void setMediaCasterId(String mediaCasterId)
Get the media caster id

Parameters:
mediaCasterId - media caster id

setMediaCasterType

void setMediaCasterType(int mediaCasterType)
Set the media caster type. See IMediaCaster.MEDIACASTERTYPE_*

Parameters:
mediaCasterType - media caster type

setReconnectWaitTime

void setReconnectWaitTime(int reconnectWaitTime)
Set the minimum time between reconnect attempts (milliseconds)

Parameters:
reconnectWaitTime - minimum time between reconnect attempts (milliseconds)

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

setStreamTimeout

void setStreamTimeout(int streamTimeout)
Set the watchdog stream timeout (millseconds)

Parameters:
streamTimeout - stream timeout

shutdown

void shutdown(boolean isAppInstanceShutdown)
Shutdown media caster

Parameters:
isAppInstanceShutdown - is server shutdown

unregisterPlayer

void unregisterPlayer(IMediaStreamPlay player)
Unregister a player with this media caster

Parameters:
player - player to unregister