Skip to content

Commit

Permalink
Fast track publication support (#612)
Browse files Browse the repository at this point in the history
* protocol update

* Fast track publication support
  • Loading branch information
davidliu authored Feb 26, 2025
1 parent b712807 commit f683209
Show file tree
Hide file tree
Showing 12 changed files with 193 additions and 91 deletions.
5 changes: 5 additions & 0 deletions .changeset/six-flowers-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"client-sdk-android": minor
---

Fast track publication support
9 changes: 9 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/scopes/Library_Projects.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023-2024 LiveKit, Inc.
* Copyright 2023-2025 LiveKit, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -131,7 +131,7 @@ constructor(
return result
}

val negotiate = debounce<MediaConstraints?, Unit>(100, coroutineScope) {
val negotiate = debounce<MediaConstraints?, Unit>(20, coroutineScope) {
if (it != null) {
createAndSendOffer(it)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ internal constructor(
private val publisherObserver = PublisherTransportObserver(this, client)
private val subscriberObserver = SubscriberTransportObserver(this, client)

private var publisher: PeerConnectionTransport? = null
internal var publisher: PeerConnectionTransport? = null
private var subscriber: PeerConnectionTransport? = null

private var reliableDataChannel: DataChannel? = null
Expand Down Expand Up @@ -214,7 +214,7 @@ internal constructor(
configure(joinResponse, options)

// create offer
if (!isSubscriberPrimary) {
if (!isSubscriberPrimary || joinResponse.fastPublish) {
negotiatePublisher()
}
client.onReadyForResponses()
Expand Down Expand Up @@ -1082,6 +1082,10 @@ internal constructor(
LivekitModels.DataPacket.ValueCase.STREAM_CHUNK -> {
// TODO
}

LivekitModels.DataPacket.ValueCase.STREAM_TRAILER -> {
// TODO
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ constructor(
}

localParticipant.updateFromInfo(response.participant)
localParticipant.setEnabledPublishCodecs(response.enabledPublishCodecsList)

if (response.otherParticipantsList.isNotEmpty()) {
response.otherParticipantsList.forEach { info ->
Expand Down
Loading

0 comments on commit f683209

Please sign in to comment.