Closed Bug 1892785 Opened 2 months ago Closed 2 months ago

WebCodecs Encoder: Allow Reset() to reject promises during Flush()'s callback

Categories

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

defect

Tracking

()

RESOLVED FIXED
127 Branch
Tracking Status
firefox127 --- fixed

People

(Reporter: chunmin, Assigned: chunmin)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

In Bug 1839993, the issue of Reset() being unable to reject promises during Flush()'s callback in DecoderTemplate was resolved. Since most of the code in EncoderTemplate is copied from DecoderTemplate, it faces the same problem. This bug aims to address the same issue in EncoderTemplate.

The VP8 encoder, based on the libvpx API, is able to pass the
reset-during-flush WPT by change. However, tje H264 encoder, based on
the libx264 API, cannot. Therefore, adding the H264 encoder to the test
can expose the potential failures in the current EncoderTemplate code.
This addition enables us to assess whether subsequent patches
effectively resolve the issue.

Depends on D208188

Previously, Reset() lacked the ability to reject promises of the pending
flush requests during the output callback responsible for delivering the
result request. This limitation arose because once the promise was
transferred from the FlushMessage to the task delivering the flush's
result, there was no external access to that flush's promise outside of
the dispatched task.

This patch addresses this issue by implementing pending flush promises
as outlined in the WebCodecs spec, albeit with a slight modification,
allowing access to any stored pending promise as long as their
associated ID is provided. Conseqently, Reset() gains the capability to
reject all pending promises, while tasks with the corresponding IDs can
retrieve the promises to resolve or reject them based on their
requirements. The implementation aligns with its counterpart
implementation in DecoderTemplate [1].

[1] https://hg.mozilla.org/integration/autoland/rev/32b98903fcfb

Depends on D208189

See Also: → 1891897
Attachment #9397920 - Attachment description: WIP: Bug 1892785 - Add H264 codec to reset-during-flush WPT → Bug 1892785 - Add H264 codec to reset-during-flush WPT
Attachment #9397921 - Attachment description: WIP: Bug 1892785 - Alphabetize include headers → Bug 1892785 - Alphabetize include headers
Attachment #9397922 - Attachment description: WIP: Bug 1892785 - Allow Reset() to reject promises during Flush()'s callback → Bug 1892785 - Allow Reset() to reject promises during Flush()'s callback
Attachment #9397924 - Attachment description: WIP: Bug 1892785 - Remove unused FlushMessage member in DecoderTemplate → Bug 1892785 - Remove unused FlushMessage member in DecoderTemplate
Attachment #9397925 - Attachment description: WIP: Bug 1892785 - Revise comments for cleaning pending promises in DecoderTemplate → Bug 1892785 - Revise comments for cleaning pending promises in DecoderTemplate
Attachment #9397925 - Attachment description: Bug 1892785 - Revise comments for cleaning pending promises in DecoderTemplate → Bug 1892785 - Align comments in DecoderTemplate with those in EncoderTemplate
Pushed by cchang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7fa14088e1b4
Add H264 codec to reset-during-flush WPT r=media-playback-reviewers,padenot
https://hg.mozilla.org/integration/autoland/rev/05b8d9de3beb
Alphabetize include headers r=media-playback-reviewers,padenot
https://hg.mozilla.org/integration/autoland/rev/eeac4e97050a
Allow Reset() to reject promises during Flush()'s callback r=media-playback-reviewers,padenot
https://hg.mozilla.org/integration/autoland/rev/5cdecd63c396
Remove unused FlushMessage member in DecoderTemplate r=media-playback-reviewers,padenot
https://hg.mozilla.org/integration/autoland/rev/e5d1ebdf2a34
Align comments in DecoderTemplate with those in EncoderTemplate r=media-playback-reviewers,padenot
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/45898 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: