Package io.antmedia.webrtc.api
Interface IWebRTCClient
public interface IWebRTCClient
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addIceCandidate
(IceCandidate iceCandidate) void
addWebRTCMuxer
(IWebRTCMuxer webRTCMuxer) void
Cache current channel parameters like round trip time and packet lossboolean
forceStreamQuality
(int streamHeight, String subtrackId) float
Return the period of send audio period in millisecondsint
int
int
Number of consecutive calls of increaseExcessiveBandwidthCountint
getForceStreamHeight
(String streamId) int
Returns the packetloss rateGetter for remote ip addressint
Return the round trip time measurementlong
long
Getter for stream Idint
long
Returns the time in milliseconds between the time when start function is called and the time when streaming is startedlong
Returns the time in milliseconds between the time when stop function is called and the time when streaming is fully stoppedint
float
Return the period of send video period in millisecondsgetWebRTCMuxer
(String trackId) Get the muxervoid
It's called when there is excessive bandwidth than the current onevoid
notifyWebRTCClientAboutChangeInResolution
(int streamHeight, String streamId) Client stream resolution change notificationvoid
removeTracksOnTheFly
(String trackId) Remove a trackvoid
removeWebRTCMuxer
(IWebRTCMuxer webRTCMuxer) void
Reset the excessive bandwidth countvoid
sendAudioPacket
(ByteBuffer audioPacket, long timestamp, String trackId) Send audio packet to connected clientvoid
sendVideoPacket
(ByteBuffer videoPacket, boolean isKeyFrame, long timestamp, int frameRotation, List<NaluIndex> naluIndices, String trackId) Send video packet to connected clientvoid
void
setTryCountBeforeSwitchBack
(int tryCountBeforeSwitchback) void
setVideoResolution
(int width, int height) void
setWebRTCAdaptor
(IWebRTCAdaptor webRTCAdaptor) void
start()
void
stop()
-
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:
-