Skip to content

Commit

Permalink
Rename "update" to "set" in overlooked places + fix broken new proto …
Browse files Browse the repository at this point in the history
…field (#373)

* update -> set rename

* default
  • Loading branch information
keepingitneil authored Jul 15, 2024
1 parent 7f14113 commit fb70404
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
6 changes: 3 additions & 3 deletions livekit-ffi/protocol/ffi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ message FfiResponse {
UnpublishTrackResponse unpublish_track = 6;
PublishDataResponse publish_data = 7;
SetSubscribedResponse set_subscribed = 8;
SetLocalMetadataResponse update_local_metadata = 9;
SetLocalNameResponse update_local_name = 10;
SetLocalAttributesResponse update_local_attributes = 11;
SetLocalMetadataResponse set_local_metadata = 9;
SetLocalNameResponse set_local_name = 10;
SetLocalAttributesResponse set_local_attributes = 11;
GetSessionStatsResponse get_session_stats = 12;
PublishTranscriptionResponse publish_transcription = 13;

Expand Down
6 changes: 3 additions & 3 deletions livekit-ffi/src/livekit.proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3111,11 +3111,11 @@ pub mod ffi_response {
#[prost(message, tag="8")]
SetSubscribed(super::SetSubscribedResponse),
#[prost(message, tag="9")]
UpdateLocalMetadata(super::SetLocalMetadataResponse),
SetLocalMetadata(super::SetLocalMetadataResponse),
#[prost(message, tag="10")]
UpdateLocalName(super::SetLocalNameResponse),
SetLocalName(super::SetLocalNameResponse),
#[prost(message, tag="11")]
UpdateLocalAttributes(super::SetLocalAttributesResponse),
SetLocalAttributes(super::SetLocalAttributesResponse),
#[prost(message, tag="12")]
GetSessionStats(super::GetSessionStatsResponse),
#[prost(message, tag="13")]
Expand Down
12 changes: 6 additions & 6 deletions livekit-ffi/src/server/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ fn on_set_subscribed(
Ok(proto::SetSubscribedResponse {})
}

fn on_update_local_metadata(
fn on_set_local_metadata(
server: &'static FfiServer,
update_local_metadata: proto::SetLocalMetadataRequest,
) -> FfiResult<proto::SetLocalMetadataResponse> {
Expand All @@ -149,7 +149,7 @@ fn on_update_local_metadata(
Ok(ffi_participant.room.update_local_metadata(server, update_local_metadata))
}

fn on_update_local_name(
fn on_set_local_name(
server: &'static FfiServer,
update_local_name: proto::SetLocalNameRequest,
) -> FfiResult<proto::SetLocalNameResponse> {
Expand All @@ -160,7 +160,7 @@ fn on_update_local_name(
Ok(ffi_participant.room.update_local_name(server, update_local_name))
}

fn on_update_local_attributes(
fn on_set_local_attributes(
server: &'static FfiServer,
update_local_attributes: proto::SetLocalAttributesRequest,
) -> FfiResult<proto::SetLocalAttributesResponse> {
Expand Down Expand Up @@ -597,13 +597,13 @@ pub fn handle_request(
proto::ffi_response::Message::SetSubscribed(on_set_subscribed(server, subscribed)?)
}
proto::ffi_request::Message::UpdateLocalMetadata(u) => {
proto::ffi_response::Message::UpdateLocalMetadata(on_update_local_metadata(server, u)?)
proto::ffi_response::Message::SetLocalMetadata(on_set_local_metadata(server, u)?)
}
proto::ffi_request::Message::UpdateLocalName(update) => {
proto::ffi_response::Message::UpdateLocalName(on_update_local_name(server, update)?)
proto::ffi_response::Message::SetLocalName(on_set_local_name(server, update)?)
}
proto::ffi_request::Message::UpdateLocalAttributes(update) => {
proto::ffi_response::Message::UpdateLocalAttributes(on_update_local_attributes(
proto::ffi_response::Message::SetLocalAttributes(on_set_local_attributes(
server, update,
)?)
}
Expand Down
11 changes: 9 additions & 2 deletions livekit/src/room/participant/local_participant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use std::{collections::HashMap, fmt::Debug, sync::Arc};
use std::{
collections::HashMap,
fmt::Debug,
sync::{self, Arc},
};

use libwebrtc::rtp_parameters::RtpEncodingParameters;
use livekit_protocol as proto;
Expand All @@ -25,7 +29,7 @@ use crate::{
options::{compute_video_encodings, video_layers_from_encodings, TrackPublishOptions},
prelude::*,
rtc_engine::RtcEngine,
DataPacket, Transcription, TranscriptionSegment,
DataPacket, Transcription,
};

type LocalTrackPublishedHandler = Box<dyn Fn(LocalParticipant, LocalTrackPublication) + Send>;
Expand Down Expand Up @@ -231,6 +235,7 @@ impl LocalParticipant {
metadata,
name: self.name(),
attributes: Default::default(),
..Default::default()
},
))
.await;
Expand All @@ -245,6 +250,7 @@ impl LocalParticipant {
attributes,
metadata: self.metadata(),
name: self.name(),
..Default::default()
},
))
.await;
Expand All @@ -259,6 +265,7 @@ impl LocalParticipant {
name,
metadata: self.metadata(),
attributes: Default::default(),
..Default::default()
},
))
.await;
Expand Down

0 comments on commit fb70404

Please sign in to comment.