Skip to content

Commit

Permalink
version 1.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroSG94 committed Oct 28, 2024
1 parent a95bab6 commit 119e829
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 24 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.3.2'
implementation 'com.github.pedroSG94.RootEncoder:library:2.5.3'
implementation 'com.github.pedroSG94:RTSP-Server:1.3.3'
implementation 'com.github.pedroSG94.RootEncoder:library:2.5.4'
}
```
7 changes: 0 additions & 7 deletions app/src/main/java/com/pedro/sample/CameraDemoActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@ package com.pedro.sample
import android.graphics.SurfaceTexture
import android.os.Build
import android.os.Bundle
import android.os.Environment
import android.util.Log
import android.view.TextureView
import android.view.View
import android.view.WindowManager
import android.widget.Button
import android.widget.ImageView
import android.widget.TextView
import android.widget.Toast
Expand All @@ -21,8 +17,6 @@ import com.pedro.library.view.AutoFitTextureView
import com.pedro.rtspserver.RtspServerCamera1
import com.pedro.rtspserver.server.ClientListener
import com.pedro.rtspserver.server.ServerClient
import java.io.File
import java.io.IOException
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
Expand Down Expand Up @@ -122,7 +116,6 @@ class CameraDemoActivity : AppCompatActivity(), ConnectChecker, ClientListener,
}

override fun onConnectionFailed(reason: String) {
Log.e("Pedro", "failed: $reason")
toast("Failed: $reason")
rtspServerCamera1.stopStream()
if (!rtspServerCamera1.isRecording) ScreenOrientation.unlockScreen(this)
Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
libraryGroup = "com.github.pedroSG94"
versionCode = "132"
versionName = "1.3.2"
versionCode = "133"
versionName = "1.3.3"

#plugins versions
agp = "8.6.1"
Expand All @@ -14,7 +14,7 @@ appcompat = "1.6.1"
constraintlayout = "2.1.4"
coroutines = "1.9.0"
ktor = "3.0.0"
rootEncoder = "2.5.3"
rootEncoder = "2.5.4"

[libraries]
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.cancelAndJoin
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import java.io.IOException
import java.lang.RuntimeException
import java.net.NetworkInterface
import java.net.SocketException
import java.nio.ByteBuffer
import java.util.concurrent.Semaphore
import java.util.concurrent.TimeUnit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,25 @@ class ServerClient(
rtspSender.setAudioInfo(serverCommandManager.sampleRate, serverCommandManager.isStereo)
}

val videoPorts = if (!serverCommandManager.videoDisabled) {
serverCommandManager.videoPorts.toTypedArray()
} else arrayOf<Int?>(null, null)
val videoServerPorts = if (!serverCommandManager.videoDisabled) {
serverCommandManager.videoServerPorts
} else arrayOf<Int?>(null, null)
val audioPorts = if (!serverCommandManager.audioDisabled) {
serverCommandManager.audioPorts.toTypedArray()
} else arrayOf<Int?>(null, null)
val audioServerPorts = if (!serverCommandManager.audioDisabled) {
serverCommandManager.audioServerPorts
} else arrayOf<Int?>(null, null)

rtspSender.setSocketsInfo(
serverCommandManager.protocol,
socket.getHost(),
serverCommandManager.videoServerPorts,
serverCommandManager.audioServerPorts,
serverCommandManager.videoPorts.toIntArray(),
serverCommandManager.audioPorts.toIntArray(),
videoServerPorts,
audioServerPorts,
videoPorts, audioPorts
)
rtspSender.setSocket(socket)
rtspSender.start()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ import com.pedro.rtsp.rtsp.commands.CommandsManager
import com.pedro.rtsp.rtsp.commands.Method
import com.pedro.rtsp.rtsp.commands.SdpBody
import com.pedro.rtsp.utils.RtpConstants
import com.pedro.rtsp.utils.encodeToString
import com.pedro.rtsp.utils.getData
import java.io.BufferedReader
import java.io.IOException
import java.net.SocketException
import java.util.regex.Pattern
Expand All @@ -31,8 +28,8 @@ class ServerCommandManager: CommandsManager() {
private var serverPort: Int = 0

private val TAG = "ServerCommandManager"
var audioPorts = ArrayList<Int>()
var videoPorts = ArrayList<Int>()
var audioPorts = ArrayList<Int?>()
var videoPorts = ArrayList<Int?>()

fun setServerInfo(serverIp: String, serverPort: Int) {
this.serverIp = serverIp
Expand Down

0 comments on commit 119e829

Please sign in to comment.