From ac76795bc27d985d5f4022102239eaa692a12eb8 Mon Sep 17 00:00:00 2001 From: pedroSG94 Date: Mon, 16 May 2022 17:34:17 +0200 Subject: [PATCH] update gradle --- README.md | 4 ++-- app/build.gradle | 6 +++--- build.gradle | 8 ++++---- rtspserver/build.gradle | 6 +++--- .../src/main/java/com/pedro/rtspserver/ServerClient.kt | 7 ++++--- .../java/com/pedro/rtspserver/ServerCommandManager.kt | 2 +- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 20c0b8b..64c3385 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ allprojects { } } dependencies { - implementation 'com.github.pedroSG94:RTSP-Server:1.1.7' - implementation 'com.github.pedroSG94.rtmp-rtsp-stream-client-java:rtplibrary:2.1.7' + implementation 'com.github.pedroSG94:RTSP-Server:1.1.8' + implementation 'com.github.pedroSG94.rtmp-rtsp-stream-client-java:rtplibrary:2.1.8' } ``` diff --git a/app/build.gradle b/app/build.gradle index 78bdad5..5684632 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,12 +3,12 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { - compileSdkVersion 31 + compileSdkVersion 32 defaultConfig { applicationId "com.pedro.sample" minSdkVersion 16 - targetSdkVersion 31 + targetSdkVersion 32 versionCode version_code versionName version_name } @@ -22,7 +22,7 @@ android { dependencies { implementation project(':rtspserver') - implementation 'com.github.pedroSG94.rtmp-rtsp-stream-client-java:rtplibrary:2.1.7' + implementation 'com.github.pedroSG94.rtmp-rtsp-stream-client-java:rtplibrary:2.1.8' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.4.1' implementation 'androidx.constraintlayout:constraintlayout:2.1.3' diff --git a/build.gradle b/build.gradle index 135dce5..74f9ec2 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,10 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.6.21' ext.library_group = "com.github.pedroSG94" - ext.version_code = 117 - ext.version_name = "1.1.7" + ext.version_code = 118 + ext.version_name = "1.1.8" repositories { google() @@ -13,7 +13,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.1.1' + classpath 'com.android.tools.build:gradle:7.1.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/rtspserver/build.gradle b/rtspserver/build.gradle index 40699d7..82acbe7 100644 --- a/rtspserver/build.gradle +++ b/rtspserver/build.gradle @@ -3,11 +3,11 @@ apply plugin: 'kotlin-android' apply plugin: 'maven-publish' android { - compileSdkVersion 31 + compileSdkVersion 32 defaultConfig { minSdkVersion 16 - targetSdkVersion 31 + targetSdkVersion 32 versionCode version_code versionName version_name } @@ -43,5 +43,5 @@ afterEvaluate { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - implementation 'com.github.pedroSG94.rtmp-rtsp-stream-client-java:rtplibrary:2.1.7' + implementation 'com.github.pedroSG94.rtmp-rtsp-stream-client-java:rtplibrary:2.1.8' } diff --git a/rtspserver/src/main/java/com/pedro/rtspserver/ServerClient.kt b/rtspserver/src/main/java/com/pedro/rtspserver/ServerClient.kt index 40e64b1..d0b290a 100644 --- a/rtspserver/src/main/java/com/pedro/rtspserver/ServerClient.kt +++ b/rtspserver/src/main/java/com/pedro/rtspserver/ServerClient.kt @@ -20,7 +20,6 @@ open class ServerClient(private val socket: Socket, serverIp: String, serverPort private val listener: ClientListener) : Thread() { private val TAG = "Client" - private var cSeq = 0 private val output = BufferedWriter(OutputStreamWriter(socket.getOutputStream())) private val input = BufferedReader(InputStreamReader(socket.getInputStream())) val rtspSender = RtspSender(connectCheckerRtsp) @@ -32,7 +31,9 @@ open class ServerClient(private val socket: Socket, serverIp: String, serverPort commandsManager.audioDisabled = audioDisabled commandsManager.isStereo = isStereo commandsManager.sampleRate = sampleRate - commandsManager.setVideoInfo(sps, pps, vps) + if (!commandsManager.videoDisabled) { + commandsManager.setVideoInfo(sps!!, pps!!, vps) + } commandsManager.setAuth(user, password) } @@ -42,7 +43,7 @@ open class ServerClient(private val socket: Socket, serverIp: String, serverPort while (!interrupted()) { try { val request = commandsManager.getRequest(input) - cSeq = request.cSeq //update cSeq + val cSeq = request.cSeq //update cSeq if (cSeq == -1) { //If cSeq parsed fail send error to client output.write(commandsManager.createError(500, cSeq)) output.flush() diff --git a/rtspserver/src/main/java/com/pedro/rtspserver/ServerCommandManager.kt b/rtspserver/src/main/java/com/pedro/rtspserver/ServerCommandManager.kt index c7eb386..bb0cea2 100644 --- a/rtspserver/src/main/java/com/pedro/rtspserver/ServerCommandManager.kt +++ b/rtspserver/src/main/java/com/pedro/rtspserver/ServerCommandManager.kt @@ -175,7 +175,7 @@ open class ServerCommandManager(private val serverIp: String, private val server return "v=0\r\no=- 0 0 IN IP4 $serverIp\r\ns=Unnamed\r\ni=N/A\r\nc=IN IP4 $clientIp\r\nt=0 0\r\na=recvonly\r\n$videoBody$audioBody\r\n" } - private fun createSetup(track: Int, cSeq: Int): String { + private fun createSetup(cSeq: Int, track: Int): String { val protocolSetup = if (protocol == Protocol.UDP) { val clientPorts = if (track == RtpConstants.trackAudio) audioPorts else videoPorts val serverPorts = if (track == RtpConstants.trackAudio) audioServerPorts else videoServerPorts