Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add getItemsInCache and expose setOnlyAudio/setOnlyVideo #1308

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ class RtmpStreamClient(

override fun getCacheSize(): Int = rtmpClient.cacheSize

override fun getItemsInCache(): Int = rtmpClient.getItemsInCache()

override fun getSentAudioFrames(): Long = rtmpClient.sentAudioFrames

override fun getSentVideoFrames(): Long = rtmpClient.sentVideoFrames
Expand All @@ -102,4 +104,12 @@ class RtmpStreamClient(
override fun resetDroppedVideoFrames() {
rtmpClient.resetDroppedVideoFrames()
}

override fun setOnlyAudio(onlyAudio: Boolean) {
rtmpClient.setOnlyAudio(onlyAudio)
}

override fun setOnlyVideo(onlyVideo: Boolean) {
rtmpClient.setOnlyVideo(onlyVideo)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ class RtspStreamClient(

override fun getCacheSize(): Int = rtspClient.cacheSize

override fun getItemsInCache(): Int = rtspClient.getItemsInCache()

override fun getSentAudioFrames(): Long = rtspClient.sentAudioFrames

override fun getSentVideoFrames(): Long = rtspClient.sentVideoFrames
Expand All @@ -78,4 +80,12 @@ class RtspStreamClient(
override fun resetDroppedVideoFrames() {
rtspClient.resetDroppedVideoFrames()
}

override fun setOnlyAudio(onlyAudio: Boolean) {
rtspClient.setOnlyAudio(onlyAudio)
}

override fun setOnlyVideo(onlyVideo: Boolean) {
rtspClient.setOnlyVideo(onlyVideo)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class SrtStreamClient(

override fun getCacheSize(): Int = srtClient.cacheSize

override fun getItemsInCache(): Int = srtClient.getItemsInCache()

override fun getSentAudioFrames(): Long = srtClient.sentAudioFrames

override fun getSentVideoFrames(): Long = srtClient.sentVideoFrames
Expand All @@ -67,4 +69,12 @@ class SrtStreamClient(
override fun resetDroppedVideoFrames() {
srtClient.resetDroppedVideoFrames()
}

override fun setOnlyAudio(onlyAudio: Boolean) {
srtClient.setOnlyAudio(onlyAudio)
}

override fun setOnlyVideo(onlyVideo: Boolean) {
srtClient.setOnlyVideo(onlyVideo)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ abstract class StreamBaseClient(
abstract fun resizeCache(newSize: Int)
abstract fun clearCache()
abstract fun getCacheSize(): Int
abstract fun getItemsInCache(): Int
abstract fun getSentAudioFrames(): Long
abstract fun getSentVideoFrames(): Long
abstract fun getDroppedAudioFrames(): Long
Expand All @@ -50,4 +51,6 @@ abstract class StreamBaseClient(
abstract fun resetSentVideoFrames()
abstract fun resetDroppedAudioFrames()
abstract fun resetDroppedVideoFrames()
abstract fun setOnlyAudio(onlyAudio: Boolean)
abstract fun setOnlyVideo(onlyVideo: Boolean)
}
2 changes: 2 additions & 0 deletions rtmp/src/main/java/com/pedro/rtmp/rtmp/RtmpClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -576,4 +576,6 @@ class RtmpClient(private val connectCheckerRtmp: ConnectCheckerRtmp) {
fun clearCache() {
rtmpSender.clearCache()
}

fun getItemsInCache(): Int = rtmpSender.getItemsInCache()
}
2 changes: 2 additions & 0 deletions rtmp/src/main/java/com/pedro/rtmp/rtmp/RtmpSender.kt
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ class RtmpSender(
return cacheSize
}

fun getItemsInCache(): Int = queue.size

fun clearCache() {
queue.clear()
}
Expand Down
2 changes: 2 additions & 0 deletions rtsp/src/main/java/com/pedro/rtsp/rtsp/RtspClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -468,4 +468,6 @@ class RtspClient(private val connectCheckerRtsp: ConnectCheckerRtsp) {
fun clearCache() {
rtspSender.clearCache()
}

fun getItemsInCache(): Int = rtspSender.getItemsInCache()
}
2 changes: 2 additions & 0 deletions rtsp/src/main/java/com/pedro/rtsp/rtsp/RtspSender.kt
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ class RtspSender(private val connectCheckerRtsp: ConnectCheckerRtsp) {
return cacheSize
}

fun getItemsInCache(): Int = queue.size

fun clearCache() {
queue.clear()
}
Expand Down
2 changes: 2 additions & 0 deletions srt/src/main/java/com/pedro/srt/srt/SrtClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -392,4 +392,6 @@ class SrtClient(private val connectCheckerSrt: ConnectCheckerSrt) {
fun clearCache() {
srtSender.clearCache()
}

fun getItemsInCache(): Int = srtSender.getItemsInCache()
}
2 changes: 2 additions & 0 deletions srt/src/main/java/com/pedro/srt/srt/SrtSender.kt
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ class SrtSender(
return cacheSize
}

fun getItemsInCache(): Int = queue.size

fun clearCache() {
queue.clear()
}
Expand Down