Skip to content

Commit f683209

Browse files
authored
Fast track publication support (#612)
* protocol update * Fast track publication support
1 parent b712807 commit f683209

File tree

12 files changed

+193
-91
lines changed

12 files changed

+193
-91
lines changed

.changeset/six-flowers-hunt.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"client-sdk-android": minor
3+
---
4+
5+
Fast track publication support

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/scopes/Library_Projects.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

livekit-android-sdk/src/main/java/io/livekit/android/room/PeerConnectionTransport.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 LiveKit, Inc.
2+
* Copyright 2023-2025 LiveKit, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -131,7 +131,7 @@ constructor(
131131
return result
132132
}
133133

134-
val negotiate = debounce<MediaConstraints?, Unit>(100, coroutineScope) {
134+
val negotiate = debounce<MediaConstraints?, Unit>(20, coroutineScope) {
135135
if (it != null) {
136136
createAndSendOffer(it)
137137
} else {

livekit-android-sdk/src/main/java/io/livekit/android/room/RTCEngine.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ internal constructor(
156156
private val publisherObserver = PublisherTransportObserver(this, client)
157157
private val subscriberObserver = SubscriberTransportObserver(this, client)
158158

159-
private var publisher: PeerConnectionTransport? = null
159+
internal var publisher: PeerConnectionTransport? = null
160160
private var subscriber: PeerConnectionTransport? = null
161161

162162
private var reliableDataChannel: DataChannel? = null
@@ -214,7 +214,7 @@ internal constructor(
214214
configure(joinResponse, options)
215215

216216
// create offer
217-
if (!isSubscriberPrimary) {
217+
if (!isSubscriberPrimary || joinResponse.fastPublish) {
218218
negotiatePublisher()
219219
}
220220
client.onReadyForResponses()
@@ -1082,6 +1082,10 @@ internal constructor(
10821082
LivekitModels.DataPacket.ValueCase.STREAM_CHUNK -> {
10831083
// TODO
10841084
}
1085+
1086+
LivekitModels.DataPacket.ValueCase.STREAM_TRAILER -> {
1087+
// TODO
1088+
}
10851089
}
10861090
}
10871091

livekit-android-sdk/src/main/java/io/livekit/android/room/Room.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,7 @@ constructor(
585585
}
586586

587587
localParticipant.updateFromInfo(response.participant)
588+
localParticipant.setEnabledPublishCodecs(response.enabledPublishCodecsList)
588589

589590
if (response.otherParticipantsList.isNotEmpty()) {
590591
response.otherParticipantsList.forEach { info ->

0 commit comments

Comments
 (0)