# GenericStreamClient

class GenericStreamClient(rtmpClient: RtmpStreamClient, rtspClient: RtspStreamClient, srtClient: SrtStreamClient, udpClient: UdpStreamClient) : StreamBaseClient

Created by pedro on 12/10/23.

## Constructors

GenericStreamClient
Link copied to clipboard
constructor(rtmpClient: RtmpStreamClient, rtspClient: RtspStreamClient, srtClient: SrtStreamClient, udpClient: UdpStreamClient)

## Functions

addCertificates
Link copied to clipboard
fun addCertificates(certificates: TrustManager?)

Add certificates for TLS connection

clearCache
Link copied to clipboard
open override fun clearCache()
connecting
Link copied to clipboard
fun connecting(url: String)
forceIncrementalTs
Link copied to clipboard
fun forceIncrementalTs(enabled: Boolean)

Some Livestream hosts use Akamai auth that requires RTMP packets to be sent with increasing timestamp order regardless of packet type. Necessary with Servers like Dacast. More info here: https://learn.akamai.com/en-us/webhelp/media-services-live/media-services-live-encoder-compatibility-testing-and-qualification-guide-v4.0/GUID-F941C88B-9128-4BF4-A81B-C2E5CFD35BBF.html

getBitrateExponentialFactor
Link copied to clipboard
open override fun getBitrateExponentialFactor(): Float

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

getBytesSend
Link copied to clipboard
open override fun getBytesSend(): Long
getCacheSize
Link copied to clipboard
open override fun getCacheSize(): Int
getDroppedAudioFrames
Link copied to clipboard
open override fun getDroppedAudioFrames(): Long
getDroppedVideoFrames
Link copied to clipboard
open override fun getDroppedVideoFrames(): Long
getItemsInCache
Link copied to clipboard
open override fun getItemsInCache(): Int
getSentAudioFrames
Link copied to clipboard
open override fun getSentAudioFrames(): Long
getSentVideoFrames
Link copied to clipboard
open override fun getSentVideoFrames(): Long
hasCongestion
Link copied to clipboard
open override fun hasCongestion(percentUsed: Float): Boolean
fun hasCongestion(): Boolean
resetBytesSend
Link copied to clipboard
open override fun resetBytesSend()
resetDroppedAudioFrames
Link copied to clipboard
open override fun resetDroppedAudioFrames()
resetDroppedVideoFrames
Link copied to clipboard
open override fun resetDroppedVideoFrames()
resetSentAudioFrames
Link copied to clipboard
open override fun resetSentAudioFrames()
resetSentVideoFrames
Link copied to clipboard
open override fun resetSentVideoFrames()
resizeCache
Link copied to clipboard
open override fun resizeCache(newSize: Int)
reTry
Link copied to clipboard
open override fun reTry(delay: Long, reason: String, backupUrl: String?): 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.

fun reTry(delay: Long, reason: String): Boolean
setAuthorization
Link copied to clipboard
open override fun setAuthorization(user: String?, password: String?)
setBitrateExponentialFactor
Link copied to clipboard
open override fun setBitrateExponentialFactor(factor: Float)
setCheckServerAlive
Link copied to clipboard
open override fun setCheckServerAlive(enabled: Boolean)
setDelay
Link copied to clipboard
open override 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

setFlashVersion
Link copied to clipboard
fun setFlashVersion(flashVersion: String)

Must be called before start stream or will be ignored.

setLogs
Link copied to clipboard
open override fun setLogs(enabled: Boolean)
setOnlyAudio
Link copied to clipboard
open override fun setOnlyAudio(onlyAudio: Boolean)
setOnlyVideo
Link copied to clipboard
open override fun setOnlyVideo(onlyVideo: Boolean)
setPassphrase
Link copied to clipboard
fun setPassphrase(passphrase: String, type: EncryptionType)

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

setProtocol
Link copied to clipboard
fun setProtocol(protocol: Protocol)

Internet protocol used.

setReTries
Link copied to clipboard
open override fun setReTries(reTries: Int)
setSocketTimeout
Link copied to clipboard
open override fun setSocketTimeout(timeout: Long)

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

setSocketType
Link copied to clipboard
open override fun setSocketType(type: SocketType)

Set if you want use java.io or ktor socket

setWriteChunkSize
Link copied to clipboard
fun setWriteChunkSize(chunkSize: Int)

Must be called before start stream or will be ignored.