Closed Bug 1902115 Opened 9 months ago Closed 8 months ago

Implement convert-to-RGB-frame for VideoFrame copyto method

Categories

(Core :: Audio/Video: Web Codecs, task, P1)

task

Tracking

()

RESOLVED FIXED
130 Branch
Tracking Status
firefox130 --- fixed

People

(Reporter: chunmin, Assigned: chunmin)

References

(Blocks 1 open bug)

Details

Attachments

(15 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
13.36 KB, text/html
Details

Currently most WPTs in videoFrame-copyTo-rgb fail. We make it work unless some underlying image formats are unsupported.


update: The display-p3 color conversion will be fixed in bug 1904471 instead.

VideoFrameCopyToOptions has to be updated to meet the latest spec:

dictionary VideoFrameCopyToOptions {
  DOMRectInit rect;
  sequence<PlaneLayout> layout;
  VideoPixelFormat format;
  PredefinedColorSpace colorSpace;
};

The spec was changed in https://github.com/w3c/webcodecs/pull/754

Summary: Fix videoFrame-copyTo-rgb WPT failures → Update VideoFrame webidl to meet latest spec
Summary: Update VideoFrame webidl to meet latest spec → Update VideoFrame to meet latest copyto spec
Blocks: VideoFrame
Depends on: 1902157

This patch updates the error type in ParseVideoFrameCopyToOptions to
MediaResult. A subsequent patch will introduce the use of
NotSupportedError for unsupported formats instead of TypeError. This
change helps clarify the conditions under which NotSupportedError will
be employed.

This patch updates the VideoFrameCopyToOptions webidl to meet the
changes in WebCodecs PR 754 [1].

[1] https://github.com/w3c/webcodecs/pull/754

Depends on D213804

This patch updates the ParseVideoFrameCopyToOptions to the changes
made in WebCodecs PR 754 [1].

[1] https://github.com/w3c/webcodecs/pull/754

Depends on D213805

Attachment #9407571 - Attachment description: WIP: Bug 1902115 - Update ParseVideoFrameCopyToOptions error type to MediaResult → Bug 1902115 - Update ParseVideoFrameCopyToOptions error type to MediaResult
Attachment #9407572 - Attachment description: WIP: Bug 1902115 - Update VideoFrameCopyToOptions webidl → Bug 1902115 - Update VideoFrameCopyToOptions webidl
Attachment #9407573 - Attachment description: WIP: Bug 1902115 - Update ParseVideoFrameCopyToOptions → Bug 1902115 - Update ParseVideoFrameCopyToOptions
Attachment #9407571 - Attachment description: Bug 1902115 - Update ParseVideoFrameCopyToOptions error type to MediaResult → WIP: Bug 1902115 - Update ParseVideoFrameCopyToOptions error type to MediaResult
Attachment #9407572 - Attachment description: Bug 1902115 - Update VideoFrameCopyToOptions webidl → WIP: Bug 1902115 - Update VideoFrameCopyToOptions webidl
Attachment #9407573 - Attachment description: Bug 1902115 - Update ParseVideoFrameCopyToOptions → WIP: Bug 1902115 - Update ParseVideoFrameCopyToOptions

This patch implements the convert-to-RGB-frame algorithm [1] and
introduces it to copyto method to meet the latest spec [2].

[1] https://w3c.github.io/webcodecs/#videoframe-convert-to-rgb-frame
[2] https://w3c.github.io/webcodecs/#dom-videoframe-copyto

Depends on D214199

This patch implements a helper function for copyto method,
clone-configuration algorithm for VideoFrameCopyToOptions.

Depends on D214200

Depends on D214201

Depends on D214202

Attachment #9408319 - Attachment description: WIP: Bug 1902115 - Implement ConvertImage → WIP: Bug 1902115 - Implement ConvertToRGBAImage

Depends on D214440

Depends on D214441

Blocks: 1904470
Attachment #9409539 - Attachment description: WIP: Bug 1902115 - No conversion if colors and formats are same → WIP: Bug 1902115 - No conversion needed if colors and formats are same
No longer blocks: 1904470

This patch refactors the tests in videoFrame-copyTo-rgb.any.js by
separating them according to the color space specified in the
VideoFrame. Previously, VideoFrame instances with different color spaces
were combined into a single test. Now, each color space specified in a
VideoFrame has its own dedicated test. This division facilitates easier
identification of missing color conversion and provides cleared insights
into completed and pending work for the following patches.

Attachment #9409832 - Attachment description: WIP: Bug 1902115 - Refactor VideoFrame.copyTo Tests by colorppace → WIP: Bug 1902115 - Refactor VideoFrame.copyTo Tests by colorspace

In makeI420Frames, there is a VideoFrame created without meaningful
YUV data. This redundant creation should be removed.

Depends on D214882

Attachment #9409832 - Attachment description: WIP: Bug 1902115 - Refactor VideoFrame.copyTo Tests by colorspace → Bug 1902115 - Refactor VideoFrame.copyTo Tests by colorspace
Attachment #9407571 - Attachment description: WIP: Bug 1902115 - Update ParseVideoFrameCopyToOptions error type to MediaResult → Bug 1902115 - Update ParseVideoFrameCopyToOptions error type to MediaResult
Attachment #9407572 - Attachment description: WIP: Bug 1902115 - Update VideoFrameCopyToOptions webidl → Bug 1902115 - Update VideoFrameCopyToOptions webidl
Attachment #9407573 - Attachment description: WIP: Bug 1902115 - Update ParseVideoFrameCopyToOptions → Bug 1902115 - Update ParseVideoFrameCopyToOptions
Attachment #9408315 - Attachment description: WIP: Bug 1902115 - Alphabetize forward declarations in VideoFrame.cpp → Bug 1902115 - Alphabetize forward declarations in VideoFrame.cpp
Attachment #9408316 - Attachment description: WIP: Bug 1902115 - Implement convert-to-RGB-frame for copyto method → Bug 1902115 - Implement convert-to-RGB-frame for copyto method
Attachment #9408317 - Attachment description: WIP: Bug 1902115 - Implement clone-configuration for VideoFrameCopyToOptions → Bug 1902115 - Implement clone-configuration for VideoFrameCopyToOptions
Attachment #9408318 - Attachment description: WIP: Bug 1902115 - Implement ConvertToColorSpace → Bug 1902115 - Implement ConvertToColorSpace
Attachment #9408319 - Attachment description: WIP: Bug 1902115 - Implement ConvertToRGBAImage → Bug 1902115 - Implement ConvertToRGBAImage
Attachment #9408715 - Attachment description: WIP: Bug 1902115 - Alphabetize include headers in ImageConversion.cpp → Bug 1902115 - Alphabetize include headers in ImageConversion.cpp
Attachment #9408716 - Attachment description: WIP: Bug 1902115 - Implement ConvertToRGBA → Bug 1902115 - Implement ConvertToRGBA
Attachment #9408771 - Attachment description: WIP: Bug 1902115 - Update WPT expectations → Bug 1902115 - Update WPT expectations
Attachment #9409539 - Attachment description: WIP: Bug 1902115 - No conversion needed if colors and formats are same → Bug 1902115 - No conversion needed if colors and formats are same
Attachment #9410037 - Attachment description: WIP: Bug 1902115 - Remove unnecessary I420 VideoFrame creation → Bug 1902115 - Remove unnecessary I420 VideoFrame creation

This is a visualized test page I used to debug during the development.

Blocks: 1904471
Attachment #9410037 - Attachment description: Bug 1902115 - Remove unnecessary I420 VideoFrame creation → WIP: Bug 1902115 - Remove unnecessary I420 VideoFrame creation
Attachment #9410037 - Attachment description: WIP: Bug 1902115 - Remove unnecessary I420 VideoFrame creation → Bug 1902115 - Remove unnecessary I420 VideoFrame creation
Summary: Update VideoFrame to meet latest copyto spec → Implement convert-to-RGB-frame for VideoFrame copyto method
Pushed by cchang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5083bce859c9 Refactor VideoFrame.copyTo Tests by colorspace r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/cb18d1d362be Update ParseVideoFrameCopyToOptions error type to MediaResult r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/e789b595dd0f Update VideoFrameCopyToOptions webidl r=webidl,media-playback-reviewers,smaug,padenot https://hg.mozilla.org/integration/autoland/rev/9fe5e83ee26c Update ParseVideoFrameCopyToOptions r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/97ae0a4994b5 Alphabetize forward declarations in VideoFrame.cpp r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/8e23738fdfd5 Implement convert-to-RGB-frame for copyto method r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/95b839237bae Implement clone-configuration for VideoFrameCopyToOptions r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/6aed2000e65f Implement ConvertToColorSpace r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/085ecd57565b Implement ConvertToRGBAImage r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/f20aa24e0334 Alphabetize include headers in ImageConversion.cpp r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/8388eea038fe Implement ConvertToRGBA r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/e4f215f2955b Update WPT expectations r=padenot https://hg.mozilla.org/integration/autoland/rev/22d5e85f3c3b No conversion needed if colors and formats are same r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/2da61495720a Remove unnecessary I420 VideoFrame creation r=media-playback-reviewers,padenot
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/47068 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: