Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add webcodecs IDL spec and generated code #16

Merged
merged 10 commits into from
May 3, 2022
Merged

Conversation

MaxDesiatov
Copy link
Contributor

@MaxDesiatov MaxDesiatov commented May 2, 2022

This is a requirement for webgl2, which I'm going to add in a future PR.

@MaxDesiatov MaxDesiatov added the enhancement New feature or request label May 2, 2022
@MaxDesiatov MaxDesiatov requested a review from j-f1 May 2, 2022 15:07
Base automatically changed from maxd/streams to main May 2, 2022 15:09
@MaxDesiatov MaxDesiatov marked this pull request as ready for review May 2, 2022 15:10
@MaxDesiatov
Copy link
Contributor Author

@j-f1 I needed a manual change in 6781702 to fix the absence of BitrateMode, not sure if this a bug in IDL, or the parser, or our generator?

@j-f1
Copy link
Member

j-f1 commented May 2, 2022

I recommend temporarily changing parse-all.js to output JSON.stringify(parsedFiles), and then running node parse-all.js > specs.json. You’ll be able to search for "name": "BitrateMode" in the resulting file, and then use VS Code’s “Go to Parent Fold” command to find that the BitrateMode type is defined in the mediastream-recording spec.

@MaxDesiatov
Copy link
Contributor Author

Marking this as draft until #19 is resolved.

@MaxDesiatov MaxDesiatov removed the request for review from j-f1 May 2, 2022 17:02
@MaxDesiatov MaxDesiatov marked this pull request as draft May 2, 2022 17:02
@MaxDesiatov MaxDesiatov marked this pull request as ready for review May 3, 2022 09:53
This is a requirement for `webgl2`, which I'm going to add in a future PR.
@MaxDesiatov MaxDesiatov changed the base branch from main to maxd/mediastream-recording May 3, 2022 10:08
Comment on lines 593 to 612
public class AudioTrack: JSBridgedClass {
@inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioTrack].function! }
public class AudioData: JSBridgedClass {
@inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioData].function! }
Copy link
Member

Choose a reason for hiding this comment

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

It looks like the types are being printed in different orders each time. This doesn’t have to be fixed for this PR tho, I’ll try to open a PR shortly

Copy link
Member

Choose a reason for hiding this comment

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

looking at this again (especially after reviewing the other PRs), I don’t think this is an actual problem. Not sure why the diff got messed up here but all the other PRs solely contain additive changes.

…eam-recording

# Conflicts:
#	Sources/DOMKit/Generated.swift
#	parse-idl/parse-all.js
…Kit into maxd/webcodecs

# Conflicts:
#	Sources/DOMKit/Generated.swift
Base automatically changed from maxd/mediastream-recording to main May 3, 2022 14:45
# Conflicts:
#	Sources/DOMKit/Generated.swift
#	parse-idl/parse-all.js
@j-f1
Copy link
Member

j-f1 commented May 3, 2022

Heads up that a few types have been disabled because they depend on specs not included in the initial PR, so feel free to remove any of these that work now:

// need types from specs not yet included
"ShadowAnimation", "MediaProvider", "Blob_or_MediaSource",
"OffscreenRenderingContext", "RenderingContext", "CanvasImageSource",
"HTMLOrSVGImageElement", "HTMLOrSVGScriptElement", "BodyInit",

// disabled pending addition of more specs
"HTMLMediaElement": ["srcObject"],
"Blob": ["stream"],
"Body": ["body"],

@MaxDesiatov
Copy link
Contributor Author

Checked that list, only CanvasImageSource can be auto-generated cleanly. OffscreenRenderingContext needs full WebGL2 spec to work in a related enum.

@MaxDesiatov MaxDesiatov enabled auto-merge (squash) May 3, 2022 14:59
@MaxDesiatov MaxDesiatov merged commit 4a0138b into main May 3, 2022
@MaxDesiatov MaxDesiatov deleted the maxd/webcodecs branch May 3, 2022 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants