From a948163614e09c5183de8c0e35e1f10ca73b8080 Mon Sep 17 00:00:00 2001 From: Alexey Vasilyev Date: Wed, 5 Jan 2022 11:55:51 +0200 Subject: [PATCH] Added Debug checkbox in live view --- .../com/alexvas/rtsp/demo/live/LiveFragment.kt | 3 +++ app/src/main/res/layout/fragment_live.xml | 15 ++++++++------- .../com/alexvas/rtsp/widget/RtspSurfaceView.kt | 4 +++- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/alexvas/rtsp/demo/live/LiveFragment.kt b/app/src/main/java/com/alexvas/rtsp/demo/live/LiveFragment.kt index dc5a3a4..c367eea 100644 --- a/app/src/main/java/com/alexvas/rtsp/demo/live/LiveFragment.kt +++ b/app/src/main/java/com/alexvas/rtsp/demo/live/LiveFragment.kt @@ -34,6 +34,7 @@ class LiveFragment : Fragment() { binding.etRtspPassword.isEnabled = false binding.cbVideo.isEnabled = false binding.cbAudio.isEnabled = false + binding.cbDebug.isEnabled = false } override fun onRtspStatusConnected() { @@ -50,6 +51,7 @@ class LiveFragment : Fragment() { binding.bnSnapshot.isEnabled = false binding.cbVideo.isEnabled = true binding.cbAudio.isEnabled = true + binding.cbDebug.isEnabled = true binding.etRtspRequest.isEnabled = true binding.etRtspUsername.isEnabled = true binding.etRtspPassword.isEnabled = true @@ -160,6 +162,7 @@ class LiveFragment : Fragment() { } else { val uri = Uri.parse(liveViewModel.rtspRequest.value) binding.svVideo.init(uri, liveViewModel.rtspUsername.value, liveViewModel.rtspPassword.value, "rtsp-client-android") + binding.svVideo.debug = binding.cbDebug.isChecked binding.svVideo.start(binding.cbVideo.isChecked, binding.cbAudio.isChecked) } } diff --git a/app/src/main/res/layout/fragment_live.xml b/app/src/main/res/layout/fragment_live.xml index 5d71f7f..7b8370f 100644 --- a/app/src/main/res/layout/fragment_live.xml +++ b/app/src/main/res/layout/fragment_live.xml @@ -65,17 +65,18 @@ - - - - - - - +