davidliu
Committed by GitHub

add data channel info to syncstate (#65)

* update protocol

* add data channel info to syncstate
@@ -704,10 +704,21 @@ internal constructor( @@ -704,10 +704,21 @@ internal constructor(
704 ) { 704 ) {
705 val answer = subscriber.peerConnection.localDescription.toProtoSessionDescription() 705 val answer = subscriber.peerConnection.localDescription.toProtoSessionDescription()
706 706
  707 + val dataChannelInfos = LivekitModels.DataPacket.Kind.values()
  708 + .toList()
  709 + .mapNotNull { kind -> dataChannelForKind(kind) }
  710 + .map { dataChannel ->
  711 + LivekitRtc.DataChannelInfo.newBuilder()
  712 + .setId(dataChannel.id())
  713 + .setLabel(dataChannel.label())
  714 + .build()
  715 + }
  716 +
707 val syncState = LivekitRtc.SyncState.newBuilder() 717 val syncState = LivekitRtc.SyncState.newBuilder()
708 .setAnswer(answer) 718 .setAnswer(answer)
709 .setSubscription(subscription) 719 .setSubscription(subscription)
710 .addAllPublishTracks(publishedTracks) 720 .addAllPublishTracks(publishedTracks)
  721 + .addAllDataChannels(dataChannelInfos)
711 .build() 722 .build()
712 723
713 client.sendSyncState(syncState) 724 client.sendSyncState(syncState)
1 -Subproject commit b94955852f2af01542247b28d1602db0e283d7c1 1 +Subproject commit 6f2a49e449143a01b8c63803198b7e9d1112e77b