Skip to content
Permalink
Browse files
REGRESSION(r249428): [GStreamer] VP9 video rendered green
https://bugs.webkit.org/show_bug.cgi?id=201422
<rdar://problem/55945741>

Patch by Philippe Normand <philn@igalia.com> on 2019-11-06
Reviewed by Carlos Garcia Campos.

Enable the texture upload GStreamer meta code path. Until
GStreamer 1.16.2 this workaround is needed to fix VP9 (vp9dec)
rendering. For downstream users cherry-picking the corresponding
GStreamer patch[0], an environment variable can be set to bypass
the reintroduced slow color conversion: $WEBKIT_GST_NO_RGBA_CONVERSION.

[0] https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/commit/8d32de090554cf29fe359f83aa46000ba658a693

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL):

Canonical link: https://commits.webkit.org/217243@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252134 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
philn authored and carlosgcampos committed Nov 6, 2019
1 parent 0a158a3 commit 15f7621bf186d00c2a76041a0ff228a5fd3ea522
Showing with 46 additions and 2 deletions.
  1. +19 −0 Source/WebCore/ChangeLog
  2. +27 −2 Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
@@ -1,3 +1,22 @@
2019-11-06 Philippe Normand <philn@igalia.com>

REGRESSION(r249428): [GStreamer] VP9 video rendered green
https://bugs.webkit.org/show_bug.cgi?id=201422
<rdar://problem/55945741>

Reviewed by Carlos Garcia Campos.

Enable the texture upload GStreamer meta code path. Until
GStreamer 1.16.2 this workaround is needed to fix VP9 (vp9dec)
rendering. For downstream users cherry-picking the corresponding
GStreamer patch[0], an environment variable can be set to bypass
the reintroduced slow color conversion: $WEBKIT_GST_NO_RGBA_CONVERSION.

[0] https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/commit/8d32de090554cf29fe359f83aa46000ba658a693

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL):

2019-11-06 youenn fablet <youenn@apple.com>

There is no need to clean the content type header of a request if it is null
@@ -1206,8 +1206,33 @@ GstElement* MediaPlayerPrivateGStreamerBase::createVideoSinkGL()

result &= gst_element_link_many(upload, colorconvert, appsink, nullptr);

GRefPtr<GstPad> pad = adoptGRef(gst_element_get_static_pad(upload, "sink"));
gst_element_add_pad(videoSink, gst_ghost_pad_new("sink", pad.get()));
// Workaround until we can depend on GStreamer 1.16.2.
// https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/commit/8d32de090554cf29fe359f83aa46000ba658a693
// Forcing a color conversion to RGBA here allows glupload to internally use
// an uploader that adds a VideoMeta, through the TextureUploadMeta caps
// feature, without needing the patch above. However this specific caps
// feature is going to be removed from GStreamer so it is considered a
// short-term workaround. This code path most likely will have a negative
// performance impact on embedded platforms as well. Downstream embedders
// are highly encouraged to cherry-pick the patch linked above in their BSP
// and set the WEBKIT_GST_NO_RGBA_CONVERSION environment variable until
// GStreamer 1.16.2 is released.
// See also https://bugs.webkit.org/show_bug.cgi?id=201422
if (webkitGstCheckVersion(1, 16, 2) || getenv("WEBKIT_GST_NO_RGBA_CONVERSION")) {
GRefPtr<GstPad> pad = adoptGRef(gst_element_get_static_pad(upload, "sink"));
gst_element_add_pad(videoSink, gst_ghost_pad_new("sink", pad.get()));
} else {
GstElement* capsFilter = gst_element_factory_make("capsfilter", nullptr);
GRefPtr<GstCaps> caps = adoptGRef(gst_caps_from_string("video/x-raw, format=RGBA"));
g_object_set(capsFilter, "caps", caps.get(), nullptr);

GstElement* videoconvert = gst_element_factory_make("videoconvert", nullptr);
gst_bin_add_many(GST_BIN_CAST(videoSink), capsFilter, videoconvert, nullptr);
result &= gst_element_link_many(capsFilter, videoconvert, upload, nullptr);

GRefPtr<GstPad> pad = adoptGRef(gst_element_get_static_pad(capsFilter, "sink"));
gst_element_add_pad(videoSink, gst_ghost_pad_new("sink", pad.get()));
}

if (!result) {
GST_WARNING("Failed to link GstGL elements");

0 comments on commit 15f7621

Please sign in to comment.