fix(avc): align scaled capture dimensions to encoder alignment - #42
Merged
Conversation
(display * scale).toInt() can produce odd dimensions — e.g. Pixel 10 Pro's 1080x2410 display at scale 0.5 gives 540x1205 — which isSizeSupported() rejects, killing the capture before any frame with a misleading 'exceed codec capabilities' error. Round each dimension down to the codec's own width/height alignment (min 2) before validating.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. Walkthrough
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
(display * scale).toInt()can produce odd dimensions — Pixel 10 Pro's 1080x2410 display at scale 0.5 yields 540x1205 — whichisSizeSupported()rejects, killing the capture before any frame with the misleading "exceed codec capabilities. Maximum supported: 3840x3840" error. In production this makes WebRTC streaming fail 100% of the time on any device model whose scaled height is odd (verified live on a farm Pixel 10 Pro: scale 0.50 always fails, scale 0.48 with even dims streams fine).Fix: query the encoder's
widthAlignment/heightAlignment(min 2) and round each scaled dimension down to it before validating/configuring.