# SrtClient

class SrtClient(connectChecker: ConnectChecker)

Created by pedro on 20/8/23.

## Constructors

SrtClient
Link copied to clipboard
constructor(connectChecker: ConnectChecker)

## Properties

bytesSend
Link copied to clipboard
val bytesSend: Long
cacheSize
Link copied to clipboard
val cacheSize: Int
droppedAudioFrames
Link copied to clipboard
val droppedAudioFrames: Long
droppedVideoFrames
Link copied to clipboard
val droppedVideoFrames: Long
isStreaming
Link copied to clipboard
@Volatile
var isStreaming: Boolean
packetsLost
Link copied to clipboard
var packetsLost: Int
rtt
Link copied to clipboard
var rtt: Int
sentAudioFrames
Link copied to clipboard
val sentAudioFrames: Long
sentVideoFrames
Link copied to clipboard
val sentVideoFrames: Long
socketTimeout
Link copied to clipboard
var socketTimeout: Long
socketType
Link copied to clipboard
var socketType: SocketType

## Functions

clearCache
Link copied to clipboard
fun clearCache()
connect
Link copied to clipboard
@JvmOverloads
fun connect(url: String?, isRetry: Boolean = false)
disconnect
Link copied to clipboard
fun disconnect()
getBitrateExponentialFactor
Link copied to clipboard
fun getBitrateExponentialFactor(): Float

Get the exponential factor used to calculate the bitrate. Default 1f

getItemsInCache
Link copied to clipboard
fun getItemsInCache(): Int
hasCongestion
Link copied to clipboard
fun hasCongestion(): Boolean
fun hasCongestion(percentUsed: Float): Boolean
reConnect
Link copied to clipboard
fun reConnect(delay: Long)
fun reConnect(delay: Long, backupUrl: String?)
resetBytesSend
Link copied to clipboard
fun resetBytesSend()
resetDroppedAudioFrames
Link copied to clipboard
fun resetDroppedAudioFrames()
resetDroppedVideoFrames
Link copied to clipboard
fun resetDroppedVideoFrames()
resetSentAudioFrames
Link copied to clipboard
fun resetSentAudioFrames()
resetSentVideoFrames
Link copied to clipboard
fun resetSentVideoFrames()
resizeCache
Link copied to clipboard
fun resizeCache(newSize: Int)
sendAudio
Link copied to clipboard
fun sendAudio(audioBuffer: ByteBuffer, info: MediaCodec.BufferInfo)
sendVideo
Link copied to clipboard
fun sendVideo(videoBuffer: ByteBuffer, info: MediaCodec.BufferInfo)
setAudioCodec
Link copied to clipboard
fun setAudioCodec(audioCodec: AudioCodec)
setAudioInfo
Link copied to clipboard
fun setAudioInfo(sampleRate: Int, isStereo: Boolean)
setBitrateExponentialFactor
Link copied to clipboard
fun setBitrateExponentialFactor(factor: Float)
setCheckServerAlive
Link copied to clipboard
fun setCheckServerAlive(enabled: Boolean)

Check periodically if server is alive using Echo protocol.

setDelay
Link copied to clipboard
fun setDelay(millis: Long)
setLatency
Link copied to clipboard
fun setLatency(latency: Int)
setLogs
Link copied to clipboard
fun setLogs(enable: Boolean)
setMpeg2TsService
Link copied to clipboard
fun setMpeg2TsService(customService: Mpeg2TsService)

Set a custom Mpeg2TsService with specified parameters Must be called before connect

setOnlyAudio
Link copied to clipboard
fun setOnlyAudio(onlyAudio: Boolean)

Must be called before connect

setOnlyVideo
Link copied to clipboard
fun setOnlyVideo(onlyVideo: Boolean)

Must be called before connect

setPassphrase
Link copied to clipboard
fun setPassphrase(passphrase: String, type: EncryptionType)

Set passphrase for encrypt. Use empty value to disable it.

setReTries
Link copied to clipboard
fun setReTries(reTries: Int)
setVideoCodec
Link copied to clipboard
fun setVideoCodec(videoCodec: VideoCodec)
setVideoInfo
Link copied to clipboard
fun setVideoInfo(sps: ByteBuffer, pps: ByteBuffer?, vps: ByteBuffer?)
shouldRetry
Link copied to clipboard
fun shouldRetry(reason: String): Boolean