haikuwebkit/LayoutTests/media/content
Miguel Gomez 75dc0ad3ad [GStreamer] Incorrect rendering of VP9 with transparency
https://bugs.webkit.org/show_bug.cgi?id=225961

Reviewed by Žan Doberšek.

Source/WebCore:

Fix the rendering of videos with transparency. This is done both AC and non AC modes and
with and without GSTREAMER_GL enabled.

On AC mode and using GSTREAMER_GL, a new option is added to TextureMapperGL and TextureMapperShaderProgram
to support premultiplying the components of a pixel. This is required because GStreamer uses straight alpha,
and we need it premultiplied in order to perform the correct blending blending of the video frames. Then we
use that new option to render video frames. This new option is also used when copying the video frame into
an external texture if premultiplyAlpha is requested.

On non AC mode, or when GStreamer-gl is disabled, add support to ImageGStreamerCairo to premultiply the alpha
of the video frame before creating the cairo surface to paint, and pass the appropriate composite operator when
drawing with alpha.

Test: media/video-with-alpha.html

* platform/graphics/gstreamer/GStreamerVideoFrameHolder.cpp:
(WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
* platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
(WebCore::ImageGStreamer::ImageGStreamer):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::pushTextureToCompositor):
(WebCore::MediaPlayerPrivateGStreamer::paint): update the caps of the conversion to make them match the format
expected by cairo, so we can avoid a component swap.
(WebCore::MediaPlayerPrivateGStreamer::copyVideoTextureToPlatformTexture):
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
(WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawTexture):
* platform/graphics/texmap/TextureMapperGL.h:
* platform/graphics/texmap/TextureMapperShaderProgram.cpp:
(WebCore::TextureMapperShaderProgram::create):
* platform/graphics/texmap/TextureMapperShaderProgram.h:

LayoutTests:

Add a test for the playback of transparent videos. This is initially skipped because it's not supported
on Apple ports and won't be working on GTK and WPE until GStreamer is bumped to 1.20.

* TestExpectations:
* media/content/video-with-alpha.webm: Added.
* media/video-with-alpha-expected.html: Added.
* media/video-with-alpha.html: Added.


Canonical link: https://commits.webkit.org/238313@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278276 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-31 13:33:16 +00:00
..
encrypted
720x576i-anamorphic.mov
CC+Subtitles.mov
abe.png
audio-describes-video.mp4
audio-tracks-alternate-group-with-fallback.mp4
audio-tracks-no-alternate-group.mp4
audio-tracks-some-in-alternate-group.mp4
audio-tracks.mp4
audio-tracks.ogg
audio-tracks.webm
bipbop-vp9.mp4
counting-captioned.mov
counting-subtitled-kate.ogv
counting-subtitled-srt.mkv
counting-subtitled.m4v
counting.jpg
counting.mp4
counting.ogv
create-id3-db [LayoutTests] Decouple http/tests/media/resources/create-id3-db.php from webserver 2021-05-11 00:41:50 +00:00
empty.oga
empty.wav
garbage.mp4
garbage.ogv
greenbox.png
long-test.mp4
long-test.ogv
lorem-ipsum.vtt [Modern Media Controls] REGRESSION(r254389) media controls needs the full list of language preferences for ordering tracks 2021-05-26 00:15:02 +00:00
metadata.json
no-rotation.mp4
pure-color-green.mp4
rotation-90.mp4
rotation-180.mp4
rotation-270.mp4
scaled-matrix.mov
short.wav
silence-loop.mov
silence.m4a
silence.mp3
silence.mpg
silence.oga
silence.wav
stpp.mp4
test-25fps.mp4
test-25fps.ogv
test-par-16-9.mp4
test-par-16-9.ogv
test-video-only.mp4
test.mp4
test.mp4.js
test.oga
test.ogv
test.wav
test_yuv420.mp4
test_yuv420.ogv
test_yuv422.mp4
test_yuv422.ogv
two-audio-and-video-tracks.mkv
unsupported_track.mov
video-as-img.mp4
video-with-alpha.webm [GStreamer] Incorrect rendering of VP9 with transparency 2021-05-31 13:33:16 +00:00