Skip to content

Commit 27f162a

Browse files
committed
livekit-ffi: destination_{sids -> identities}
1 parent 6a62b41 commit 27f162a

File tree

3 files changed

+24
-21
lines changed

3 files changed

+24
-21
lines changed

livekit-ffi/protocol/room.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ message PublishDataRequest {
8989
uint64 data_ptr = 2;
9090
uint64 data_len = 3;
9191
DataPacketKind kind = 4;
92-
repeated string destination_sids = 5; // destination
92+
repeated string destination_sids = 5;
9393
optional string topic = 6;
94+
repeated string destination_identities = 7;
9495
}
9596
message PublishDataResponse {
9697
uint64 async_id = 1;

livekit-ffi/src/livekit.proto.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// @generated
2-
// This file is @generated by prost-build.
32
#[allow(clippy::derive_partial_eq_without_eq)]
43
#[derive(Clone, PartialEq, ::prost::Message)]
54
pub struct FrameCryptor {
@@ -2021,11 +2020,12 @@ pub struct PublishDataRequest {
20212020
pub data_len: u64,
20222021
#[prost(enumeration="DataPacketKind", tag="4")]
20232022
pub kind: i32,
2024-
/// destination
20252023
#[prost(string, repeated, tag="5")]
20262024
pub destination_sids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
20272025
#[prost(string, optional, tag="6")]
20282026
pub topic: ::core::option::Option<::prost::alloc::string::String>,
2027+
#[prost(string, repeated, tag="7")]
2028+
pub destination_identities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
20292029
}
20302030
#[allow(clippy::derive_partial_eq_without_eq)]
20312031
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -2044,20 +2044,6 @@ pub struct PublishDataCallback {
20442044
/// Publish transcription messages to room
20452045
#[allow(clippy::derive_partial_eq_without_eq)]
20462046
#[derive(Clone, PartialEq, ::prost::Message)]
2047-
pub struct TranscriptionSegment {
2048-
#[prost(string, tag="1")]
2049-
pub id: ::prost::alloc::string::String,
2050-
#[prost(string, tag="2")]
2051-
pub text: ::prost::alloc::string::String,
2052-
#[prost(uint64, tag="3")]
2053-
pub start_time: u64,
2054-
#[prost(uint64, tag="4")]
2055-
pub end_time: u64,
2056-
#[prost(bool, tag="5")]
2057-
pub r#final: bool,
2058-
}
2059-
#[allow(clippy::derive_partial_eq_without_eq)]
2060-
#[derive(Clone, PartialEq, ::prost::Message)]
20612047
pub struct PublishTranscriptionRequest {
20622048
#[prost(uint64, tag="1")]
20632049
pub local_participant_handle: u64,
@@ -2240,6 +2226,20 @@ pub struct RoomOptions {
22402226
}
22412227
#[allow(clippy::derive_partial_eq_without_eq)]
22422228
#[derive(Clone, PartialEq, ::prost::Message)]
2229+
pub struct TranscriptionSegment {
2230+
#[prost(string, tag="1")]
2231+
pub id: ::prost::alloc::string::String,
2232+
#[prost(string, tag="2")]
2233+
pub text: ::prost::alloc::string::String,
2234+
#[prost(uint64, tag="3")]
2235+
pub start_time: u64,
2236+
#[prost(uint64, tag="4")]
2237+
pub end_time: u64,
2238+
#[prost(bool, tag="5")]
2239+
pub r#final: bool,
2240+
}
2241+
#[allow(clippy::derive_partial_eq_without_eq)]
2242+
#[derive(Clone, PartialEq, ::prost::Message)]
22432243
pub struct BufferInfo {
22442244
#[prost(uint64, tag="1")]
22452245
pub data_ptr: u64,

livekit-ffi/src/server/room.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,19 +238,21 @@ impl RoomInner {
238238
.to_vec();
239239

240240
let kind = publish.kind();
241-
let destination_sids = publish.destination_sids;
241+
let destination_identities = publish.destination_identities;
242242
let async_id = server.next_id();
243243

244244
if let Err(err) = self.data_tx.send(FfiDataPacket {
245245
payload: DataPacket {
246246
payload: data.to_vec(), // Avoid copy?
247-
kind: kind.into(),
247+
reliable: match kind {
248+
proto::DataPacketKind::KindLossy => false,
249+
proto::DataPacketKind::KindReliable => true,
250+
},
248251
topic: publish.topic,
249-
destination_sids: destination_sids
252+
destination_identities: destination_identities
250253
.into_iter()
251254
.map(|str| str.try_into().unwrap())
252255
.collect(),
253-
destination_identities: Vec::new(), // TODO
254256
},
255257
async_id,
256258
}) {

0 commit comments

Comments
 (0)