diff --git a/library/src/main/java/com/pedro/library/util/streamclient/RtmpStreamClient.kt b/library/src/main/java/com/pedro/library/util/streamclient/RtmpStreamClient.kt index 0cb472252..e8560a567 100644 --- a/library/src/main/java/com/pedro/library/util/streamclient/RtmpStreamClient.kt +++ b/library/src/main/java/com/pedro/library/util/streamclient/RtmpStreamClient.kt @@ -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 @@ -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) + } } \ No newline at end of file diff --git a/library/src/main/java/com/pedro/library/util/streamclient/RtspStreamClient.kt b/library/src/main/java/com/pedro/library/util/streamclient/RtspStreamClient.kt index ea2f50269..8f5bed133 100644 --- a/library/src/main/java/com/pedro/library/util/streamclient/RtspStreamClient.kt +++ b/library/src/main/java/com/pedro/library/util/streamclient/RtspStreamClient.kt @@ -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 @@ -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) + } } \ No newline at end of file diff --git a/library/src/main/java/com/pedro/library/util/streamclient/SrtStreamClient.kt b/library/src/main/java/com/pedro/library/util/streamclient/SrtStreamClient.kt index 146c70093..4f74f043b 100644 --- a/library/src/main/java/com/pedro/library/util/streamclient/SrtStreamClient.kt +++ b/library/src/main/java/com/pedro/library/util/streamclient/SrtStreamClient.kt @@ -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 @@ -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) + } } \ No newline at end of file diff --git a/library/src/main/java/com/pedro/library/util/streamclient/StreamBaseClient.kt b/library/src/main/java/com/pedro/library/util/streamclient/StreamBaseClient.kt index 9c7ef0642..27c46c428 100644 --- a/library/src/main/java/com/pedro/library/util/streamclient/StreamBaseClient.kt +++ b/library/src/main/java/com/pedro/library/util/streamclient/StreamBaseClient.kt @@ -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 @@ -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) } \ No newline at end of file diff --git a/rtmp/src/main/java/com/pedro/rtmp/rtmp/RtmpClient.kt b/rtmp/src/main/java/com/pedro/rtmp/rtmp/RtmpClient.kt index f3e6ee73c..750261cab 100644 --- a/rtmp/src/main/java/com/pedro/rtmp/rtmp/RtmpClient.kt +++ b/rtmp/src/main/java/com/pedro/rtmp/rtmp/RtmpClient.kt @@ -576,4 +576,6 @@ class RtmpClient(private val connectCheckerRtmp: ConnectCheckerRtmp) { fun clearCache() { rtmpSender.clearCache() } + + fun getItemsInCache(): Int = rtmpSender.getItemsInCache() } diff --git a/rtmp/src/main/java/com/pedro/rtmp/rtmp/RtmpSender.kt b/rtmp/src/main/java/com/pedro/rtmp/rtmp/RtmpSender.kt index 0dae3c8e7..699e5bec9 100644 --- a/rtmp/src/main/java/com/pedro/rtmp/rtmp/RtmpSender.kt +++ b/rtmp/src/main/java/com/pedro/rtmp/rtmp/RtmpSender.kt @@ -217,6 +217,8 @@ class RtmpSender( return cacheSize } + fun getItemsInCache(): Int = queue.size + fun clearCache() { queue.clear() } diff --git a/rtsp/src/main/java/com/pedro/rtsp/rtsp/RtspClient.kt b/rtsp/src/main/java/com/pedro/rtsp/rtsp/RtspClient.kt index bca46f8ba..1b8b67f9d 100644 --- a/rtsp/src/main/java/com/pedro/rtsp/rtsp/RtspClient.kt +++ b/rtsp/src/main/java/com/pedro/rtsp/rtsp/RtspClient.kt @@ -468,4 +468,6 @@ class RtspClient(private val connectCheckerRtsp: ConnectCheckerRtsp) { fun clearCache() { rtspSender.clearCache() } + + fun getItemsInCache(): Int = rtspSender.getItemsInCache() } \ No newline at end of file diff --git a/rtsp/src/main/java/com/pedro/rtsp/rtsp/RtspSender.kt b/rtsp/src/main/java/com/pedro/rtsp/rtsp/RtspSender.kt index ac090094f..42802472a 100644 --- a/rtsp/src/main/java/com/pedro/rtsp/rtsp/RtspSender.kt +++ b/rtsp/src/main/java/com/pedro/rtsp/rtsp/RtspSender.kt @@ -220,6 +220,8 @@ class RtspSender(private val connectCheckerRtsp: ConnectCheckerRtsp) { return cacheSize } + fun getItemsInCache(): Int = queue.size + fun clearCache() { queue.clear() } diff --git a/srt/src/main/java/com/pedro/srt/srt/SrtClient.kt b/srt/src/main/java/com/pedro/srt/srt/SrtClient.kt index a6a498213..e408dd4d9 100644 --- a/srt/src/main/java/com/pedro/srt/srt/SrtClient.kt +++ b/srt/src/main/java/com/pedro/srt/srt/SrtClient.kt @@ -392,4 +392,6 @@ class SrtClient(private val connectCheckerSrt: ConnectCheckerSrt) { fun clearCache() { srtSender.clearCache() } + + fun getItemsInCache(): Int = srtSender.getItemsInCache() } \ No newline at end of file diff --git a/srt/src/main/java/com/pedro/srt/srt/SrtSender.kt b/srt/src/main/java/com/pedro/srt/srt/SrtSender.kt index 30cee9804..5a553bfc3 100644 --- a/srt/src/main/java/com/pedro/srt/srt/SrtSender.kt +++ b/srt/src/main/java/com/pedro/srt/srt/SrtSender.kt @@ -251,6 +251,8 @@ class SrtSender( return cacheSize } + fun getItemsInCache(): Int = queue.size + fun clearCache() { queue.clear() }