com.wowza.wms.module
Class ModuleMediaCasterStreamMonitorAdvanced

Object
  extended by com.wowza.wms.module.ModuleBase
      extended by com.wowza.wms.module.ModuleMediaCasterStreamMonitorAdvanced
All Implemented Interfaces:
IMediaCasterValidateMediaCaster

public class ModuleMediaCasterStreamMonitorAdvanced
extends ModuleBase
implements IMediaCasterValidateMediaCaster

ModuleMediaCasterStreamMonitorAdvanced: Advanced stream monitoring module.

Add this <Module> definition to the end of the <Modules> list in [install-dir]/conf/[application]/Application.xml:

<Module>
        <Name>ModuleMediaCasterStreamMonitorAdvanced</Name>
        <Description>ModuleMediaCasterStreamMonitorAdvanced</Description>
        <Class>com.wowza.wms.module.ModuleMediaCasterStreamMonitorAdvanced</Class>
</Module>

Add these properties to the application level <Properties> container at the bottom of [install-dir]/conf/[application]/Application.xml (be sure to get the correct <Properties> container - there are several in the Application.xml file). Carefully read the instructions above each set of properties and set accordingly:

<!--
Monitor incoming packets (stream, audio, video) to be sure packets continue to flow from encoder to stream. The 
streamMonitor[type]StartTimeout controls the timeout (milliseconds) for the first packet. The streamMonitor[type]Timeout 
controls the timeout (milliseconds) for packets after the first packet. The stream type refers to a catch all of any packet of 
any type (audio, video, data). If any of these values are set to zero, the test is turned off.
-->
<Property>
        <Name>streamMonitorStreamStartTimeout</Name>
        <Value>20000</Value>
        <Type>Integer</Type>
</Property>
<Property>
        <Name>streamMonitorStreamTimeout</Name>
        <Value>12000</Value>
        <Type>Integer</Type>
</Property>
<Property>
        <Name>streamMonitorVideoStartTimeout</Name>
        <Value>0</Value>
        <Type>Integer</Type>
</Property>
<Property>
        <Name>streamMonitorVideoTimeout</Name>
        <Value>0</Value>
        <Type>Integer</Type>
</Property>
<Property>
        <Name>streamMonitorAudioStartTimeout</Name>
        <Value>0</Value>
        <Type>Integer</Type>
</Property>
<Property>
        <Name>streamMonitorAudioTimeout</Name>
        <Value>0</Value>
        <Type>Integer</Type>
</Property>

<!--
Monitor the incoming packet timecodes (audio, video or data) to be sure packets do not arrive out of order or late. The 
streamMonitor[type]TCPosTolerance and streamMonitor[type]TCNegTolerance (milliseconds) values define a sliding window 
based on the timecode of the previous packet. For example if these values are set to -500 and 3000 respectively then the 
timecode difference between the current arriving packet and the previous packet of that type must fall within 
-500 and 3000 milliseconds.  If not and streamMonitor[type]TCToleranceEnable is set to true then stream will be considered 
unhealthy and will be reset.
-->
<Property>
        <Name>streamMonitorVideoTCToleranceEnable</Name>
        <Value>false</Value>
        <Type>Boolean</Type>
</Property>
<Property>
        <Name>streamMonitorVideoTCPosTolerance</Name>
        <Value>3000</Value>
        <Type>Integer</Type>
</Property>
<Property>
        <Name>streamMonitorVideoTCNegTolerance</Name>
        <Value>-500</Value>
        <Type>Integer</Type>
</Property>
<Property>
        <Name>streamMonitorAudioTCToleranceEnable</Name>
        <Value>false</Value>
        <Type>Boolean</Type>
</Property>
<Property>
        <Name>streamMonitorAudioTCPosTolerance</Name>
        <Value>3000</Value>
        <Type>Integer</Type>
</Property>
<Property>
        <Name>streamMonitorAudioTCNegTolerance</Name>
        <Value>-500</Value>
        <Type>Integer</Type>
</Property>
<Property>
        <Name>streamMonitorDataTCToleranceEnable</Name>
        <Value>false</Value>
        <Type>Boolean</Type>
</Property>
<Property>
        <Name>streamMonitorDataTCPosTolerance</Name>
        <Value>3000</Value>
        <Type>Integer</Type>
</Property>
<Property>
        <Name>streamMonitorDataTCNegTolerance</Name>
        <Value>-500</Value>
        <Type>Integer</Type>
</Property>


