Closed Bug 2091696 Opened 18 days ago Closed 8 days ago

[wpt-sync] Sync PR 64965 - webcodecs: Fix VideoEncoder orientation tracking and keyframe generation

Categories

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

task

Tracking

()

RESOLVED FIXED
163 Branch
Tracking Status
firefox163 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 64965 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/64965
Details from upstream follow.

Dale Curtis <dalecurtis@chromium.org> wrote:

webcodecs: Fix VideoEncoder orientation tracking and keyframe generation

When VideoEncoder::configure() is called with a lightweight config
change that takes the ProcessReconfigure() (ChangeOptions) path,
first_input_transformation_ is reset so subsequent encode() calls can
use a new VideoFrame orientation. However, ProcessEncode() did not force
a keyframe when the input frame transformation changed, causing a new
VideoDecoderConfig with updated rotation/flip to be emitted on a delta
chunk.

Additionally, OnNewConfigure() previously reset
first_input_transformation_ before ParseConfigStatic(), allowing a
synchronously invalid configure() call to clear the active orientation
lock.

This change:

  1. Resets first_input_transformation_ in OnNewConfigure() only if
    ParseConfigStatic() succeeds without throwing.
  2. Tracks last_input_transformation_ in ProcessEncode() and sets
    encode_options.key_frame = true when the frame transformation
    changes, passing encode_options through OnReadbackDone() as well.

Fixed: 578577130
Change-Id: I8829088bec9677a144f2a3821b96e17b31d45dd5

Reviewed-on: https://chromium-review.googlesource.com/8747292
WPT-Export-Revision: 8df99dc424ec7faeb3256f770fbd5b356453d2d1

Whiteboard: [wptsync downstream] → [wptsync downstream error]
Component: web-platform-tests → Audio/Video: Web Codecs
Product: Testing → Core
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 2 tests and 23 subtests

Status Summary

Firefox

OK : 2
FAIL: 46

Chrome

OK : 2
PASS: 44
FAIL: 2

Safari

OK : 2
FAIL: 46

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /webcodecs/video-encoder-orientation.https.any.html [wpt.fyi]
    • Encode video frame with orientation: FAIL (Chrome: PASS, Safari: FAIL)
    • Encode video frames with different orientation has non-fatal failures: FAIL (Chrome: PASS, Safari: FAIL)
    • Encode video frames with different orientations after reconfigure: FAIL (Chrome: FAIL, Safari: FAIL)
    • The decoderConfig of an encoder fed with frames without orientation has no rotation and no flip: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an encoder fed with frames with a rotation of 0 and flip false has the rotation and flip: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an encoder fed with frames with a rotation of 0 and flip true has the rotation and flip: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an encoder fed with frames with a rotation of 90 and flip false has the rotation and flip: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an encoder fed with frames with a rotation of 90 and flip true has the rotation and flip: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an encoder fed with frames with a rotation of 180 and flip false has the rotation and flip: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an encoder fed with frames with a rotation of 180 and flip true has the rotation and flip: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an encoder fed with frames with a rotation of 270 and flip false has the rotation and flip: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an encoder fed with frames with a rotation of 270 and flip true has the rotation and flip: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig has the normalized rotation of the frames: FAIL (Chrome: PASS, Safari: FAIL)
    • Encoding a frame without orientation after a frame with an orientation throws a DataError: FAIL (Chrome: PASS, Safari: FAIL)
    • Encoding a rotated frame after a frame without orientation throws a DataError: FAIL (Chrome: PASS, Safari: FAIL)
    • A frame rejected for its orientation does not prevent matching frames from being encoded: FAIL (Chrome: PASS, Safari: FAIL)
    • configure() resets the orientation expected by the encoder: FAIL (Chrome: PASS, Safari: FAIL)
    • A new decoderConfig is given when the orientation of the encoded frames changes after a configure() that changes only the bitrate: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an output describes the orientation of its frame, not the orientation set by a later configure() that changes only the bitrate: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an output does not depend on the timestamp of its frame with a configure() that changes only the bitrate: FAIL (Chrome: PASS, Safari: FAIL)
    • A new decoderConfig is given when the orientation of the encoded frames changes after a configure() that changes more than the bitrate: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an output describes the orientation of its frame, not the orientation set by a later configure() that changes more than the bitrate: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an output does not depend on the timestamp of its frame with a configure() that changes more than the bitrate: FAIL (Chrome: PASS, Safari: FAIL)
  • /webcodecs/video-encoder-orientation.https.any.worker.html [wpt.fyi]
    • Encode video frame with orientation: FAIL (Chrome: PASS, Safari: FAIL)
    • Encode video frames with different orientation has non-fatal failures: FAIL (Chrome: PASS, Safari: FAIL)
    • Encode video frames with different orientations after reconfigure: FAIL (Chrome: FAIL, Safari: FAIL)
    • The decoderConfig of an encoder fed with frames without orientation has no rotation and no flip: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an encoder fed with frames with a rotation of 0 and flip false has the rotation and flip: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an encoder fed with frames with a rotation of 0 and flip true has the rotation and flip: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an encoder fed with frames with a rotation of 90 and flip false has the rotation and flip: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an encoder fed with frames with a rotation of 90 and flip true has the rotation and flip: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an encoder fed with frames with a rotation of 180 and flip false has the rotation and flip: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an encoder fed with frames with a rotation of 180 and flip true has the rotation and flip: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an encoder fed with frames with a rotation of 270 and flip false has the rotation and flip: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an encoder fed with frames with a rotation of 270 and flip true has the rotation and flip: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig has the normalized rotation of the frames: FAIL (Chrome: PASS, Safari: FAIL)
    • Encoding a frame without orientation after a frame with an orientation throws a DataError: FAIL (Chrome: PASS, Safari: FAIL)
    • Encoding a rotated frame after a frame without orientation throws a DataError: FAIL (Chrome: PASS, Safari: FAIL)
    • A frame rejected for its orientation does not prevent matching frames from being encoded: FAIL (Chrome: PASS, Safari: FAIL)
    • configure() resets the orientation expected by the encoder: FAIL (Chrome: PASS, Safari: FAIL)
    • A new decoderConfig is given when the orientation of the encoded frames changes after a configure() that changes only the bitrate: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an output describes the orientation of its frame, not the orientation set by a later configure() that changes only the bitrate: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an output does not depend on the timestamp of its frame with a configure() that changes only the bitrate: FAIL (Chrome: PASS, Safari: FAIL)
    • A new decoderConfig is given when the orientation of the encoded frames changes after a configure() that changes more than the bitrate: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an output describes the orientation of its frame, not the orientation set by a later configure() that changes more than the bitrate: FAIL (Chrome: PASS, Safari: FAIL)
    • The decoderConfig of an output does not depend on the timestamp of its frame with a configure() that changes more than the bitrate: FAIL (Chrome: PASS, Safari: FAIL)
Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/e95dc2fca948 https://hg.mozilla.org/integration/autoland/rev/2de520303fbd [wpt PR 64965] - webcodecs: Fix VideoEncoder orientation tracking and keyframe generation, a=testonly
Status: NEW → RESOLVED
Closed: 8 days ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch
You need to log in before you can comment on or make changes to this bug.