# StreamBaseClient

abstract class StreamBaseClient

Created by pedro on 12/10/23.

Provide access to rtmp/rtsp/srt client methods that is expected to be used. This way we can hide method that should be handled only by the library.

#### Inheritors

GenericStreamClient
RtmpStreamClient
RtspStreamClient
SrtStreamClient
UdpStreamClient

## Constructors

StreamBaseClient
Link copied to clipboard
constructor()

## Functions

clearCache
Link copied to clipboard
abstract fun clearCache()
getBitrateExponentialFactor
Link copied to clipboard
abstract fun getBitrateExponentialFactor(): Float

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

getBytesSend
Link copied to clipboard
abstract fun getBytesSend(): Long
getCacheSize
Link copied to clipboard
abstract fun getCacheSize(): Int
getDroppedAudioFrames
Link copied to clipboard
abstract fun getDroppedAudioFrames(): Long
getDroppedVideoFrames
Link copied to clipboard
abstract fun getDroppedVideoFrames(): Long
getItemsInCache
Link copied to clipboard
abstract fun getItemsInCache(): Int
getSentAudioFrames
Link copied to clipboard
abstract fun getSentAudioFrames(): Long
getSentVideoFrames
Link copied to clipboard
abstract fun getSentVideoFrames(): Long
hasCongestion
Link copied to clipboard
fun hasCongestion(): Boolean
abstract fun hasCongestion(percentUsed: Float): Boolean
resetBytesSend
Link copied to clipboard
abstract fun resetBytesSend()
resetDroppedAudioFrames
Link copied to clipboard
abstract fun resetDroppedAudioFrames()
resetDroppedVideoFrames
Link copied to clipboard
abstract fun resetDroppedVideoFrames()
resetSentAudioFrames
Link copied to clipboard
abstract fun resetSentAudioFrames()
resetSentVideoFrames
Link copied to clipboard
abstract fun resetSentVideoFrames()
resizeCache
Link copied to clipboard
abstract fun resizeCache(newSize: Int)
reTry
Link copied to clipboard
fun reTry(delay: Long, reason: String): Boolean
abstract fun reTry(delay: Long, reason: String, backupUrl: String? = null): Boolean

Retries to connect with the given delay. You can pass an optional backupUrl if you'd like to connect to your backup server instead of the original one. Given backupUrl replaces the original one.

setAuthorization
Link copied to clipboard
abstract fun setAuthorization(user: String?, password: String?)
setBitrateExponentialFactor
Link copied to clipboard
abstract fun setBitrateExponentialFactor(factor: Float)
setCheckServerAlive
Link copied to clipboard
abstract fun setCheckServerAlive(enabled: Boolean)
setDelay
Link copied to clipboard
abstract fun setDelay(millis: Long)

Set stream delay in millis. This will create a cache and wait the delay to start send packets in real time

setLogs
Link copied to clipboard
abstract fun setLogs(enabled: Boolean)
setOnlyAudio
Link copied to clipboard
abstract fun setOnlyAudio(onlyAudio: Boolean)
setOnlyVideo
Link copied to clipboard
abstract fun setOnlyVideo(onlyVideo: Boolean)
setReTries
Link copied to clipboard
abstract fun setReTries(reTries: Int)
setSocketTimeout
Link copied to clipboard
abstract fun setSocketTimeout(timeout: Long)

Set timeout ms for connection, write and read in sockets by default 5000ms

setSocketType
Link copied to clipboard
abstract fun setSocketType(type: SocketType)

Set if you want use java.io or ktor socket