All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.antmedia.webrtc.api.IWebRTCAdaptor Maven / Gradle / Ivy

Go to download

Ant Media Server supports RTMP, RTSP, MP4, HLS, WebRTC, Adaptive Streaming, etc.

There is a newer version: 2.10.0
Show newest version
package io.antmedia.webrtc.api;

import java.util.List;
import java.util.Set;

import org.red5.server.api.scope.IScopeService;

import io.antmedia.cluster.IStreamInfo;
import io.antmedia.rest.WebRTCClientStats;
import io.antmedia.webrtc.VideoCodec;


public interface IWebRTCAdaptor extends IScopeService {
	
	
	public static String BEAN_NAME = "webrtc.adaptor";

	void registerMuxer(String streamId, IWebRTCMuxer webRTCMuxer);

	void unRegisterMuxer(String streamId, IWebRTCMuxer webRTCMuxer);

	boolean registerWebRTCClient(String streamId, IWebRTCClient webRTCClient, VideoCodec codec);

	boolean streamExists(String streamId);
	
	List getStreamInfo(String streamId);

	/**
	 * Try to find the best bitrate for the client
	 * @param streamId
	 * @param webRTCClient
	 */
	void adaptStreamingQuality(String streamId, IWebRTCClient webRTCClient, VideoCodec codec);

	/**
	 * Register to specific resolution
	 * 
	 * It is used in clustering
	 * 
	 * @param streamId
	 * @param webRTCClusterClient
	 * @param resolutionHeight
	 */
	boolean registerWebRTCClient(String streamId, IWebRTCClient webRTCClusterClient, int resolutionHeight, VideoCodec codec);
	
	/**
	 * Returns number of active live streams 
	 * @return
	 */
	int getNumberOfLiveStreams();
	
	/**
	 * Returns total number of viewers
	 * @return
	 */
	int getNumberOfTotalViewers();
	
	/**
	 * Returns total number of viewer of a specific stream
	 * @param streamId
	 * @return
	 */
	int getNumberOfViewers(String streamId);
	
	/**
	 * Return webrtc client stats
	 * @param streamId
	 * @return
	 */
	List getWebRTCClientStats(String streamId);
	
	/**
	 * Returns the stream id in the WebRTCAdaptor
	 */
	Set getStreams();

	/**
	 * Sets the excessive bandwidth threshold value
	 * @param excessiveBandwidthValue
	 */
	void setExcessiveBandwidthValue(int excessiveBandwidthValue);

	/**
	 * Sets the excessive bandwidth call threshold value
	 * @param excessiveBandwidthCallThreshold
	 */
	void setExcessiveBandwidthCallThreshold(int excessiveBandwidthCallThreshold);

	/**
	 * Enable or disable excessive bandwidth algorithm
	 * @param excessiveBandwidthAlgorithmEnabled
	 */
	void setExcessiveBandwidthAlgorithmEnabled(boolean excessiveBandwidthAlgorithmEnabled);

	/**
	 * Set packet loss threshold if packetLoss is bigger than this value in ExcessiveBandwidth
	 * algorithm, it switches back to lower quality without try every attempts {@link #setTryCountBeforeSwitchback(int)}
	 * @param packetLossDiffThresholdForSwitchback
	 */
	void setPacketLossDiffThresholdForSwitchback(int packetLossDiffThresholdForSwitchback);

	/**
	 * Set rtt measurement threshold if rttMeasurement is bigger than this value in ExcessiveBandwidth
	 * algorithm, it switches back to lower quality without try every attempts {@link #setTryCountBeforeSwitchback(int)}
	 * @param rttMeasurementDiffThresholdForSwitchback
	 */
	void setRttMeasurementDiffThresholdForSwitchback(int rttMeasurementDiffThresholdForSwitchback);

	/**
	 * Number of tries to switch back to lower quality in ExcessiveBandwidth
	 * @param tryCountBeforeSwitchback
	 */
	void setTryCountBeforeSwitchback(int tryCountBeforeSwitchback);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy