Skip to content

Commit

Permalink
update gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroSG94 committed May 16, 2022
1 parent 70b9d56 commit ac76795
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
```
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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'
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions rtspserver/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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'
}
7 changes: 4 additions & 3 deletions rtspserver/src/main/java/com/pedro/rtspserver/ServerClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
}

Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ac76795

Please sign in to comment.