Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ffi update metadata requests #209

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 36 additions & 30 deletions livekit-ffi/protocol/ffi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -64,27 +64,29 @@ message FfiRequest {
UnpublishTrackRequest unpublish_track = 6;
PublishDataRequest publish_data = 7;
SetSubscribedRequest set_subscribed = 8;
UpdateLocalMetadataRequest update_local_metadata = 9;
UpdateLocalNameRequest update_local_name = 10;

// Track
CreateVideoTrackRequest create_video_track = 9;
CreateAudioTrackRequest create_audio_track = 10;
CreateVideoTrackRequest create_video_track = 11;
CreateAudioTrackRequest create_audio_track = 12;

// Video
AllocVideoBufferRequest alloc_video_buffer = 11;
NewVideoStreamRequest new_video_stream = 12;
NewVideoSourceRequest new_video_source = 13;
CaptureVideoFrameRequest capture_video_frame = 14;
ToI420Request to_i420 = 15;
ToArgbRequest to_argb = 16;
AllocVideoBufferRequest alloc_video_buffer = 13;
NewVideoStreamRequest new_video_stream = 14;
NewVideoSourceRequest new_video_source = 15;
CaptureVideoFrameRequest capture_video_frame = 16;
ToI420Request to_i420 = 17;
ToArgbRequest to_argb = 18;

// Audio
AllocAudioBufferRequest alloc_audio_buffer = 17;
NewAudioStreamRequest new_audio_stream = 18;
NewAudioSourceRequest new_audio_source = 19;
CaptureAudioFrameRequest capture_audio_frame = 20;
NewAudioResamplerRequest new_audio_resampler = 21;
RemixAndResampleRequest remix_and_resample = 22;
E2eeRequest e2ee = 23;
AllocAudioBufferRequest alloc_audio_buffer = 19;
NewAudioStreamRequest new_audio_stream = 20;
NewAudioSourceRequest new_audio_source = 21;
CaptureAudioFrameRequest capture_audio_frame = 22;
NewAudioResamplerRequest new_audio_resampler = 23;
RemixAndResampleRequest remix_and_resample = 24;
E2eeRequest e2ee = 25;
}
}

Expand All @@ -101,27 +103,29 @@ message FfiResponse {
UnpublishTrackResponse unpublish_track = 6;
PublishDataResponse publish_data = 7;
SetSubscribedResponse set_subscribed = 8;
UpdateLocalMetadataResponse update_local_metadata = 9;
UpdateLocalNameResponse update_local_name = 10;

// Track
CreateVideoTrackResponse create_video_track = 9;
CreateAudioTrackResponse create_audio_track = 10;
CreateVideoTrackResponse create_video_track = 11;
CreateAudioTrackResponse create_audio_track = 12;

// Video
AllocVideoBufferResponse alloc_video_buffer = 11;
NewVideoStreamResponse new_video_stream = 12;
NewVideoSourceResponse new_video_source = 13;
CaptureVideoFrameResponse capture_video_frame = 14;
ToI420Response to_i420 = 15;
ToArgbResponse to_argb = 16;
AllocVideoBufferResponse alloc_video_buffer = 13;
NewVideoStreamResponse new_video_stream = 14;
NewVideoSourceResponse new_video_source = 15;
CaptureVideoFrameResponse capture_video_frame = 16;
ToI420Response to_i420 = 17;
ToArgbResponse to_argb = 18;

// Audio
AllocAudioBufferResponse alloc_audio_buffer = 17;
NewAudioStreamResponse new_audio_stream = 18;
NewAudioSourceResponse new_audio_source = 19;
CaptureAudioFrameResponse capture_audio_frame = 20;
NewAudioResamplerResponse new_audio_resampler = 21;
RemixAndResampleResponse remix_and_resample = 22;
E2eeResponse e2ee = 23;
AllocAudioBufferResponse alloc_audio_buffer = 19;
NewAudioStreamResponse new_audio_stream = 20;
NewAudioSourceResponse new_audio_source = 21;
CaptureAudioFrameResponse capture_audio_frame = 22;
NewAudioResamplerResponse new_audio_resampler = 23;
RemixAndResampleResponse remix_and_resample = 24;
E2eeResponse e2ee = 25;
}
}

Expand All @@ -141,6 +145,8 @@ message FfiEvent {
UnpublishTrackCallback unpublish_track = 9;
PublishDataCallback publish_data = 10;
CaptureAudioFrameCallback capture_audio_frame = 11;
UpdateLocalMetadataCallback update_local_metadata = 12;
UpdateLocalNameCallback update_local_name = 13;
}
}

Expand Down
33 changes: 27 additions & 6 deletions livekit-ffi/protocol/room.proto
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,30 @@ message PublishDataCallback {
optional string error = 2;
}

