Skip to content

Add dynacast support#1003

Open
chenosaurus wants to merge 6 commits intomainfrom
dc/dynacast
Open

Add dynacast support#1003
chenosaurus wants to merge 6 commits intomainfrom
dc/dynacast

Conversation

@chenosaurus
Copy link
Copy Markdown
Contributor

@chenosaurus chenosaurus commented Apr 10, 2026

  • properly handle SubscribedQualityUpdate events from SFU and update published layers.
  • Add e2e tests for dynacast

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 10, 2026

Changeset

The following package versions will be affected by this PR:

Package Bump
libwebrtc patch
livekit patch
livekit-ffi patch

@chenosaurus chenosaurus marked this pull request as ready for review April 13, 2026 16:17
}

/// Returns a snapshot of each simulcast layer's RID, quality label, and active state.
/// Useful for diagnostics / HUD display. Returns an empty vec if no transceiver is set.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, I think it also returns empty vec if there is no encodings (transceiver) yet.

/// Returns an empty vec if no transceiver is set, or if the sender has no encodings yet.

/// Useful for diagnostics / HUD display. Returns an empty vec if no transceiver is set.
pub fn publishing_layers(&self) -> Vec<(String, String, bool)> {
let Some(transceiver) = self.transceiver() else {
return Vec::new();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should log a debug message here ?

btw, how likely that publishing_layers will be triggered before we have a transceiver ?

let Some(transceiver) = self.transceiver() else {
return Vec::new();
};
let params = transceiver.sender().parameters();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any chance that params.len is 0 ?

format!(
"{:?}={}",
proto::VideoQuality::try_from(q.quality)
.unwrap_or(proto::VideoQuality::High),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we have multiple places to default the quality to proto::VideoQuality::High when things are unset ?

Should we make a flag or macro instead ? and please add comments to explain why proto::VideoQuality::High is preferred


if !any_enabled {
for encoding in &mut params.encodings {
encoding.active = false;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should you also set changed to true here ?

})
.collect();

if changed {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question

Nit, I wonder if we should print the logs out after sender.set_parameters(params), and only log it when the set_parameters is successfully ?

};

let qualities: Vec<proto::SubscribedQuality> = if !update.subscribed_codecs.is_empty() {
let codec = publication.publish_options().video_codec.as_str().to_lowercase();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curiously, is publication.publish_options().video_codec the codec that being used ? or the codec that is preferred or requested ?

I wonder if there is any chance that the actual codec is not publication.publish_options().video_codec ? in that case, there might be a mismatch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants