Define video color space interfaces and members#306
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
| [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.
For YUV and RGB formats respectively.
There was a problem hiding this comment.
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).
chcunningham
left a comment
There was a problem hiding this comment.
Mostly done. Just needs definitions for the enums. @sandersdan a few questions for you in here.
index.src.html
Outdated
| [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.
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.
@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.
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.
|
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