Package io.antmedia.webrtc.api
Interface IWebRTCClient
public interface IWebRTCClient
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddIceCandidate(IceCandidate iceCandidate) voidaddWebRTCMuxer(IWebRTCMuxer webRTCMuxer) voidCache current channel parameters like round trip time and packet lossbooleanforceStreamQuality(int streamHeight, String subtrackId) floatReturn the period of send audio period in millisecondsintintintNumber of consecutive calls of increaseExcessiveBandwidthCountintgetForceStreamHeight(String streamId) intReturns the packetloss rateGetter for remote ip addressintReturn the round trip time measurementlonglongGetter for stream IdintlongReturns the time in milliseconds between the time when start function is called and the time when streaming is startedlongReturns the time in milliseconds between the time when stop function is called and the time when streaming is fully stoppedintfloatReturn the period of send video period in millisecondsgetWebRTCMuxer(String trackId) Get the muxervoidIt's called when there is excessive bandwidth than the current onevoidnotifyWebRTCClientAboutChangeInResolution(int streamHeight, String streamId) Client stream resolution change notificationvoidremoveTracksOnTheFly(String trackId) Remove a trackvoidremoveWebRTCMuxer(IWebRTCMuxer webRTCMuxer) voidReset the excessive bandwidth countvoidsendAudioPacket(ByteBuffer audioPacket, long timestamp, String trackId) Send audio packet to connected clientvoidsendVideoPacket(ByteBuffer videoPacket, boolean isKeyFrame, long timestamp, int frameRotation, List<NaluIndex> naluIndices, String trackId) Send video packet to connected clientvoidvoidsetTryCountBeforeSwitchBack(int tryCountBeforeSwitchback) voidsetVideoResolution(int width, int height) voidsetWebRTCAdaptor(IWebRTCAdaptor webRTCAdaptor) voidstart()voidstop()
-
Method Details
-
setWebRTCAdaptor
-
sendVideoPacket
void sendVideoPacket(ByteBuffer videoPacket, boolean isKeyFrame, long timestamp, int frameRotation, List<NaluIndex> naluIndices, String trackId) Send video packet to connected client- Parameters:
videoPacket-isKeyFrame-naluIndices-trackIndex-
-
sendAudioPacket
Send audio packet to connected client- Parameters:
audioPacket-audioLevel-
-
getTargetBitrate
int getTargetBitrate() -
start
void start() -
setRemoteDescription
-
addIceCandidate
-
setVideoResolution
void setVideoResolution(int width, int height) -
addWebRTCMuxer
-
removeWebRTCMuxer
-
stop
void stop() -
getTimeToStartStreaming
long getTimeToStartStreaming()Returns the time in milliseconds between the time when start function is called and the time when streaming is started- Returns:
- the time in milliseconds or -1 if timing is not available yet
-
getTimeToStop
long getTimeToStop()Returns the time in milliseconds between the time when stop function is called and the time when streaming is fully stopped- Returns:
- the time in milliseconds or -1 if timing is not available yet
-
getVideoFrameSentPeriod
float getVideoFrameSentPeriod()Return the period of send video period in milliseconds- Returns:
-
getAudioFrameSentPeriod
float getAudioFrameSentPeriod()Return the period of send audio period in milliseconds- Returns:
-
getSendVideoPacketCallCount
long getSendVideoPacketCallCount()- Returns:
- the number of times video packet send called
-
getSendAudioPacketCallCount
long getSendAudioPacketCallCount()- Returns:
- number of times audio packet send called
-
getVideoStats
WebRTCVideoSendStats getVideoStats()- Returns:
- low level video stats
-
getAudioStats
WebRTCAudioSendStats getAudioStats()- Returns:
- low level audio stats
-
increaseExcessiveBandwidthCount
void increaseExcessiveBandwidthCount()It's called when there is excessive bandwidth than the current one -
getExcessiveBandwidthCount
int getExcessiveBandwidthCount()Number of consecutive calls of increaseExcessiveBandwidthCount- Returns:
-
resetExcessiveBandwidthCount
void resetExcessiveBandwidthCount()Reset the excessive bandwidth count -
getRttMeasurement
int getRttMeasurement()Return the round trip time measurement- Returns:
-
getPacketLoss
int getPacketLoss()Returns the packetloss rate- Returns:
-
setTryCountBeforeSwitchBack
void setTryCountBeforeSwitchBack(int tryCountBeforeSwitchback) - Parameters:
tryCountBeforeSwitchback-
-
getTryCountBeforeSwitchBack
int getTryCountBeforeSwitchBack()- Returns:
- decrease
-
cacheChannelParameters
void cacheChannelParameters()Cache current channel parameters like round trip time and packet loss -
getCachedPacketLoss
int getCachedPacketLoss()- Returns:
- cached packet loss
-
getCachedRttMeasurement
int getCachedRttMeasurement()- Returns:
- cache rtt measurement
-
getForceStreamHeight
- Returns:
- stream resolution forced value If it's automatic, it returns 0
-
forceStreamQuality
- Parameters:
streamHeight- the resolution height to be forced to sendsubtrackId- the subtrack id to be forced to send. If it's null or empty, it just replaces main streamId- Returns:
- true if it's successful, false if it's not changed
-
getClientInfo
String getClientInfo()- Returns:
- free text client info
-
removeTracksOnTheFly
Remove a track- Parameters:
trackId-
-
getWebRTCMuxer
Get the muxer- Parameters:
trackId-- Returns:
- the muxer belongs to the trackId
-
notifyWebRTCClientAboutChangeInResolution
Client stream resolution change notification- Parameters:
streamHeight-streamId- is may be the main streamId or subtrackId
-
getStreamId
String getStreamId()Getter for stream Id- Returns:
-
getRemoteIpAddress
String getRemoteIpAddress()Getter for remote ip address- Returns:
-