// Change the local participant's metadata
message UpdateLocalMetadataRequest {
uint64 local_participant_handle = 1;
string metadata = 2;
}
message UpdateLocalMetadataResponse {
uint64 async_id = 1;
}
message UpdateLocalMetadataCallback {
uint64 async_id = 1;
}

// Change the local participant's name
message UpdateLocalNameRequest {
uint64 local_participant_handle = 1;
string name = 2;
}
message UpdateLocalNameResponse {
uint64 async_id = 1;
}
message UpdateLocalNameCallback {
uint64 async_id = 1;
}

// Change the "desire" to subs2ribe to a track
message SetSubscribedRequest {
bool subscribe = 1;
Expand Down Expand Up @@ -296,20 +320,17 @@ message E2eeStateChanged {
message ActiveSpeakersChanged { repeated string participant_sids = 1; }

message RoomMetadataChanged {
string old_metadata = 1;
string metadata = 2;
string metadata = 1;
}

message ParticipantMetadataChanged {
string participant_sid = 1;
string old_metadata = 2;
string metadata = 3;
string metadata = 2;
}

message ParticipantNameChanged {
string participant_sid = 1;
string old_name = 2;
string name = 3;
string name = 2;
}

message ConnectionQualityChanged {
Expand Down
126 changes: 87 additions & 39 deletions livekit-ffi/src/livekit.proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,48 @@ pub struct PublishDataCallback {
#[prost(string, optional, tag="2")]
pub error: ::core::option::Option<::prost::alloc::string::String>,
}
/// Change the local participant's metadata
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateLocalMetadataRequest {
#[prost(uint64, tag="1")]
pub local_participant_handle: u64,
#[prost(string, tag="2")]
pub metadata: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateLocalMetadataResponse {
#[prost(uint64, tag="1")]
pub async_id: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateLocalMetadataCallback {
#[prost(uint64, tag="1")]
pub async_id: u64,
}
/// Change the local participant's name
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateLocalNameRequest {
#[prost(uint64, tag="1")]
pub local_participant_handle: u64,
#[prost(string, tag="2")]
pub name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateLocalNameResponse {
#[prost(uint64, tag="1")]
pub async_id: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateLocalNameCallback {
#[prost(uint64, tag="1")]
pub async_id: u64,
}
/// Change the "desire" to subs2ribe to a track
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down Expand Up @@ -1454,8 +1496,6 @@ pub struct ActiveSpeakersChanged {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RoomMetadataChanged {
#[prost(string, tag="1")]
pub old_metadata: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub metadata: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
Expand All @@ -1464,8 +1504,6 @@ pub struct ParticipantMetadataChanged {
#[prost(string, tag="1")]
pub participant_sid: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub old_metadata: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub metadata: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
Expand All @@ -1474,8 +1512,6 @@ pub struct ParticipantNameChanged {
#[prost(string, tag="1")]
pub participant_sid: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub old_name: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down Expand Up @@ -1970,7 +2006,7 @@ impl AudioSourceType {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FfiRequest {
#[prost(oneof="ffi_request::Message", tags="1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23")]
#[prost(oneof="ffi_request::Message", tags="1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25")]
pub message: ::core::option::Option<ffi_request::Message>,
}
/// Nested message and enum types in `FfiRequest`.
Expand All @@ -1995,46 +2031,50 @@ pub mod ffi_request {
PublishData(super::PublishDataRequest),
#[prost(message, tag="8")]
SetSubscribed(super::SetSubscribedRequest),
/// Track
#[prost(message, tag="9")]
CreateVideoTrack(super::CreateVideoTrackRequest),
UpdateLocalMetadata(super::UpdateLocalMetadataRequest),
#[prost(message, tag="10")]
UpdateLocalName(super::UpdateLocalNameRequest),
/// Track
#[prost(message, tag="11")]
CreateVideoTrack(super::CreateVideoTrackRequest),
#[prost(message, tag="12")]
CreateAudioTrack(super::CreateAudioTrackRequest),
/// Video
#[prost(message, tag="11")]
#[prost(message, tag="13")]
AllocVideoBuffer(super::AllocVideoBufferRequest),
#[prost(message, tag="12")]
#[prost(message, tag="14")]
NewVideoStream(super::NewVideoStreamRequest),
#[prost(message, tag="13")]
#[prost(message, tag="15")]
NewVideoSource(super::NewVideoSourceRequest),
#[prost(message, tag="14")]
#[prost(message, tag="16")]
CaptureVideoFrame(super::CaptureVideoFrameRequest),
#[prost(message, tag="15")]
#[prost(message, tag="17")]
ToI420(super::ToI420Request),
#[prost(message, tag="16")]
#[prost(message, tag="18")]
ToArgb(super::ToArgbRequest),
/// Audio
#[prost(message, tag="17")]
#[prost(message, tag="19")]
AllocAudioBuffer(super::AllocAudioBufferRequest),
#[prost(message, tag="18")]
#[prost(message, tag="20")]
NewAudioStream(super::NewAudioStreamRequest),
#[prost(message, tag="19")]
#[prost(message, tag="21")]
NewAudioSource(super::NewAudioSourceRequest),
#[prost(message, tag="20")]
#[prost(message, tag="22")]
CaptureAudioFrame(super::CaptureAudioFrameRequest),
#[prost(message, tag="21")]
#[prost(message, tag="23")]
NewAudioResampler(super::NewAudioResamplerRequest),
#[prost(message, tag="22")]
#[prost(message, tag="24")]
RemixAndResample(super::RemixAndResampleRequest),
#[prost(message, tag="23")]
#[prost(message, tag="25")]
E2ee(super::E2eeRequest),
}
}
/// This is the output of livekit_ffi_request function.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FfiResponse {
#[prost(oneof="ffi_response::Message", tags="1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23")]
#[prost(oneof="ffi_response::Message", tags="1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25")]
pub message: ::core::option::Option<ffi_response::Message>,
}
/// Nested message and enum types in `FfiResponse`.
Expand All @@ -2059,38 +2099,42 @@ pub mod ffi_response {
PublishData(super::PublishDataResponse),
#[prost(message, tag="8")]
SetSubscribed(super::SetSubscribedResponse),
/// Track
#[prost(message, tag="9")]
CreateVideoTrack(super::CreateVideoTrackResponse),
UpdateLocalMetadata(super::UpdateLocalMetadataResponse),
#[prost(message, tag="10")]
UpdateLocalName(super::UpdateLocalNameResponse),
/// Track
#[prost(message, tag="11")]
CreateVideoTrack(super::CreateVideoTrackResponse),
#[prost(message, tag="12")]
CreateAudioTrack(super::CreateAudioTrackResponse),
/// Video
#[prost(message, tag="11")]
#[prost(message, tag="13")]
AllocVideoBuffer(super::AllocVideoBufferResponse),
#[prost(message, tag="12")]
#[prost(message, tag="14")]
NewVideoStream(super::NewVideoStreamResponse),
#[prost(message, tag="13")]
#[prost(message, tag="15")]
NewVideoSource(super::NewVideoSourceResponse),
#[prost(message, tag="14")]
#[prost(message, tag="16")]
CaptureVideoFrame(super::CaptureVideoFrameResponse),
#[prost(message, tag="15")]
#[prost(message, tag="17")]
ToI420(super::ToI420Response),
#[prost(message, tag="16")]
#[prost(message, tag="18")]
ToArgb(super::ToArgbResponse),
/// Audio
#[prost(message, tag="17")]
#[prost(message, tag="19")]
AllocAudioBuffer(super::AllocAudioBufferResponse),
#[prost(message, tag="18")]
#[prost(message, tag="20")]
NewAudioStream(super::NewAudioStreamResponse),
#[prost(message, tag="19")]
#[prost(message, tag="21")]
NewAudioSource(super::NewAudioSourceResponse),
#[prost(message, tag="20")]
#[prost(message, tag="22")]
CaptureAudioFrame(super::CaptureAudioFrameResponse),
#[prost(message, tag="21")]
#[prost(message, tag="23")]
NewAudioResampler(super::NewAudioResamplerResponse),
#[prost(message, tag="22")]
#[prost(message, tag="24")]
RemixAndResample(super::RemixAndResampleResponse),
#[prost(message, tag="23")]
#[prost(message, tag="25")]
E2ee(super::E2eeResponse),
}
}
Expand All @@ -2100,7 +2144,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, 6, 7, 8, 9, 10, 11")]
#[prost(oneof="ffi_event::Message", tags="1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13")]
pub message: ::core::option::Option<ffi_event::Message>,
}
/// Nested message and enum types in `FfiEvent`.
Expand Down Expand Up @@ -2130,6 +2174,10 @@ pub mod ffi_event {
PublishData(super::PublishDataCallback),
#[prost(message, tag="11")]
CaptureAudioFrame(super::CaptureAudioFrameCallback),
#[prost(message, tag="12")]
UpdateLocalMetadata(super::UpdateLocalMetadataCallback),
#[prost(message, tag="13")]
UpdateLocalName(super::UpdateLocalNameCallback),
}
}
/// Setup the callback where the foreign language can receive events
Expand Down
Loading
Loading