Closed Bug 1879668 Opened 1 year ago Closed 1 year ago

[macOS] new video layers are blank for first frame, visible during fullscreen transitions

Categories

(Core :: Graphics, defect, P3)

defect

Tracking

()

RESOLVED FIXED
124 Branch
Tracking Status
firefox124 --- fixed

People

(Reporter: bradwerth, Assigned: bradwerth)

References

(Depends on 1 open bug)

Details

Attachments

(2 files)

As noted in Bug 1839425, and partially addressed there, macOS video layers sometimes are blanked out during a fullscreen transition. The core issue here is that a new AVSampleBufferDisplayLayer video surface is added initially with no visible content, and the fullscreen transition will sometimes create a new video surface as part of its normal operation. Thus, macOS fullscreen transitions sometimes show a blank video element.

Possible fixes:

  1. Ensure that a new video surface has content before its first paint.
  2. Delay the fullscreen transition until the newly-created surfaces all have content.
  3. Don't resize the windowed content before transitioning to fullscreen -- the resizing sometimes causes the re-creation of the video layer. Not sure what to do on the way back from fullscreen.

Option 1 is the best option, but may run afoul of the the fundamental asynchronous update model of the video layers. I'll pursue that first as the most comprehensive solution to the problem, and if that option doesn't work, then I'll try one of the other options.

And another long-term option for fixing this:

  1. Make WebRender pass through some source key information for external textures, such that layer managers could detect when a layer is merely being resized/repositioned and not have to destroy and recreate a layer for the same source.

This option would generally cut down on the layer recreation labor, though it's probably true that transition to fullscreen is the most typical use case where an external texture would be resized, and that transition is not done with high frequency within the timeframe of a user session.

Pushed by bwerth@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/84610d2d592b Force macOS video layers to show their first frame before first paint. r=mstange
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 124 Branch
QA Whiteboard: [qa-124b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: