Skip to content

Commit

Permalink
add callback
Browse files Browse the repository at this point in the history
  • Loading branch information
typester committed Jan 13, 2025
1 parent 82d6298 commit fb93565
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions livekit-ffi/protocol/ffi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ message FfiEvent {
RpcMethodInvocationEvent rpc_method_invocation = 24;
SendStreamHeaderCallback send_stream_header = 25;
SendStreamChunkCallback send_stream_chunk = 26;
SetDataChannelBufferedAmountLowThresholdCallback set_data_channel_buffered_amount_low_threshold = 27;
}
}

Expand Down
4 changes: 4 additions & 0 deletions livekit-ffi/protocol/room.proto
Original file line number Diff line number Diff line change
Expand Up @@ -629,3 +629,7 @@ message SetDataChannelBufferedAmountLowThresholdRequest {
message SetDataChannelBufferedAmountLowThresholdResponse {
required uint64 async_id = 1;
}

message SetDataChannelBufferedAmountLowThresholdCallback {
required uint64 async_id = 1;
}
10 changes: 9 additions & 1 deletion livekit-ffi/src/livekit.proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3185,6 +3185,12 @@ pub struct SetDataChannelBufferedAmountLowThresholdResponse {
#[prost(uint64, required, tag="1")]
pub async_id: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetDataChannelBufferedAmountLowThresholdCallback {
#[prost(uint64, required, tag="1")]
pub async_id: u64,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum IceTransportType {
Expand Down Expand Up @@ -4181,7 +4187,7 @@ pub mod ffi_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FfiEvent {
#[prost(oneof="ffi_event::Message", tags="1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26")]
#[prost(oneof="ffi_event::Message", tags="1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27")]
pub message: ::core::option::Option<ffi_event::Message>,
}
/// Nested message and enum types in `FfiEvent`.
Expand Down Expand Up @@ -4239,6 +4245,8 @@ pub mod ffi_event {
SendStreamHeader(super::SendStreamHeaderCallback),
#[prost(message, tag="26")]
SendStreamChunk(super::SendStreamChunkCallback),
#[prost(message, tag="27")]
SetDataChannelBufferedAmountLowThreshold(super::SetDataChannelBufferedAmountLowThresholdCallback),
}
}
/// Stop all rooms synchronously (Do we need async here?).
Expand Down
3 changes: 3 additions & 0 deletions livekit-ffi/src/server/room.rs
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,9 @@ impl RoomInner {
set_data_channel_buffered_amount_low_threshold.threshold,
)
.await;
let _ = server.send_event(proto::ffi_event::Message::SetDataChannelBufferedAmountLowThreshold(
proto::SetDataChannelBufferedAmountLowThresholdCallback { async_id }
));
});
server.watch_panic(handle);
proto::SetDataChannelBufferedAmountLowThresholdResponse { async_id }
Expand Down

0 comments on commit fb93565

Please sign in to comment.