Conversation
ChangesetThe following package versions will be affected by this PR:
|
| } | ||
|
|
||
| /// 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. |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
any chance that params.len is 0 ?
| format!( | ||
| "{:?}={}", | ||
| proto::VideoQuality::try_from(q.quality) | ||
| .unwrap_or(proto::VideoQuality::High), |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
should you also set changed to true here ?
| }) | ||
| .collect(); | ||
|
|
||
| if changed { |
| }; | ||
|
|
||
| let qualities: Vec<proto::SubscribedQuality> = if !update.subscribed_codecs.is_empty() { | ||
| let codec = publication.publish_options().video_codec.as_str().to_lowercase(); |
There was a problem hiding this comment.
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
SubscribedQualityUpdateevents from SFU and update published layers.