Skip to content

Commit 9e635aa

Browse files
authored
set the simulcast codec & layers (#891)
1 parent b1c908a commit 9e635aa

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

livekit/src/room/participant/local_participant.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,16 @@ impl LocalParticipant {
284284

285285
encodings = compute_video_encodings(req.width, req.height, &options);
286286
req.layers = video_layers_from_encodings(req.width, req.height, &encodings);
287+
288+
// Populate simulcast_codecs so the server knows this track is simulcasted
289+
if options.simulcast && encodings.len() > 1 {
290+
req.simulcast_codecs = vec![proto::SimulcastCodec {
291+
codec: options.video_codec.as_str().to_string(),
292+
cid: track.rtc_track().id(),
293+
layers: req.layers.clone(),
294+
..Default::default()
295+
}];
296+
}
287297
}
288298
LocalTrack::Audio(_audio_track) => {
289299
// Setup audio encoding

0 commit comments

Comments
 (0)