David Zhao

fixed protobuf references

... ... @@ -10,7 +10,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.15'
... ...
package io.livekit.android.room
import com.github.ajalt.timberkt.Timber
import livekit.Rtc
import livekit.LivekitRtc
import org.webrtc.*
class PublisherTransportObserver(
... ... @@ -11,7 +11,7 @@ class PublisherTransportObserver(
override fun onIceCandidate(iceCandidate: IceCandidate?) {
val candidate = iceCandidate ?: return
if (engine.rtcConnected) {
engine.client.sendCandidate(candidate, target = Rtc.SignalTarget.PUBLISHER)
engine.client.sendCandidate(candidate, target = LivekitRtc.SignalTarget.PUBLISHER)
} else {
engine.pendingCandidates.add(candidate)
}
... ...
... ... @@ -7,8 +7,8 @@ import io.livekit.android.room.track.Track
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import livekit.Model
import livekit.Rtc
import livekit.LivekitModels
import livekit.LivekitRtc
import okhttp3.Request
import okhttp3.Response
import okhttp3.WebSocket
... ... @@ -60,7 +60,7 @@ constructor(
override fun onMessage(webSocket: WebSocket, text: String) {
Timber.v { text }
val signalResponseBuilder = Rtc.SignalResponse.newBuilder()
val signalResponseBuilder = LivekitRtc.SignalResponse.newBuilder()
fromJsonProtobuf.merge(text, signalResponseBuilder)
val response = signalResponseBuilder.build()
... ... @@ -69,7 +69,7 @@ constructor(
override fun onMessage(webSocket: WebSocket, bytes: ByteString) {
val byteArray = bytes.toByteArray()
val signalResponseBuilder = Rtc.SignalResponse.newBuilder()
val signalResponseBuilder = LivekitRtc.SignalResponse.newBuilder()
.mergeFrom(byteArray)
val response = signalResponseBuilder.build()
... ... @@ -93,7 +93,7 @@ constructor(
}
fun fromProtoSessionDescription(sd: Rtc.SessionDescription): SessionDescription {
fun fromProtoSessionDescription(sd: LivekitRtc.SessionDescription): SessionDescription {
val rtcSdpType = when (sd.type) {
SD_TYPE_ANSWER -> SessionDescription.Type.ANSWER
SD_TYPE_OFFER -> SessionDescription.Type.OFFER
... ... @@ -103,8 +103,8 @@ constructor(
return SessionDescription(rtcSdpType, sd.sdp)
}
fun toProtoSessionDescription(sdp: SessionDescription): Rtc.SessionDescription {
val sdBuilder = Rtc.SessionDescription.newBuilder()
fun toProtoSessionDescription(sdp: SessionDescription): LivekitRtc.SessionDescription {
val sdBuilder = LivekitRtc.SessionDescription.newBuilder()
sdBuilder.sdp = sdp.description
sdBuilder.type = when (sdp.type) {
SessionDescription.Type.ANSWER -> SD_TYPE_ANSWER
... ... @@ -118,7 +118,7 @@ constructor(
fun sendOffer(offer: SessionDescription) {
val sd = toProtoSessionDescription(offer)
val request = Rtc.SignalRequest.newBuilder()
val request = LivekitRtc.SignalRequest.newBuilder()
.setOffer(sd)
.build()
... ... @@ -127,26 +127,26 @@ constructor(
fun sendAnswer(answer: SessionDescription) {
val sd = toProtoSessionDescription(answer)
val request = Rtc.SignalRequest.newBuilder()
val request = LivekitRtc.SignalRequest.newBuilder()
.setAnswer(sd)
.build()
sendRequest(request)
}
fun sendCandidate(candidate: IceCandidate, target: Rtc.SignalTarget){
fun sendCandidate(candidate: IceCandidate, target: LivekitRtc.SignalTarget){
val iceCandidateJSON = IceCandidateJSON(
candidate = candidate.sdp,
sdpMid = candidate.sdpMid,
sdpMLineIndex = candidate.sdpMLineIndex
)
val trickleRequest = Rtc.TrickleRequest.newBuilder()
val trickleRequest = LivekitRtc.TrickleRequest.newBuilder()
.setCandidateInit(json.encodeToString(iceCandidateJSON))
.setTarget(target)
.build()
val request = Rtc.SignalRequest.newBuilder()
val request = LivekitRtc.SignalRequest.newBuilder()
.setTrickle(trickleRequest)
.build()
... ... @@ -154,33 +154,33 @@ constructor(
}
fun sendMuteTrack(trackSid: Track.Sid, muted: Boolean) {
val muteRequest = Rtc.MuteTrackRequest.newBuilder()
val muteRequest = LivekitRtc.MuteTrackRequest.newBuilder()
.setSid(trackSid.sid)
.setMuted(muted)
.build()
val request = Rtc.SignalRequest.newBuilder()
val request = LivekitRtc.SignalRequest.newBuilder()
.setMute(muteRequest)
.build()
sendRequest(request)
}
fun sendAddTrack(cid: Track.Cid, name: String, type: Model.TrackType) {
val addTrackRequest = Rtc.AddTrackRequest.newBuilder()
fun sendAddTrack(cid: Track.Cid, name: String, type: LivekitModels.TrackType) {
val addTrackRequest = LivekitRtc.AddTrackRequest.newBuilder()
.setCid(cid.cid)
.setName(name)
.setType(type)
.build()
val request = Rtc.SignalRequest.newBuilder()
val request = LivekitRtc.SignalRequest.newBuilder()
.setAddTrack(addTrackRequest)
.build()
sendRequest(request)
}
fun sendRequest(request: Rtc.SignalRequest) {
fun sendRequest(request: LivekitRtc.SignalRequest) {
Timber.v { "sending request: $request" }
if (!isConnected || currentWs == null) {
throw IllegalStateException("not connected!")
... ... @@ -200,7 +200,7 @@ constructor(
}
}
fun handleSignalResponse(response: Rtc.SignalResponse) {
fun handleSignalResponse(response: LivekitRtc.SignalResponse) {
if (!isConnected) {
// Only handle joins if not connected.
if (response.hasJoin()) {
... ... @@ -212,15 +212,15 @@ constructor(
return
}
when (response.messageCase) {
Rtc.SignalResponse.MessageCase.ANSWER -> {
LivekitRtc.SignalResponse.MessageCase.ANSWER -> {
val sd = fromProtoSessionDescription(response.answer)
listener?.onAnswer(sd)
}
Rtc.SignalResponse.MessageCase.OFFER -> {
LivekitRtc.SignalResponse.MessageCase.OFFER -> {
val sd = fromProtoSessionDescription(response.offer)
listener?.onOffer(sd)
}
Rtc.SignalResponse.MessageCase.TRICKLE -> {
LivekitRtc.SignalResponse.MessageCase.TRICKLE -> {
val iceCandidateJson =
json.decodeFromString<IceCandidateJSON>(response.trickle.candidateInit)
val iceCandidate = IceCandidate(
... ... @@ -230,16 +230,16 @@ constructor(
)
listener?.onTrickle(iceCandidate, response.trickle.target)
}
Rtc.SignalResponse.MessageCase.UPDATE -> {
LivekitRtc.SignalResponse.MessageCase.UPDATE -> {
listener?.onParticipantUpdate(response.update.participantsList)
}
Rtc.SignalResponse.MessageCase.TRACK_PUBLISHED -> {
LivekitRtc.SignalResponse.MessageCase.TRACK_PUBLISHED -> {
listener?.onLocalTrackPublished(response.trackPublished)
}
Rtc.SignalResponse.MessageCase.SPEAKER -> {
LivekitRtc.SignalResponse.MessageCase.SPEAKER -> {
listener?.onActiveSpeakersChanged(response.speaker.speakersList)
}
Rtc.SignalResponse.MessageCase.MESSAGE_NOT_SET -> TODO()
LivekitRtc.SignalResponse.MessageCase.MESSAGE_NOT_SET -> TODO()
else -> {
Timber.v { "unhandled response type: ${response.messageCase.name}" }
}
... ... @@ -252,13 +252,13 @@ constructor(
}
interface Listener {
fun onJoin(info: Rtc.JoinResponse)
fun onJoin(info: LivekitRtc.JoinResponse)
fun onAnswer(sessionDescription: SessionDescription)
fun onOffer(sessionDescription: SessionDescription)
fun onTrickle(candidate: IceCandidate, target: Rtc.SignalTarget)
fun onLocalTrackPublished(response: Rtc.TrackPublishedResponse)
fun onParticipantUpdate(updates: List<Model.ParticipantInfo>)
fun onActiveSpeakersChanged(speakers: List<Rtc.SpeakerInfo>)
fun onTrickle(candidate: IceCandidate, target: LivekitRtc.SignalTarget)
fun onLocalTrackPublished(response: LivekitRtc.TrackPublishedResponse)
fun onParticipantUpdate(updates: List<LivekitModels.ParticipantInfo>)
fun onActiveSpeakersChanged(speakers: List<LivekitRtc.SpeakerInfo>)
fun onClose(reason: String, code: Int)
fun onError(error: Exception)
}
... ...
... ... @@ -11,8 +11,8 @@ import io.livekit.android.util.Either
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.launch
import livekit.Model
import livekit.Rtc
import livekit.LivekitModels
import livekit.LivekitRtc
import org.webrtc.*
import javax.inject.Inject
import javax.inject.Named
... ... @@ -32,7 +32,7 @@ constructor(
var listener: Listener? = null
var rtcConnected: Boolean = false
var joinResponse: Rtc.JoinResponse? = null
var joinResponse: LivekitRtc.JoinResponse? = null
var iceConnected: Boolean = false
set(value) {
field = value
... ... @@ -43,7 +43,7 @@ constructor(
}
}
val pendingCandidates = mutableListOf<IceCandidate>()
private val pendingTrackResolvers: MutableMap<Track.Cid, Continuation<Model.TrackInfo>> =
private val pendingTrackResolvers: MutableMap<Track.Cid, Continuation<LivekitModels.TrackInfo>> =
mutableMapOf()
private val publisherObserver = PublisherTransportObserver(this)
... ... @@ -74,7 +74,7 @@ constructor(
client.join(url, token, isSecure)
}
suspend fun addTrack(cid: Track.Cid, name: String, kind: Model.TrackType): Model.TrackInfo {
suspend fun addTrack(cid: Track.Cid, name: String, kind: LivekitModels.TrackType): LivekitModels.TrackInfo {
if (pendingTrackResolvers[cid] != null) {
throw TrackException.DuplicateTrackException("Track with same ID $cid has already been published!")
}
... ... @@ -127,18 +127,18 @@ constructor(
Timber.v { "RTC Connected" }
rtcConnected = true
pendingCandidates.forEach { candidate ->
client.sendCandidate(candidate, Rtc.SignalTarget.PUBLISHER)
client.sendCandidate(candidate, LivekitRtc.SignalTarget.PUBLISHER)
}
pendingCandidates.clear()
}
interface Listener {
fun onJoin(response: Rtc.JoinResponse)
fun onJoin(response: LivekitRtc.JoinResponse)
fun onAddTrack(track: MediaStreamTrack, streams: Array<out MediaStream>)
fun onPublishLocalTrack(cid: Track.Cid, track: Model.TrackInfo)
fun onPublishLocalTrack(cid: Track.Cid, track: LivekitModels.TrackInfo)
fun onAddDataChannel(channel: DataChannel)
fun onUpdateParticipants(updates: List<Model.ParticipantInfo>)
fun onUpdateSpeakers(speakers: List<Rtc.SpeakerInfo>)
fun onUpdateParticipants(updates: List<LivekitModels.ParticipantInfo>)
fun onUpdateSpeakers(speakers: List<LivekitRtc.SpeakerInfo>)
fun onDisconnect(reason: String)
fun onFailToConnect(error: Exception)
}
... ... @@ -162,7 +162,7 @@ constructor(
}
}
override fun onJoin(info: Rtc.JoinResponse) {
override fun onJoin(info: LivekitRtc.JoinResponse) {
joinResponse = info
coroutineScope.launch {
... ... @@ -237,16 +237,16 @@ constructor(
}
}
override fun onTrickle(candidate: IceCandidate, target: Rtc.SignalTarget) {
override fun onTrickle(candidate: IceCandidate, target: LivekitRtc.SignalTarget) {
Timber.v { "received ice candidate from peer: $candidate, $target" }
when (target) {
Rtc.SignalTarget.PUBLISHER -> publisher.addIceCandidate(candidate)
Rtc.SignalTarget.SUBSCRIBER -> publisher.addIceCandidate(candidate)
LivekitRtc.SignalTarget.PUBLISHER -> publisher.addIceCandidate(candidate)
LivekitRtc.SignalTarget.SUBSCRIBER -> publisher.addIceCandidate(candidate)
else -> Timber.i { "unknown ice candidate target?" }
}
}
override fun onLocalTrackPublished(response: Rtc.TrackPublishedResponse) {
override fun onLocalTrackPublished(response: LivekitRtc.TrackPublishedResponse) {
val signalCid = response.cid ?: run {
Timber.e { "local track published with null cid?" }
return
... ... @@ -269,11 +269,11 @@ constructor(
}
override fun onParticipantUpdate(updates: List<Model.ParticipantInfo>) {
override fun onParticipantUpdate(updates: List<LivekitModels.ParticipantInfo>) {
listener?.onUpdateParticipants(updates)
}
override fun onActiveSpeakersChanged(speakers: List<Rtc.SpeakerInfo>) {
override fun onActiveSpeakersChanged(speakers: List<LivekitRtc.SpeakerInfo>) {
listener?.onUpdateSpeakers(speakers)
}
... ...
... ... @@ -11,8 +11,8 @@ import io.livekit.android.room.participant.Participant
import io.livekit.android.room.participant.RemoteParticipant
import io.livekit.android.room.track.Track
import io.livekit.android.room.util.unpackedTrackLabel
import livekit.Model
import livekit.Rtc
import livekit.LivekitModels
import livekit.LivekitRtc
import org.webrtc.*
import kotlin.coroutines.Continuation
import kotlin.coroutines.resume
... ... @@ -84,7 +84,7 @@ constructor(
private fun getOrCreateRemoteParticipant(
sid: Participant.Sid,
info: Model.ParticipantInfo? = null
info: LivekitModels.ParticipantInfo? = null
): RemoteParticipant {
var participant = remoteParticipants[sid]
if (participant != null) {
... ... @@ -100,7 +100,7 @@ constructor(
return participant
}
private fun handleSpeakerUpdate(speakerInfos: List<Rtc.SpeakerInfo>) {
private fun handleSpeakerUpdate(speakerInfos: List<LivekitRtc.SpeakerInfo>) {
val speakers = mutableListOf<Participant>()
val seenSids = mutableSetOf<Participant.Sid>()
val localParticipant = localParticipant
... ... @@ -150,7 +150,7 @@ constructor(
fun onActiveSpeakersChanged(speakers: List<Participant>, room: Room) {}
}
override fun onJoin(response: Rtc.JoinResponse) {
override fun onJoin(response: LivekitRtc.JoinResponse) {
Timber.v { "engine did join, version: ${response.serverVersion}" }
try {
... ... @@ -200,11 +200,11 @@ constructor(
participant.addSubscribedDataTrack(channel, trackSid, name)
}
override fun onPublishLocalTrack(cid: Track.Cid, track: Model.TrackInfo) {
override fun onPublishLocalTrack(cid: Track.Cid, track: LivekitModels.TrackInfo) {
}
override fun onUpdateParticipants(updates: List<Model.ParticipantInfo>) {
override fun onUpdateParticipants(updates: List<LivekitModels.ParticipantInfo>) {
for (info in updates) {
val participantSid = Participant.Sid(info.sid)
... ... @@ -215,7 +215,7 @@ constructor(
val isNewParticipant = remoteParticipants.contains(participantSid)
val participant = getOrCreateRemoteParticipant(participantSid, info)
if (info.state == Model.ParticipantInfo.State.DISCONNECTED) {
if (info.state == LivekitModels.ParticipantInfo.State.DISCONNECTED) {
handleParticipantDisconnect(participantSid, participant)
} else if (isNewParticipant) {
listener?.onParticipantConnected(this, participant)
... ... @@ -225,7 +225,7 @@ constructor(
}
}
override fun onUpdateSpeakers(speakers: List<Rtc.SpeakerInfo>) {
override fun onUpdateSpeakers(speakers: List<LivekitRtc.SpeakerInfo>) {
handleSpeakerUpdate(speakers)
}
... ...
package io.livekit.android.room
import com.github.ajalt.timberkt.Timber
import livekit.Rtc
import livekit.LivekitRtc
import org.webrtc.*
class SubscriberTransportObserver(
... ... @@ -11,7 +11,7 @@ class SubscriberTransportObserver(
override fun onIceCandidate(candidate: IceCandidate) {
Timber.v { "onIceCandidate: $candidate" }
engine.client.sendCandidate(candidate, Rtc.SignalTarget.SUBSCRIBER)
engine.client.sendCandidate(candidate, LivekitRtc.SignalTarget.SUBSCRIBER)
}
override fun onAddTrack(receiver: RtpReceiver, streams: Array<out MediaStream>) {
... ...
... ... @@ -3,14 +3,14 @@ package io.livekit.android.room.participant
import com.github.ajalt.timberkt.Timber
import io.livekit.android.room.RTCEngine
import io.livekit.android.room.track.*
import livekit.Model
import livekit.LivekitModels
import org.webrtc.DataChannel
import org.webrtc.RtpTransceiver
import java.util.*
class LocalParticipant(sid: Sid, name: String? = null) :
Participant(sid, name) {
constructor(info: Model.ParticipantInfo, engine: RTCEngine) : this(
constructor(info: LivekitModels.ParticipantInfo, engine: RTCEngine) : this(
Sid(info.sid),
info.identity
) {
... ... @@ -30,7 +30,7 @@ class LocalParticipant(sid: Sid, name: String? = null) :
var engine: RTCEngine? = null
val listener: Listener? = null
fun updateFromInfo(info: Model.ParticipantInfo) {
fun updateFromInfo(info: LivekitModels.ParticipantInfo) {
sid = Sid(info.sid)
name = info.identity
metadata = info.metadata
... ... @@ -52,7 +52,7 @@ class LocalParticipant(sid: Sid, name: String? = null) :
}
val trackInfo =
engine.addTrack(cid = Track.Cid(cid), name = track.name, kind = Model.TrackType.AUDIO)
engine.addTrack(cid = Track.Cid(cid), name = track.name, kind = LivekitModels.TrackType.AUDIO)
val transInit = RtpTransceiver.RtpTransceiverInit(
RtpTransceiver.RtpTransceiverDirection.SEND_ONLY,
listOf(streamId)
... ... @@ -89,7 +89,7 @@ class LocalParticipant(sid: Sid, name: String? = null) :
}
val trackInfo =
engine.addTrack(cid = Track.Cid(cid), name = track.name, kind = Model.TrackType.VIDEO)
engine.addTrack(cid = Track.Cid(cid), name = track.name, kind = LivekitModels.TrackType.VIDEO)
val transInit = RtpTransceiver.RtpTransceiverInit(
RtpTransceiver.RtpTransceiverDirection.SEND_ONLY,
listOf(streamId)
... ... @@ -126,7 +126,7 @@ class LocalParticipant(sid: Sid, name: String? = null) :
}
val trackInfo =
engine.addTrack(cid = cid, name = track.name, kind = Model.TrackType.DATA)
engine.addTrack(cid = cid, name = track.name, kind = LivekitModels.TrackType.DATA)
val publication = LocalDataTrackPublication(trackInfo, track)
val trackSid = Track.Sid(trackInfo.sid)
track.sid = trackSid
... ...
... ... @@ -6,7 +6,7 @@ import io.livekit.android.util.CloseableCoroutineScope
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import livekit.Model
import livekit.LivekitModels
import org.webrtc.AudioTrack
import org.webrtc.DataChannel
import org.webrtc.MediaStreamTrack
... ... @@ -17,7 +17,7 @@ class RemoteParticipant(
sid: Sid, name: String? = null
) : Participant(sid, name), RemoteDataTrack.Listener {
constructor(info: Model.ParticipantInfo) : this(Sid(info.sid), info.identity) {
constructor(info: LivekitModels.ParticipantInfo) : this(Sid(info.sid), info.identity) {
updateFromInfo(info)
}
... ... @@ -30,7 +30,7 @@ class RemoteParticipant(
var listener: Listener? = null
var participantInfo: Model.ParticipantInfo? = null
var participantInfo: LivekitModels.ParticipantInfo? = null
val hasInfo
get() = participantInfo != null
... ... @@ -40,7 +40,7 @@ class RemoteParticipant(
fun getTrackPublication(sid: Track.Sid): RemoteTrackPublication? =
tracks[sid] as? RemoteTrackPublication
fun updateFromInfo(info: Model.ParticipantInfo) {
fun updateFromInfo(info: LivekitModels.ParticipantInfo) {
val hadInfo = hasInfo
sid = Sid(info.sid)
name = info.identity
... ... @@ -56,10 +56,10 @@ class RemoteParticipant(
if (publication == null) {
publication = when (trackInfo.type) {
Model.TrackType.AUDIO -> RemoteAudioTrackPublication(trackInfo)
Model.TrackType.VIDEO -> RemoteVideoTrackPublication(trackInfo)
Model.TrackType.DATA -> RemoteDataTrackPublication(trackInfo)
Model.TrackType.UNRECOGNIZED -> throw TrackException.InvalidTrackTypeException()
LivekitModels.TrackType.AUDIO -> RemoteAudioTrackPublication(trackInfo)
LivekitModels.TrackType.VIDEO -> RemoteVideoTrackPublication(trackInfo)
LivekitModels.TrackType.DATA -> RemoteDataTrackPublication(trackInfo)
LivekitModels.TrackType.UNRECOGNIZED -> throw TrackException.InvalidTrackTypeException()
null -> throw NullPointerException("trackInfo.type is null")
}
... ... @@ -143,10 +143,10 @@ class RemoteParticipant(
if (publication != null) {
publication.track = track
} else {
val trackInfo = Model.TrackInfo.newBuilder()
val trackInfo = LivekitModels.TrackInfo.newBuilder()
.setSid(sid.sid)
.setName(name)
.setType(Model.TrackType.DATA)
.setType(LivekitModels.TrackType.DATA)
.build()
publication = RemoteDataTrackPublication(info = trackInfo, track = track)
addTrack(publication)
... ...
package io.livekit.android.room.track
import livekit.Model
import livekit.LivekitModels
class LocalAudioTrackPublication(info: Model.TrackInfo, track: Track? = null) :
class LocalAudioTrackPublication(info: LivekitModels.TrackInfo, track: Track? = null) :
LocalTrackPublication(info, track), AudioTrackPublication {
override val audioTrack: AudioTrack?
get() = track as? AudioTrack
... ...
package io.livekit.android.room.track
import livekit.Model
import livekit.LivekitModels
class LocalDataTrackPublication(info: Model.TrackInfo, track: Track? = null) :
class LocalDataTrackPublication(info: LivekitModels.TrackInfo, track: Track? = null) :
LocalTrackPublication(info, track), DataTrackPublication {
override val dataTrack: DataTrack?
get() = track as? DataTrack
... ...
package io.livekit.android.room.track
import livekit.Model
import livekit.LivekitModels
open class LocalTrackPublication(info: Model.TrackInfo, track: Track? = null) :
open class LocalTrackPublication(info: LivekitModels.TrackInfo, track: Track? = null) :
TrackPublication(info, track) {
val localTrack
get() = track
... ...
package io.livekit.android.room.track
import livekit.Model
import livekit.LivekitModels
class LocalVideoTrackPublication(info: Model.TrackInfo, track: Track? = null) :
class LocalVideoTrackPublication(info: LivekitModels.TrackInfo, track: Track? = null) :
LocalTrackPublication(info, track), VideoTrackPublication {
override val videoTrack: VideoTrack?
get() = track as? VideoTrack
... ...
package io.livekit.android.room.track
import livekit.Model
import livekit.LivekitModels
class RemoteAudioTrackPublication(
info: Model.TrackInfo,
info: LivekitModels.TrackInfo,
track: Track? = null
) : RemoteTrackPublication(info, track), AudioTrackPublication {
override val audioTrack: AudioTrack?
... ...
package io.livekit.android.room.track
import livekit.Model
import livekit.LivekitModels
class RemoteDataTrackPublication(
info: Model.TrackInfo,
info: LivekitModels.TrackInfo,
track: Track? = null
) : RemoteTrackPublication(info, track), DataTrackPublication {
override val dataTrack: DataTrack?
... ...
package io.livekit.android.room.track
import livekit.Model
import livekit.LivekitModels
open class RemoteTrackPublication(info: Model.TrackInfo, track: Track? = null) :
open class RemoteTrackPublication(info: LivekitModels.TrackInfo, track: Track? = null) :
TrackPublication(info, track) {
val remoteTrack: Track?
... ...
package io.livekit.android.room.track
import livekit.Model
import livekit.LivekitModels
class RemoteVideoTrackPublication(info: Model.TrackInfo, track: Track? = null) :
class RemoteVideoTrackPublication(info: LivekitModels.TrackInfo, track: Track? = null) :
RemoteTrackPublication(info, track),
VideoTrackPublication {
... ...
package io.livekit.android.room.track
import livekit.Model
import livekit.LivekitModels
open class TrackPublication(info: Model.TrackInfo, track: Track? = null) {
open class TrackPublication(info: LivekitModels.TrackInfo, track: Track? = null) {
var track: Track? = track
internal set
var trackName: String
... ... @@ -15,7 +15,7 @@ open class TrackPublication(info: Model.TrackInfo, track: Track? = null) {
trackName = info.name
}
fun updateFromInfo(info: Model.TrackInfo) {
fun updateFromInfo(info: LivekitModels.TrackInfo) {
trackSid = Track.Sid(info.sid)
trackName = info.name
}
... ...