Skip to content

Commit

Permalink
Merge pull request #1434 from pedroSG94/refactor/remove-configfield
Browse files Browse the repository at this point in the history
remove configfield in rtsp
  • Loading branch information
pedroSG94 committed Mar 11, 2024
2 parents af5a73c + 1f2feda commit 38fc27f
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 10 deletions.
3 changes: 0 additions & 3 deletions rtsp/build.gradle.kts
@@ -1,5 +1,4 @@
val libraryGroup: String by rootProject.extra
val vCode: Int by rootProject.extra
val vName: String by rootProject.extra
val coroutinesVersion: String by rootProject.extra
val junitVersion: String by rootProject.extra
Expand All @@ -19,8 +18,6 @@ android {
defaultConfig {
minSdk = 16
lint.targetSdk = 34
buildConfigField("int", "VERSION_CODE", "$vCode")
buildConfigField("String", "VERSION_NAME", "\"${vName}\"")
}
buildTypes {
release {
Expand Down
Expand Up @@ -20,7 +20,6 @@ import android.util.Log
import com.pedro.common.AudioCodec
import com.pedro.common.TimeUtils
import com.pedro.common.VideoCodec
import com.pedro.rtsp.BuildConfig
import com.pedro.rtsp.rtsp.Protocol
import com.pedro.rtsp.rtsp.commands.SdpBody.createAV1Body
import com.pedro.rtsp.rtsp.commands.SdpBody.createAacBody
Expand Down Expand Up @@ -143,7 +142,6 @@ open class CommandsManager {

private fun addHeaders(): String {
return "CSeq: ${++cSeq}\r\n" +
"User-Agent: ${BuildConfig.LIBRARY_PACKAGE_NAME} ${BuildConfig.VERSION_NAME}\r\n" +
(if (sessionId == null) "" else "Session: $sessionId\r\n") +
(if (authorization == null) "" else "Authorization: $authorization\r\n")
}
Expand Down
2 changes: 0 additions & 2 deletions rtsp/src/test/java/com/pedro/rtsp/rtsp/CommandParserTest.kt
Expand Up @@ -16,7 +16,6 @@

package com.pedro.rtsp.rtsp

import com.pedro.rtsp.BuildConfig
import com.pedro.rtsp.rtsp.commands.Command
import com.pedro.rtsp.rtsp.commands.CommandParser
import com.pedro.rtsp.rtsp.commands.Method
Expand Down Expand Up @@ -105,7 +104,6 @@ class CommandParserTest {
fun `GIVEN pusher or player command string WHEN parse THEN get a command with cSeq and method`() {
val pusherCommand = "OPTIONS rtsp://192.168.1.132:554/live/pedro RTSP/1.0\r\n" +
"CSeq: 1\r\n" +
"User-Agent: ${BuildConfig.LIBRARY_PACKAGE_NAME} ${BuildConfig.VERSION_NAME}\r\n" +
"\r\n"
val command = commandParser.parseCommand(pusherCommand)
val expectedCommand = Command(Method.OPTIONS, 1, -1, pusherCommand)
Expand Down
4 changes: 1 addition & 3 deletions srt/src/main/java/com/pedro/srt/srt/SrtClient.kt
Expand Up @@ -22,7 +22,6 @@ import com.pedro.common.AudioCodec
import com.pedro.common.ConnectChecker
import com.pedro.common.VideoCodec
import com.pedro.common.onMainThread
import com.pedro.srt.mpeg2ts.Codec
import com.pedro.srt.srt.packets.ControlPacket
import com.pedro.srt.srt.packets.DataPacket
import com.pedro.srt.srt.packets.SrtPacket
Expand Down Expand Up @@ -321,8 +320,7 @@ class SrtClient(private val connectChecker: ConnectChecker) {
@Throws(IOException::class)
private suspend fun handleMessages() {
val responseBufferConclusion = socket?.readBuffer() ?: throw IOException("read buffer failed, socket disconnected")
val srtPacket = SrtPacket.getSrtPacket(responseBufferConclusion)
when(srtPacket) {
when(val srtPacket = SrtPacket.getSrtPacket(responseBufferConclusion)) {
is DataPacket -> {
//ignore
}
Expand Down

0 comments on commit 38fc27f

Please sign in to comment.