Fix Apple H.264 profile-level capability advertisement#252
Draft
hiroshihorie wants to merge 7 commits into
Draft
Fix Apple H.264 profile-level capability advertisement#252hiroshihorie wants to merge 7 commits into
hiroshihorie wants to merge 7 commits into
Conversation
Member
Author
|
Formatting preference for future edits on this PR: clang-format touched Obj-C++ lines/blocks with |
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
H264Profile/H264Levelmodel. The fixed list is a constant mapping, not a device capability table; the capability decision still comes from VideoToolbox's supported value list.UIDevicecapability table as the conservative fallback for older physical iOS builds where VideoToolbox cannot be constrained to the hardware encoder.VideoToolbox.frameworkdependency fromsdk:videocodec_objc, becauseRTCH264ProfileLevelId.mmnow owns VideoToolbox symbol references.Context
LiveKitWebRTC should advertise Apple H.264 encoder capabilities accurately from the WebRTC SDK itself, without relying on downstream SDP profile-level rewrites.
Physical iOS already had a device capability table, but macOS/Catalyst did not. Those targets could still fall back to WebRTC's Level 3.1 constants, which cap 1920x1080 to roughly 13 fps and can lead to VideoToolbox encode failures for 1080p30 publishing.
This patch moves that decision into the WebRTC SDK's Apple H.264 profile-level code by asking VideoToolbox what the current platform supports, while keeping the older iOS table as a fallback where it is still the safer signal.
The H.264 VideoToolbox encoder only enables
kVTVideoEncoderSpecification_EnableLowLatencyRateControlfor High-family profiles, because applying it with Baseline/Main disables hardware acceleration. Keeping ConstrainedHigh first preserves that low-latency path when negotiation supports it.Validation
git diff --check origin/m144_release...HEADautoninja -C out/codex-mac sdk:videocodec_objc