diff --git a/livekit-ffi/protocol/room.proto b/livekit-ffi/protocol/room.proto index e0cb0daf..659f378d 100644 --- a/livekit-ffi/protocol/room.proto +++ b/livekit-ffi/protocol/room.proto @@ -252,7 +252,6 @@ message RoomEvent { ParticipantMetadataChanged participant_metadata_changed = 15; ParticipantNameChanged participant_name_changed = 16; ConnectionQualityChanged connection_quality_changed = 17; - DataReceived data_received = 18; ConnectionStateChanged connection_state_changed = 19; // Connected connected = 20; Disconnected disconnected = 21; @@ -356,13 +355,6 @@ message ConnectionQualityChanged { ConnectionQuality quality = 2; } -message DataReceived { - OwnedBuffer data = 1; - optional string participant_sid = 2; // Can be empty if the data is sent a server SDK - DataPacketKind kind = 3; - optional string topic = 4; -} - message UserPacket { OwnedBuffer data = 1; optional string topic = 2; diff --git a/livekit-ffi/src/livekit.proto.rs b/livekit-ffi/src/livekit.proto.rs index 95e72e38..9beda638 100644 --- a/livekit-ffi/src/livekit.proto.rs +++ b/livekit-ffi/src/livekit.proto.rs @@ -2215,7 +2215,7 @@ pub struct OwnedBuffer { pub struct RoomEvent { #[prost(uint64, tag="1")] pub room_handle: u64, - #[prost(oneof="room_event::Message", tags="2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26")] + #[prost(oneof="room_event::Message", tags="2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 21, 22, 23, 24, 25, 26")] pub message: ::core::option::Option, } /// Nested message and enum types in `RoomEvent`. @@ -2255,8 +2255,6 @@ pub mod room_event { ParticipantNameChanged(super::ParticipantNameChanged), #[prost(message, tag="17")] ConnectionQualityChanged(super::ConnectionQualityChanged), - #[prost(message, tag="18")] - DataReceived(super::DataReceived), #[prost(message, tag="19")] ConnectionStateChanged(super::ConnectionStateChanged), /// Connected connected = 20; @@ -2427,19 +2425,6 @@ pub struct ConnectionQualityChanged { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DataReceived { - #[prost(message, optional, tag="1")] - pub data: ::core::option::Option, - /// Can be empty if the data is sent a server SDK - #[prost(string, optional, tag="2")] - pub participant_sid: ::core::option::Option<::prost::alloc::string::String>, - #[prost(enumeration="DataPacketKind", tag="3")] - pub kind: i32, - #[prost(string, optional, tag="4")] - pub topic: ::core::option::Option<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] pub struct UserPacket { #[prost(message, optional, tag="1")] pub data: ::core::option::Option, diff --git a/livekit-ffi/src/server/room.rs b/livekit-ffi/src/server/room.rs index 0d4fb6b1..71b94e69 100644 --- a/livekit-ffi/src/server/room.rs +++ b/livekit-ffi/src/server/room.rs @@ -652,27 +652,18 @@ async fn forward_event( }; server.store_handle(handle_id, FfiDataBuffer { handle: handle_id, data: payload }); - let _ = send_event(proto::room_event::Message::DataReceived(proto::DataReceived { - data: Some(proto::OwnedBuffer { - handle: Some(proto::FfiOwnedHandle { id: handle_id }), - data: Some(buffer_info.clone()), - }), - participant_sid: sid.clone(), - kind: proto::DataPacketKind::from(kind).into(), - topic: topic.clone(), - })); let _ = send_event(proto::room_event::Message::DataPacketReceived(proto::DataPacketReceived { value: Some(proto::data_packet_received::Value::User( proto::UserPacket{ data: Some(proto::OwnedBuffer { handle: Some(proto::FfiOwnedHandle { id: handle_id }), - data: Some(buffer_info.clone()), + data: Some(buffer_info), }), - topic: topic.clone(), + topic, } )), participant_identity: identity, - participant_sid: sid.clone(), + participant_sid: sid, kind: proto::DataPacketKind::from(kind).into(), })); }