Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix srt streamid value #1296

Merged
merged 2 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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