Skip to content
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
1 change: 1 addition & 0 deletions livekit-ffi/protocol/room.proto
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ message TrackPublishOptions {
optional bool simulcast = 6;
optional TrackSource source = 7;
optional string stream = 8;
optional bool preconnect_buffer = 9;
}

enum IceTransportType {
Expand Down
3 changes: 3 additions & 0 deletions livekit-ffi/src/conversion/room.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ impl From<proto::TrackPublishOptions> for TrackPublishOptions {
red: opts.red.unwrap_or(default_publish_options.red),
simulcast: opts.simulcast.unwrap_or(default_publish_options.simulcast),
stream: opts.stream.unwrap_or(default_publish_options.stream),
preconnect_buffer: opts
.preconnect_buffer
.unwrap_or(default_publish_options.preconnect_buffer),
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions livekit-ffi/src/livekit.proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3256,6 +3256,8 @@ pub struct TrackPublishOptions {
pub source: ::core::option::Option<i32>,
#[prost(string, optional, tag="8")]
pub stream: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bool, optional, tag="9")]
pub preconnect_buffer: ::core::option::Option<bool>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down
2 changes: 2 additions & 0 deletions livekit/src/room/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ pub struct TrackPublishOptions {
// pub name: String,
pub source: TrackSource,
pub stream: String,
pub preconnect_buffer: bool,
}

impl Default for TrackPublishOptions {
Expand All @@ -98,6 +99,7 @@ impl Default for TrackPublishOptions {
simulcast: true,
source: TrackSource::Unknown,
stream: "".to_string(),
preconnect_buffer: false,
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions livekit/src/room/participant/local_participant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ impl LocalParticipant {
..Default::default()
};

if options.preconnect_buffer {
req.audio_features.push(proto::AudioTrackFeature::TfPreconnectBuffer as i32);
}

let mut encodings = Vec::default();
match &track {
LocalTrack::Video(video_track) => {
Expand Down
Loading