<!--
Monitors the time difference between the audio and video channel of a stream. If the difference between the currently arriving
video packet and the previous audio packet (or vice-versa) is greater than streamMonitorAVSyncTolerance and streamMonitorAVSyncToleranceEnable
is set to true, then the stream will be considered unhealthy and will be reset.
-->
<Property>
        <Name>streamMonitorAVSyncToleranceEnable</Name>
        <Value>false</Value>
        <Type>Boolean</Type>
</Property>
<Property>
        <Name>streamMonitorAVSyncTolerance</Name>
        <Value>1500</Value>
        <Type>Integer</Type>
</Property>

<!--
If set to true, then when a stream is reset and it belong to a MediaStreamNameGroup all streams in the group will be reset. If
false only the unhealthy stream will be reset.
-->
<Property>
        <Name>streamMonitorResetNameGroups</Name>
        <Value>true</Value>
        <Type>Boolean</Type>
</Property>

<!--
Turns on debug logging of the monitoring.
-->
<Property>
        <Name>streamMonitorDebug</Name>
        <Value>false</Value>
        <Type>Boolean</Type>
</Property>


Field Summary
protected  IApplicationInstance appInstance
           
protected  java.util.Set<IMediaCaster> badStreams
           
protected  java.util.Map<IMediaStream,com.wowza.wms.stream.monitor.MediaStreamMonitor> monitors
           
protected  int streamMonitorAudioStartTimeout
           
protected  int streamMonitorAudioTCNegTolerance
           
protected  int streamMonitorAudioTCPosTolerance
           
protected  boolean streamMonitorAudioTCToleranceEnable
           
protected  int streamMonitorAudioTimeout
           
protected  int streamMonitorAVSyncTolerance
           
protected  boolean streamMonitorAVSyncToleranceEnable
           
protected  int streamMonitorDataTCNegTolerance
           
protected  int streamMonitorDataTCPosTolerance
           
protected  boolean streamMonitorDataTCToleranceEnable
           
protected  boolean streamMonitorDebug
           
protected  boolean streamMonitorResetNameGroups
           
protected  int streamMonitorStreamStartTimeout
           
protected  int streamMonitorStreamTimeout
           
protected  int streamMonitorVideoStartTimeout
           
protected  int streamMonitorVideoTCNegTolerance
           
protected  int streamMonitorVideoTCPosTolerance
           
protected  boolean streamMonitorVideoTCToleranceEnable
           
protected  int streamMonitorVideoTimeout
           
 
Fields inherited from class com.wowza.wms.module.ModuleBase
CALLBACK_PARAM1, CALLBACK_PARAM10, CALLBACK_PARAM2, CALLBACK_PARAM3, CALLBACK_PARAM4, CALLBACK_PARAM5, CALLBACK_PARAM6, CALLBACK_PARAM7, CALLBACK_PARAM8, CALLBACK_PARAM9, PARAM1, PARAM10, PARAM2, PARAM3, PARAM4, PARAM5, PARAM6, PARAM7, PARAM8, PARAM9, PARAMMETHODNAME, PLAYTRANSITION_APPEND, PLAYTRANSITION_APPEND_IMMEDIATE, PLAYTRANSITION_RESET, PLAYTRANSITION_RESET_IMMEDIATE, PLAYTRANSITION_STOP, PLAYTRANSITION_SWAP, PLAYTRANSITION_SWITCH, PLAYTRANSITION_UNKNOWN, PLAYTRANSITIONSTR_APPEND, PLAYTRANSITIONSTR_RESET, PLAYTRANSITIONSTR_STOP, PLAYTRANSITIONSTR_SWAP, PLAYTRANSITIONSTR_SWITCH, PLAYTRANSITIONSTR_UNKNOWN
 
Constructor Summary
ModuleMediaCasterStreamMonitorAdvanced()
           
 
Method Summary
 void onAppStart(IApplicationInstance appInstance)
           
 void onAppStop(IApplicationInstance appInstance)
           
 boolean onResetMediaCaster(IApplicationInstance appInstance, IMediaCaster mediaCaster)
          Called when media caster is reset
 void onStreamCreate(IMediaStream stream)
           
 void onStreamDestroy(IMediaStream stream)
           
 boolean onValidateMediaCaster(IApplicationInstance appInstance, IMediaCaster mediaCaster)
          Called for each media caster to validate the media caster.
 void onValidateMediaCastersStart(IApplicationInstance appInstance)
          Called when validation for all streams of an application instance is starting
 void onValidateMediaCastersStop(IApplicationInstance appInstance)
          Called when validation for all streams of an application instance is done
 
