Closed Bug 1838984 Opened 2 years ago Closed 2 years ago

Support [Serializable] for EncodedVideoChunk

Categories

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

task

Tracking

()

RESOLVED FIXED
117 Branch
Tracking Status
firefox117 --- fixed

People

(Reporter: chunmin, Assigned: chunmin)

References

(Blocks 1 open bug)

Details

Attachments

(10 files)

Bug 1838958 implements a basic EncodedVideoChunk without [Serializable]. [Serializable] will be implemented in this bug.

Blocks: VideoDecoder
Component: Audio/Video → Audio/Video: Web Codecs

This patch add Serializable to EncodedVideoChunk interface with some
dummy functions to make it buildable. The (de-)serialization function
will be implemented in the following patches.

Depends on D182843

EncodedVideoChunk serialization will take a reference to the data
stored in the chunk. Using MediaByteBuffer is a better choice for data
storage since it implies it can be shared.

Attachment #9342480 - Attachment description: Bug 1838984 - Add Serializable to EncodedVideoChunk → WIP: Bug 1838984 - Add Serializable to EncodedVideoChunk
Blocks: 1842116

This patch addes a MediaAlignedByteBuffer class that is a ref-counted
AlignedByteBuffer. It will be used in the next patch.

Attachment #9342481 - Attachment description: WIP: Bug 1838984 - Store EncodedVideoChunk data in MediaByteBuffer → Bug 1838984 - Store EncodedVideoChunk data in MediaAlignByteBuffer
Attachment #9342480 - Attachment description: WIP: Bug 1838984 - Add Serializable to EncodedVideoChunk → Bug 1838984 - Add Serializable to EncodedVideoChunk

This patch implements {Read, Write}StructuredClone for
EncodedVideoChunk in the custom fashion to achieve [Serializable] in
EncodeVideoChunk interface.

The data stored in EncodedVideoChunk will be share between the
serialization side and de-serialization side to avoid copy for
performance sake.

Depends on D182844

Depends on D182954

Attachment #9342806 - Attachment description: WIP: Bug 1838984 - Add more EncodedVideoChunk serialization WPTs → Bug 1838984 - Add more EncodedVideoChunk serialization WPTs
See Also: → 1842713

This patch addes a same-origin check for EncodedVideoChunk
serialization. The check is done by comparing the worker's loading
principal with the global's one.

Depends on D183035

Attachment #9343611 - Attachment description: Bug 1838984 - Add same-origin check for EncodedVideoChunk serialization → Bug 1838984 - Add intra-cluster-shared-object-allowed for serialization

This service worker will be reused for EncodedVideoChunk's WPT in
patches later, so the file name should remove the VideoFrame prefix.

Depends on D182955

The service worker will no longer be used for VideoFrame only. In the
next patch, it will receive some messages from EncodedVideoChunk's WPTs
as well, so distinguishing messages for VideoFrame from others is
necessary.

Depends on D184133

Pushed by cchang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c3d88665dcae Introduce MediaAlignedByteBuffer r=media-playback-reviewers,alwu https://hg.mozilla.org/integration/autoland/rev/69b480c29c30 Store EncodedVideoChunk data in MediaAlignByteBuffer r=padenot https://hg.mozilla.org/integration/autoland/rev/ad7f9efb9030 Add Serializable to EncodedVideoChunk r=emilio https://hg.mozilla.org/integration/autoland/rev/02c281ff169f Implement Serializable for EncodedVideoChunk r=webidl,smaug https://hg.mozilla.org/integration/autoland/rev/a8daccb99e00 Enable EncodedVideoChunk serialization WPT r=padenot https://hg.mozilla.org/integration/autoland/rev/6c009875a7be Rename service-worker file for general usage r=smaug https://hg.mozilla.org/integration/autoland/rev/17ace6afea6f Label messages for VideoFrame in service-worker r=smaug https://hg.mozilla.org/integration/autoland/rev/cc1f6a7cd4fe Add more EncodedVideoChunk serialization WPTs r=smaug https://hg.mozilla.org/integration/autoland/rev/a2573ef16190 Add service-worker WPTs for EncodedVideoChunk serialization r=smaug https://hg.mozilla.org/integration/autoland/rev/0c46013a7260 Add intra-cluster-shared-object-allowed for serialization r=smaug,padenot
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/41141 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: