Skip to content

Commit

Permalink
Merge pull request #1296 from pedroSG94/fix-srt-streamid
Browse files Browse the repository at this point in the history
fix srt streamid value
  • Loading branch information
pedroSG94 committed Oct 5, 2023
2 parents 52baa9a + 7a14843 commit 0b0e015
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions srt/src/main/java/com/pedro/srt/srt/SrtClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class SrtClient(private val connectCheckerSrt: ConnectCheckerSrt) {
if (url == null) {
isStreaming = false
onMainThread {
connectCheckerSrt.onConnectionFailedSrt("Endpoint malformed, should be: rtsp://ip:port/appname/streamname")
connectCheckerSrt.onConnectionFailedSrt("Endpoint malformed, should be: srt://ip:port/streamid")
}
return@launch
}
Expand All @@ -153,7 +153,7 @@ class SrtClient(private val connectCheckerSrt: ConnectCheckerSrt) {
if (!srtMatcher.matches()) {
isStreaming = false
onMainThread {
connectCheckerSrt.onConnectionFailedSrt("Endpoint malformed, should be: srt://ip:port/appname/streamname")
connectCheckerSrt.onConnectionFailedSrt("Endpoint malformed, should be: srt://ip:port/streamid")
}
return@launch
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ data class HandshakeExtension(
buffer.writeUInt16(senderDelay)

buffer.writeUInt16(ExtensionType.SRT_CMD_SID.value)
val data = fixPathData("publish:$path".toByteArray(Charsets.UTF_8))
val data = fixPathData(path.toByteArray(Charsets.UTF_8))
buffer.writeUInt16(data.size / 4)
buffer.write(data)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class HandshakeTest {

@Test
fun `GIVEN a handshake packet WHEN write packet in a buffer THEN get expected buffer`() {
val expectedData = byteArrayOf(-128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, -60, 0, 0, 0, 64, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 5, -36, 0, 0, 32, 0, -1, -1, -1, -1, 45, 116, -9, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 1, 4, 4, 0, 0, 0, 63, 0, 120, 0, 0, 0, 5, 0, 3, 108, 98, 117, 112, 58, 104, 115, 105, 116, 115, 101, 116)
val expectedData = byteArrayOf(-128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, -60, 0, 0, 0, 64, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 5, -36, 0, 0, 32, 0, -1, -1, -1, -1, 45, 116, -9, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 1, 4, 4, 0, 0, 0, 63, 0, 120, 0, 0, 0, 5, 0, 1, 116, 115, 101, 116)
val handshake = Handshake(
extensionField = ExtensionField.HS_REQ.value or ExtensionField.CONFIG.value,
handshakeType = HandshakeType.CONCLUSION,
Expand Down

0 comments on commit 0b0e015

Please sign in to comment.