Closed Bug 1774302 Opened 2 years ago Closed 2 years ago

Make VideoFrame Serializable

Categories

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

task

Tracking

()

RESOLVED FIXED
108 Branch
Tracking Status
firefox108 --- fixed

People

(Reporter: chunmin, Assigned: chunmin)

References

(Blocks 1 open bug)

Details

Attachments

(7 files)

After VideoFrame is implemented (bug 1774300), we need to make it Serializable (in .webidl)

Severity: -- → S3
Priority: -- → P1

This patch add Serializable attribute to VideoFrame and add some
necessary changes to make this buildable.

Some expectations of video-frame-serialization.any.is's wpts are
changed to PASS since they are implemented in bug 1774300.

The Verify posting closed frames throws is currently passed by luck so
the its expectation stays the same.

This patch implements {Read, Write}StructuredClone for VideoFrame so
VideoFrame can be {de,}serialized.

Depends on D153685

Attachment #9288402 - Attachment description: WIP: Bug 1774302 - Add [Serializable] to VideoFrame → Bug 1774302 - Add [Serializable] to VideoFrame
Attachment #9288403 - Attachment description: WIP: Bug 1774302 - Implement [Serializable] for VideoFrame → Bug 1774302 - Implement [Serializable] for VideoFrame
Attachment #9298922 - Attachment description: Bug 1774302 - Add a wpt postinf VideoFrame across agent cluster boundaries → Bug 1774302 - Add a wpt posting VideoFrame across agent cluster boundaries
Depends on: 1797205

By using --disable-e10s, VideoFrame can be serialized in same process
but in different origins. To prevent the VideoFrame from being passed
across different origins, origins should be checked before constructing
a VideoFrame.

Depends on D159546

Attachment #9300253 - Attachment description: Bug 1774302 - Add wpt passing VideoFrame between main and worker → Bug 1774302 - Add a wpt passing VideoFrame between main and worker
Blocks: 1797557
Pushed by cchang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7328aadd86e9
Add missing thread-safety checks r=padenot
https://hg.mozilla.org/integration/autoland/rev/0009cdcc3e11
Add [Serializable] to VideoFrame r=padenot,smaug
https://hg.mozilla.org/integration/autoland/rev/3db9d390aa0d
Implement [Serializable] for VideoFrame r=padenot,smaug
https://hg.mozilla.org/integration/autoland/rev/5a2fc97cac78
Add a wpt posting VideoFrame across agent cluster boundaries r=padenot,smaug
https://hg.mozilla.org/integration/autoland/rev/b94e43f1e91f
Add a wpt passing VideoFrame between main and worker r=smaug
https://hg.mozilla.org/integration/autoland/rev/6ff613ee0977
Ensure videoframe serialization is same-origin r=smaug
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/36672 for changes under testing/web-platform/tests

Backed out 6 changesets (Bug 1774302) for causing bustages on VideoFrame.cpp.
Backout link
Push with failures <--> H
Failure Log

Flags: needinfo?(cchang)
Upstream PR was closed without merging

To avoid an rooting hazard error from returning a raw JSObject* before
running the RefPtr<VidoeFrame>'s destructor, the RefPtr<VideoFrame>
needs to be destroyed before returning the raw JSObject*

Depends on D160155

D160561 should be able to fix the hazard issue.

Flags: needinfo?(cchang)
Attachment #9300644 - Attachment description: Bug 1774302 - Fix unrooted returned JSObject* in VideoFrame → Bug 1774302 - Fix unrooted return value in VideoFrame deserialization
Pushed by cchang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a91b2c948b8d
Add missing thread-safety checks r=padenot
https://hg.mozilla.org/integration/autoland/rev/89993b673e0f
Add [Serializable] to VideoFrame r=padenot,smaug
https://hg.mozilla.org/integration/autoland/rev/2deaf376e1b8
Implement [Serializable] for VideoFrame r=padenot,smaug
https://hg.mozilla.org/integration/autoland/rev/ac7ae2db38ed
Add a wpt posting VideoFrame across agent cluster boundaries r=padenot,smaug
https://hg.mozilla.org/integration/autoland/rev/5b95b1a7c673
Add a wpt passing VideoFrame between main and worker r=smaug
https://hg.mozilla.org/integration/autoland/rev/e880fd8436cc
Ensure videoframe serialization is same-origin r=smaug
https://hg.mozilla.org/integration/autoland/rev/8399201e3b08
Fix unrooted return value in VideoFrame deserialization r=sfink
Upstream PR merged by moz-wptsync-bot
Blocks: 1805103
Blocks: 1805104
Regressions: 1815519
Component: Audio/Video → Audio/Video: Web Codecs
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: