feat(plugin-meetings): add AV1 codec support and related constants#4816
feat(plugin-meetings): add AV1 codec support and related constants#4816fnowakow wants to merge 33 commits intowebex:nextfrom
Conversation
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e93a35bb71
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
… media connections
…payload type handling
9ba67e4 to
0571d52
Compare
|
@codex do the code review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b0e493fb7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| maxWidth: 1920, | ||
| maxHeight: 1080, | ||
| maxPicSize: 2_073_600, | ||
| maxDecodeRate: 70_778_880, |
There was a problem hiding this comment.
maxDecodeRate per AV1 spec for level Idx 8 is 77,856,768.
https://aomediacodec.github.io/av1-spec/#levels
There was a problem hiding this comment.
I fixed all the values
- for maxPicSize -> calculations of maxWidth * maxHeight so it's more visible what this value represents
- for maxDecodeRate - updated all values because when creating this I copied values from
MaxDisplayRateby mistake
| * @memberof Meetings | ||
| * @returns {undefined} | ||
| */ | ||
| private _toggleEnableAv1SlidesSupport(newValue: boolean) { |
There was a problem hiding this comment.
The JSDoc says this must be called before joinWithMedia(), but nothing enforces it. If a caller toggles after a connection is up, the config silently changes with no effect. Should we log a warn when a multistream connection already exists?
There was a problem hiding this comment.
The only use of this method is in web-client when enabling/ disabling feature. Otherwise this method is completely private and internal.
Currently it follows all other feature toggle flow so I don't think that it should have any checks and warnings
There was a problem hiding this comment.
Got you, thanks! but why we are interetsed to have it called only after joinWithMedia?
There was a problem hiding this comment.
Small clarification: the doc says before joinWithMedia(), not after.
We read enableAv1SlidesSupport when we create the multistream setup (for example when we build the slide MediaRequestManager) and when we create the media connection. Those paths copy the value once, they don’t watch the config forever. So changing the flag after join doesn’t change the running call; it only changes what we’d use on a later join. That’s why we document “set it before join.”
| return; | ||
| } | ||
|
|
||
| // @ts-ignore |
There was a problem hiding this comment.
current this is Meetings which doesn't have config property so we need @ts-ignore
There was a problem hiding this comment.
I see. Just out of curiosity and understanding when this prop will be there, could you clarify?
There was a problem hiding this comment.
config isn’t missing at runtime for normal flows. Meetings extends WebexPlugin, which is implemented in JS and adds config as a getter. That getter returns webex.config.meetings (see webex-plugin.js). Our TS class never declares that property, so TypeScript complains unless we use @ts-ignore or add a type. The prop is there whenever the client has been set up with the usual meetings config.
COMPLETES SPARK-797573
This pull request addresses
Multistream meetings currently only support H.264 codec for video slides. This PR adds AV1 codec support for video slides in multistream media connections, enabling better compression efficiency and quality at lower bitrates when the AV1 codec is available and negotiated.
by making the following changes
New AV1 codec constants: Added
codec/constants.tswith resolution-based AV1 encoding parameters (90p through 1080p) includinglevelIdx,tier,maxWidth,maxHeight,maxPicSize, andmaxDecodeRate. Extracted H264 codec defaults into the same constants file.Dynamic ingress payload type resolution: Introduced a
getIngressPayloadTypeCallbackthat queries the activewebrtcMediaConnectionfor the correct payload type per codec/media type at runtime, replacing the previously hardcoded0x80H264 payload type.AV1 codec info in media requests: Extended
MediaRequestManagerto build and include AV1WcmeCodecInfoentries alongside H264 whenenableAv1is set. AV1 encoding parameters are resolved from the requested frame size by mapping to the appropriate resolution bucket.Configuration and API surface: Added
enableAv1SlidesSupportconfig flag (defaultfalse), wired it throughMedia.createMediaConnectioninto the multistream connection config, and added_toggleEnableAv1SlidesSupport()on theMeetingsclass to toggle it before joining.Degradation support: AV1 codec parameters degrade in lockstep with H264 when the macroblock limit is exceeded, ensuring consistent quality reduction across codecs.
Test coverage: Comprehensive unit tests for AV1 resolution mapping, codec info generation, degradation behavior with AV1 enabled, payload type callback integration, and the new toggle API.
Change Type
The following scenarios were tested
enableAv1isfalse(default behavior unchanged)undefined)_toggleEnableAv1SlidesSupportcorrectly updates config and rejects non-boolean valuesenableAV1SlidesSupportflag is passed through toMultistreamConnectionConfigThe GAI Coding Policy And Copyright Annotation Best Practices
I certified that
Make sure to have followed the contributing guidelines before submitting.