From ae097dee39703f02d908dc73f34041daec3577c5 Mon Sep 17 00:00:00 2001 From: Alexey Vasilyev Date: Sun, 10 Nov 2024 21:36:08 +0200 Subject: [PATCH] Added modification SPS frame w/ low latency params --- app/build.gradle | 22 ++- .../alexvas/rtsp/demo/live/LiveFragment.kt | 4 + app/src/main/res/layout/fragment_live.xml | 8 + build.gradle | 6 +- gradle.properties | 1 - library-client-rtsp/build.gradle | 5 +- .../java/com/alexvas/rtsp/RtspClient.java | 4 +- .../com/alexvas/rtsp/widget/RtspProcessor.kt | 159 +++++++++++++++--- .../alexvas/rtsp/widget/RtspSurfaceView.kt | 4 + .../java/com/alexvas/utils/VideoCodecUtils.kt | 3 + 10 files changed, 179 insertions(+), 37 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 10df154..08c2b45 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -41,16 +41,20 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.7.0' - implementation 'androidx.core:core-ktx:1.13.1' + implementation 'androidx.core:core-ktx:1.15.0' implementation 'com.google.android.material:material:1.12.0' - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation 'androidx.constraintlayout:constraintlayout:2.2.0' implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' - def androidXNavigationVersion = '2.8.2' - implementation "androidx.navigation:navigation-fragment-ktx:$androidXNavigationVersion" - implementation "androidx.navigation:navigation-ui-ktx:$androidXNavigationVersion" - implementation "androidx.navigation:navigation-fragment-ktx:$androidXNavigationVersion" - implementation "androidx.navigation:navigation-ui-ktx:$androidXNavigationVersion" - api 'com.github.AppDevNext.Logcat:LogcatCoreLib:3.2' - api 'com.github.AppDevNext.Logcat:LogcatCoreUI:3.2' + + def androidx_navigation_version = '2.8.3' + implementation "androidx.navigation:navigation-fragment-ktx:$androidx_navigation_version" + implementation "androidx.navigation:navigation-ui-ktx:$androidx_navigation_version" + implementation "androidx.navigation:navigation-fragment-ktx:$androidx_navigation_version" + implementation "androidx.navigation:navigation-ui-ktx:$androidx_navigation_version" + + def logcat_core_version = '3.3.1' + api "com.github.AppDevNext.Logcat:LogcatCoreLib:$logcat_core_version" + api "com.github.AppDevNext.Logcat:LogcatCoreUI:$logcat_core_version" + implementation project(':library-client-rtsp') } 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 8a87e66..61c49cf 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 @@ -242,6 +242,10 @@ class LiveFragment : Fragment() { binding.llRtspParams.etRtspPassword.setText(it) } + binding.cbExperimentalRewriteSps.setOnCheckedChangeListener { _, isChecked -> + binding.svVideoSurface.experimentalUpdateSpsFrameWithLowLatencyParams = isChecked + } + binding.bnRotate0.setOnClickListener { binding.svVideoSurface.videoRotation = 0 binding.ivVideoImage.videoRotation = 0 diff --git a/app/src/main/res/layout/fragment_live.xml b/app/src/main/res/layout/fragment_live.xml index 4561cca..ea22a49 100644 --- a/app/src/main/res/layout/fragment_live.xml +++ b/app/src/main/res/layout/fragment_live.xml @@ -17,6 +17,14 @@ android:id="@+id/llRtspParams" layout="@layout/layout_rtsp_params"/> + +