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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadaptStreamingQuality(String streamId, IWebRTCClient webRTCClient, VideoCodec codec) Try to find the best bitrate for the clientbooleanforceStreamingQuality(String streamId, IWebRTCClient webRTCClient, int streamHeight) Try to force defined stream quality for the clientintReturns number of active live streamsintReturns total number of viewersintgetNumberOfViewers(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 statsvoidregisterMuxer(String streamId, IWebRTCMuxer webRTCMuxer) booleanregisterWebRTCClient(String streamId, IWebRTCClient webRTCClusterClient, int resolutionHeight, VideoCodec codec) Register to specific resolution It is used in clusteringbooleanregisterWebRTCClient(String streamId, IWebRTCClient webRTCClient, VideoCodec codec) voidsetExcessiveBandwidthAlgorithmEnabled(boolean excessiveBandwidthAlgorithmEnabled) Enable or disable excessive bandwidth algorithmvoidsetExcessiveBandwidthCallThreshold(int excessiveBandwidthCallThreshold) Sets the excessive bandwidth call threshold valuevoidsetExcessiveBandwidthValue(int excessiveBandwidthValue) Sets the excessive bandwidth threshold valuevoidsetPacketLossDiffThresholdForSwitchback(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)voidsetRttMeasurementDiffThresholdForSwitchback(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)voidsetTryCountBeforeSwitchback(int tryCountBeforeSwitchback) Number of tries to switch back to lower quality in ExcessiveBandwidthbooleanstreamExists(String streamId) voidunRegisterMuxer(String streamId, IWebRTCMuxer webRTCMuxer)
-
Constructor Details
-
MockWebRTCAdaptor
public MockWebRTCAdaptor()
-
-
Method Details
-
registerMuxer
- Specified by:
registerMuxerin interfaceIWebRTCAdaptor
-
unRegisterMuxer
- Specified by:
unRegisterMuxerin interfaceIWebRTCAdaptor
-
registerWebRTCClient
- Specified by:
registerWebRTCClientin interfaceIWebRTCAdaptor
-
streamExists
- Specified by:
streamExistsin interfaceIWebRTCAdaptor
-
getStreamInfo
- Specified by:
getStreamInfoin interfaceIWebRTCAdaptor
-
adaptStreamingQuality
Description copied from interface:IWebRTCAdaptorTry to find the best bitrate for the client- Specified by:
adaptStreamingQualityin interfaceIWebRTCAdaptor
-
registerWebRTCClient
public boolean registerWebRTCClient(String streamId, IWebRTCClient webRTCClusterClient, int resolutionHeight, VideoCodec codec) Description copied from interface:IWebRTCAdaptorRegister to specific resolution It is used in clustering- Specified by:
registerWebRTCClientin interfaceIWebRTCAdaptor
-
getNumberOfLiveStreams
public int getNumberOfLiveStreams()Description copied from interface:IWebRTCAdaptorReturns number of active live streams- Specified by:
getNumberOfLiveStreamsin interfaceIWebRTCAdaptor- Returns:
-
getNumberOfTotalViewers
public int getNumberOfTotalViewers()Description copied from interface:IWebRTCAdaptorReturns total number of viewers- Specified by:
getNumberOfTotalViewersin interfaceIWebRTCAdaptor- Returns:
-
getNumberOfViewers
Description copied from interface:IWebRTCAdaptorReturns total number of viewer of a specific stream- Specified by:
getNumberOfViewersin interfaceIWebRTCAdaptor- Returns:
-
getWebRTCClientStats
Description copied from interface:IWebRTCAdaptorReturn webrtc client stats- Specified by:
getWebRTCClientStatsin interfaceIWebRTCAdaptor- Returns:
-
getStreams
Description copied from interface:IWebRTCAdaptorReturns the stream id in the WebRTCAdaptor- Specified by:
getStreamsin interfaceIWebRTCAdaptor
-
setExcessiveBandwidthValue
public void setExcessiveBandwidthValue(int excessiveBandwidthValue) Description copied from interface:IWebRTCAdaptorSets the excessive bandwidth threshold value- Specified by:
setExcessiveBandwidthValuein interfaceIWebRTCAdaptor
-
setExcessiveBandwidthCallThreshold
public void setExcessiveBandwidthCallThreshold(int excessiveBandwidthCallThreshold) Description copied from interface:IWebRTCAdaptorSets the excessive bandwidth call threshold value- Specified by:
setExcessiveBandwidthCallThresholdin interfaceIWebRTCAdaptor
-
setExcessiveBandwidthAlgorithmEnabled
public void setExcessiveBandwidthAlgorithmEnabled(boolean excessiveBandwidthAlgorithmEnabled) Description copied from interface:IWebRTCAdaptorEnable or disable excessive bandwidth algorithm- Specified by:
setExcessiveBandwidthAlgorithmEnabledin interfaceIWebRTCAdaptor
-
setPacketLossDiffThresholdForSwitchback
public void setPacketLossDiffThresholdForSwitchback(int packetLossDiffThresholdForSwitchback) Description copied from interface:IWebRTCAdaptorSet 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:
setPacketLossDiffThresholdForSwitchbackin interfaceIWebRTCAdaptor
-
setRttMeasurementDiffThresholdForSwitchback
public void setRttMeasurementDiffThresholdForSwitchback(int rttMeasurementDiffThresholdForSwitchback) Description copied from interface:IWebRTCAdaptorSet 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:
setRttMeasurementDiffThresholdForSwitchbackin interfaceIWebRTCAdaptor
-
setTryCountBeforeSwitchback
public void setTryCountBeforeSwitchback(int tryCountBeforeSwitchback) Description copied from interface:IWebRTCAdaptorNumber of tries to switch back to lower quality in ExcessiveBandwidth- Specified by:
setTryCountBeforeSwitchbackin interfaceIWebRTCAdaptor
-
forceStreamingQuality
Description copied from interface:IWebRTCAdaptorTry to force defined stream quality for the client- Specified by:
forceStreamingQualityin interfaceIWebRTCAdaptor
-