Skip to content

Conversation

@xianshijing-lk
Copy link
Contributor

And we should do it for Desktop only

@ladvoc
Copy link
Contributor

ladvoc commented Dec 22, 2025

Maybe we should add a simple unit test for munge_x_google_start_bitrate?

pub type OnOfferCreated = Box<dyn FnMut(SessionDescription) + Send + Sync>;

#[cfg(any(target_os = "windows", target_os = "macos", target_os = "linux"))]
const DEFAULT_VP9_START_BITRATE_KBPS: u32 = 2500;
Copy link
Member

Choose a reason for hiding this comment

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

I think we should use the currently negotiated bitrate? instead of a fixed amount? the JS logic uses 80% of ultimate bitrate. I think it's ok to go to 100% as well

Ok(answer)
}

fn munge_x_google_start_bitrate(sdp: &str, start_bitrate_kbps: u32) -> String {
Copy link
Member

Choose a reason for hiding this comment

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

should we use a proper sdp parser/rewriter? instead of string changes? https://crates.io/crates/sdp

in case we'd need to do more munging for other things

let mut offer = self.peer_connection.create_offer(options).await?;
let start_bitrate_kbps = DEFAULT_VP9_START_BITRATE_KBPS;
let sdp = offer.to_string();
// TODO, we should extend the codec support to AV1 ?
Copy link
Member

Choose a reason for hiding this comment

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

worth testing if AV1 has this issue or not.. the JS logic is applying to AV1 as well

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.

4 participants