Package io.antmedia.webrtc
Class MockWebRTCAdaptor
java.lang.Object
io.antmedia.webrtc.MockWebRTCAdaptor
- All Implemented Interfaces:
IWebRTCAdaptor
,IScopeService
This class is used to mock the webrtc adaptor in community edition
- Author:
- mekya
-
Field Summary
Fields inherited from interface io.antmedia.webrtc.api.IWebRTCAdaptor
BEAN_NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
adaptStreamingQuality
(String streamId, IWebRTCClient webRTCClient, VideoCodec codec) Try to find the best bitrate for the clientboolean
forceStreamingQuality
(String streamId, IWebRTCClient webRTCClient, int streamHeight) Try to force defined stream quality for the clientint
Returns number of active live streamsint
Returns total number of viewersint
getNumberOfViewers
(String streamId) Returns total number of viewer of a specific streamgetStreamInfo
(String streamId) Returns the stream id in the WebRTCAdaptorgetWebRTCClientStats
(String streamId) Return webrtc client statsvoid
registerMuxer
(String streamId, IWebRTCMuxer webRTCMuxer) boolean
registerWebRTCClient
(String streamId, IWebRTCClient webRTCClusterClient, int resolutionHeight, VideoCodec codec) Register to specific resolution It is used in clusteringboolean
registerWebRTCClient
(String streamId, IWebRTCClient webRTCClient, VideoCodec codec) void
setExcessiveBandwidthAlgorithmEnabled
(boolean excessiveBandwidthAlgorithmEnabled) Enable or disable excessive bandwidth algorithmvoid
setExcessiveBandwidthCallThreshold
(int excessiveBandwidthCallThreshold) Sets the excessive bandwidth call threshold valuevoid
setExcessiveBandwidthValue
(int excessiveBandwidthValue) Sets the excessive bandwidth threshold valuevoid
setPacketLossDiffThresholdForSwitchback
(int packetLossDiffThresholdForSwitchback) Set packet loss threshold if packetLoss is bigger than this value in ExcessiveBandwidth algorithm, it switches back to lower quality without try every attemptsIWebRTCAdaptor.setTryCountBeforeSwitchback(int)
void
setRttMeasurementDiffThresholdForSwitchback
(int rttMeasurementDiffThresholdForSwitchback) Set rtt measurement threshold if rttMeasurement is bigger than this value in ExcessiveBandwidth algorithm, it switches back to lower quality without try every attemptsIWebRTCAdaptor.setTryCountBeforeSwitchback(int)
void
setTryCountBeforeSwitchback
(int tryCountBeforeSwitchback) Number of tries to switch back to lower quality in ExcessiveBandwidthboolean
streamExists
(String streamId) void
unRegisterMuxer
(String streamId, IWebRTCMuxer webRTCMuxer)
-
Constructor Details
-
MockWebRTCAdaptor
public MockWebRTCAdaptor()
-
-
Method Details
-
registerMuxer
- Specified by:
registerMuxer
in interfaceIWebRTCAdaptor
-
unRegisterMuxer
- Specified by:
unRegisterMuxer
in interfaceIWebRTCAdaptor
-
registerWebRTCClient
- Specified by:
registerWebRTCClient
in interfaceIWebRTCAdaptor
-
streamExists
- Specified by:
streamExists
in interfaceIWebRTCAdaptor
-
getStreamInfo
- Specified by:
getStreamInfo
in interfaceIWebRTCAdaptor
-
adaptStreamingQuality
Description copied from interface:IWebRTCAdaptor
Try to find the best bitrate for the client- Specified by:
adaptStreamingQuality
in interfaceIWebRTCAdaptor
-
registerWebRTCClient
public boolean registerWebRTCClient(String streamId, IWebRTCClient webRTCClusterClient, int resolutionHeight, VideoCodec codec) Description copied from interface:IWebRTCAdaptor
Register to specific resolution It is used in clustering- Specified by:
registerWebRTCClient
in interfaceIWebRTCAdaptor
-
getNumberOfLiveStreams
public int getNumberOfLiveStreams()Description copied from interface:IWebRTCAdaptor
Returns number of active live streams- Specified by:
getNumberOfLiveStreams
in interfaceIWebRTCAdaptor
- Returns:
-
getNumberOfTotalViewers
public int getNumberOfTotalViewers()Description copied from interface:IWebRTCAdaptor
Returns total number of viewers- Specified by:
getNumberOfTotalViewers
in interfaceIWebRTCAdaptor
- Returns:
-
getNumberOfViewers
Description copied from interface:IWebRTCAdaptor
Returns total number of viewer of a specific stream- Specified by:
getNumberOfViewers
in interfaceIWebRTCAdaptor
- Returns:
-
getWebRTCClientStats
Description copied from interface:IWebRTCAdaptor
Return webrtc client stats- Specified by:
getWebRTCClientStats
in interfaceIWebRTCAdaptor
- Returns:
-
getStreams
Description copied from interface:IWebRTCAdaptor
Returns the stream id in the WebRTCAdaptor- Specified by:
getStreams
in interfaceIWebRTCAdaptor
-
setExcessiveBandwidthValue
public void setExcessiveBandwidthValue(int excessiveBandwidthValue) Description copied from interface:IWebRTCAdaptor
Sets the excessive bandwidth threshold value- Specified by:
setExcessiveBandwidthValue
in interfaceIWebRTCAdaptor
-
setExcessiveBandwidthCallThreshold
public void setExcessiveBandwidthCallThreshold(int excessiveBandwidthCallThreshold) Description copied from interface:IWebRTCAdaptor
Sets the excessive bandwidth call threshold value- Specified by:
setExcessiveBandwidthCallThreshold
in interfaceIWebRTCAdaptor
-
setExcessiveBandwidthAlgorithmEnabled
public void setExcessiveBandwidthAlgorithmEnabled(boolean excessiveBandwidthAlgorithmEnabled) Description copied from interface:IWebRTCAdaptor
Enable or disable excessive bandwidth algorithm- Specified by:
setExcessiveBandwidthAlgorithmEnabled
in interfaceIWebRTCAdaptor
-
setPacketLossDiffThresholdForSwitchback
public void setPacketLossDiffThresholdForSwitchback(int packetLossDiffThresholdForSwitchback) Description copied from interface:IWebRTCAdaptor
Set packet loss threshold if packetLoss is bigger than this value in ExcessiveBandwidth algorithm, it switches back to lower quality without try every attemptsIWebRTCAdaptor.setTryCountBeforeSwitchback(int)
- Specified by:
setPacketLossDiffThresholdForSwitchback
in interfaceIWebRTCAdaptor
-
setRttMeasurementDiffThresholdForSwitchback
public void setRttMeasurementDiffThresholdForSwitchback(int rttMeasurementDiffThresholdForSwitchback) Description copied from interface:IWebRTCAdaptor
Set rtt measurement threshold if rttMeasurement is bigger than this value in ExcessiveBandwidth algorithm, it switches back to lower quality without try every attemptsIWebRTCAdaptor.setTryCountBeforeSwitchback(int)
- Specified by:
setRttMeasurementDiffThresholdForSwitchback
in interfaceIWebRTCAdaptor
-
setTryCountBeforeSwitchback
public void setTryCountBeforeSwitchback(int tryCountBeforeSwitchback) Description copied from interface:IWebRTCAdaptor
Number of tries to switch back to lower quality in ExcessiveBandwidth- Specified by:
setTryCountBeforeSwitchback
in interfaceIWebRTCAdaptor
-
forceStreamingQuality
Description copied from interface:IWebRTCAdaptor
Try to force defined stream quality for the client- Specified by:
forceStreamingQuality
in interfaceIWebRTCAdaptor
-