-
Notifications
You must be signed in to change notification settings - Fork 143
Define video color space interfaces and members #306
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
Conversation
For now it's just the basic IDL. Out of time tonight, but wanted to get this out for discussion tomorrow. The enums are just a start - more to come there (probably in a follow up) aligning with H.273. @sandersdan FYI |
@sandersdan - looking at For changing color space (getting dict version of the interface), @padenot mentioned the pattern in WebRTC has been to use Object.assign(), for example |
|
index.src.html
Outdated
@@ -2685,6 +2695,9 @@ | |||
// Default display dimensions match visibleRect. | |||
[EnforceRange] unsigned long displayWidth; | |||
[EnforceRange] unsigned long displayHeight; | |||
|
|||
// Defaults to Rec709 or SRGB for planar and interleaved formats respectively. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For YUV and RGB formats respectively.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've deleted this comment now, but see how I've implemented the "Pick Color Space" algo (choose sRGB if it's an RGB format, otherwise choose rec709).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly done. Just needs definitions for the enums. @sandersdan a few questions for you in here.
index.src.html
Outdated
@@ -2685,6 +2695,9 @@ | |||
// Default display dimensions match visibleRect. | |||
[EnforceRange] unsigned long displayWidth; | |||
[EnforceRange] unsigned long displayHeight; | |||
|
|||
// Defaults to Rec709 or SRGB for planar and interleaved formats respectively. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've deleted this comment now, but see how I've implemented the "Pick Color Space" algo (choose sRGB if it's an RGB format, otherwise choose rec709).
index.src.html
Outdated
1. If {{VideoEncoder/[[active color space]]}} is `null`: | ||
1. If |frame|.{{VideoFrame/colorSpace}} is not `null`, assign it's value | ||
to {{VideoEncoder/[[active color space]]}}. | ||
2. ISSUE: what here? 709? Can we trust that frame.colorSpace is not null? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sandersdan thoughts? I we discussed it being null in some cases, like if you were creating from an internal videoframe that had some non-compatible representation? I wasn't able to quickly find cases in our impl where this actually occurs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct, an implementation could produce a VideoFrame with no JS-exposed color space. In Chrome that can happen easily with the current implementation because the WebCodecs implementation only supports a subset of color spaces (BT. 601, BT. 709, and sRGB), but if/when it's expanded to all of H.273 it would only happen for frames that are in a non-H.273 color space (currently not possible in Chrome).
Merge conflicts resolved, minor fixes applied. @padenot PTAL. |
I think I prefer the parent nullable, as-is, but I'm flexible. Sorry, ran out time here. @sandersdan, here's an outline of todos:
|
TODOs fixed, PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EC: @aboba defers to Paul. LGTM |
SHA: df0a9ce Reason: push, by @chcunningham Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: df0a9ce Reason: push, by @chcunningham Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: df0a9ce Reason: push, by @chcunningham Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: df0a9ce Reason: push, by @chcunningham Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: df0a9ce Reason: push, by @chcunningham Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: df0a9ce Reason: push, by @chcunningham Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: df0a9ce Reason: push, by @chcunningham Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: df0a9ce Reason: push, by @chcunningham Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: df0a9ce Reason: push, by @chcunningham Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: df0a9ce Reason: push, by @chcunningham Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Fixes #47
:)
Preview | Diff