Methods inherited from class com.wowza.wms.module.ModuleBase
getAppInstance, getApplication, getCallbackParamCount, getLogger, getParam, getParamBoolean, getParamBoolean, getParamCount, getParamDate, getParamDouble, getParamDouble, getParamInt, getParamInt, getParamLong, getParamLong, getParamMixedArray, getParamObj, getParamString, getParamString, getParamType, getStream, getVHost, invokePrevious, invokePrevious, isSendResult, sendClientOnStatusError, sendResult, sendResult, sendResult, sendResult, sendResult, sendStreamOnStatusError
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

appInstance

protected IApplicationInstance appInstance

badStreams

protected java.util.Set<IMediaCaster> badStreams

monitors

protected java.util.Map<IMediaStream,com.wowza.wms.stream.monitor.MediaStreamMonitor> monitors

streamMonitorAudioStartTimeout

protected int streamMonitorAudioStartTimeout

streamMonitorAudioTCNegTolerance

protected int streamMonitorAudioTCNegTolerance

streamMonitorAudioTCPosTolerance

protected int streamMonitorAudioTCPosTolerance

streamMonitorAudioTCToleranceEnable

protected boolean streamMonitorAudioTCToleranceEnable

streamMonitorAudioTimeout

protected int streamMonitorAudioTimeout

streamMonitorAVSyncTolerance

protected int streamMonitorAVSyncTolerance

streamMonitorAVSyncToleranceEnable

protected boolean streamMonitorAVSyncToleranceEnable

streamMonitorDataTCNegTolerance

protected int streamMonitorDataTCNegTolerance

streamMonitorDataTCPosTolerance

protected int streamMonitorDataTCPosTolerance

streamMonitorDataTCToleranceEnable

protected boolean streamMonitorDataTCToleranceEnable

streamMonitorDebug

protected boolean streamMonitorDebug

streamMonitorResetNameGroups

protected boolean streamMonitorResetNameGroups

streamMonitorStreamStartTimeout

protected int streamMonitorStreamStartTimeout

streamMonitorStreamTimeout

protected int streamMonitorStreamTimeout

streamMonitorVideoStartTimeout

protected int streamMonitorVideoStartTimeout

streamMonitorVideoTCNegTolerance

protected int streamMonitorVideoTCNegTolerance

streamMonitorVideoTCPosTolerance

protected int streamMonitorVideoTCPosTolerance

streamMonitorVideoTCToleranceEnable

protected boolean streamMonitorVideoTCToleranceEnable

streamMonitorVideoTimeout

protected int streamMonitorVideoTimeout
Constructor Detail

ModuleMediaCasterStreamMonitorAdvanced

public ModuleMediaCasterStreamMonitorAdvanced()
Method Detail

onAppStart

public void onAppStart(IApplicationInstance appInstance)

onAppStop

public void onAppStop(IApplicationInstance appInstance)

onResetMediaCaster

public boolean onResetMediaCaster(IApplicationInstance appInstance,
                                  IMediaCaster mediaCaster)
Description copied from interface: IMediaCasterValidateMediaCaster
Called when media caster is reset

Specified by:
onResetMediaCaster in interface IMediaCasterValidateMediaCaster
Parameters:
appInstance - application instance
mediaCaster - media caster
Returns:
return true

onStreamCreate

public void onStreamCreate(IMediaStream stream)

onStreamDestroy

public void onStreamDestroy(IMediaStream stream)

onValidateMediaCaster

public boolean onValidateMediaCaster(IApplicationInstance appInstance,
                                     IMediaCaster mediaCaster)
Description copied from interface: IMediaCasterValidateMediaCaster
Called for each media caster to validate the media caster. Return true if valid.

Specified by:
onValidateMediaCaster in interface IMediaCasterValidateMediaCaster
Parameters:
appInstance - application instance
mediaCaster - media caster
Returns:
true, if valid

onValidateMediaCastersStart

public void onValidateMediaCastersStart(IApplicationInstance appInstance)
Description copied from interface: IMediaCasterValidateMediaCaster
Called when validation for all streams of an application instance is starting

Specified by:
onValidateMediaCastersStart in interface IMediaCasterValidateMediaCaster
Parameters:
appInstance - application instance

onValidateMediaCastersStop

public void onValidateMediaCastersStop(IApplicationInstance appInstance)
Description copied from interface: IMediaCasterValidateMediaCaster
Called when validation for all streams of an application instance is done

Specified by:
onValidateMediaCastersStop in interface IMediaCasterValidateMediaCaster