Title: [252624] trunk/Source/WebCore
Revision
252624
Author
[email protected]
Date
2019-11-19 04:41:25 -0800 (Tue, 19 Nov 2019)

Log Message

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

Patch by Thibault Saunier <[email protected]> on 2019-11-19
Reviewed by Philippe Normand.

Avoid forcing a video conversion in software we end up and make
it happen in GL with a sensibly simpler pipeline, this is possible as
`glcolorconvert` properly setups the converted GL buffers.

Without that patch we are getting "random" not negotiated issues with
MediaStream sources related to the `GLMemory` caps feature during
renegotiation between the software `videoconvert` and our sink.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (252623 => 252624)


--- trunk/Source/WebCore/ChangeLog	2019-11-19 06:30:46 UTC (rev 252623)
+++ trunk/Source/WebCore/ChangeLog	2019-11-19 12:41:25 UTC (rev 252624)
@@ -1,3 +1,21 @@
+2019-11-19  Thibault Saunier  <[email protected]>
+
+        REGRESSION(r249428): [GStreamer] VP9 video rendered green
+        https://bugs.webkit.org/show_bug.cgi?id=201422
+
+        Reviewed by Philippe Normand.
+
+        Avoid forcing a video conversion in software we end up and make
+        it happen in GL with a sensibly simpler pipeline, this is possible as
+        `glcolorconvert` properly setups the converted GL buffers.
+
+        Without that patch we are getting "random" not negotiated issues with
+        MediaStream sources related to the `GLMemory` caps feature during
+        renegotiation between the software `videoconvert` and our sink.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL):
+
 2019-11-18  John Wilander  <[email protected]>
 
         Check if ITP is on before applying third-party cookie blocking

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp (252623 => 252624)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2019-11-19 06:30:46 UTC (rev 252623)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2019-11-19 12:41:25 UTC (rev 252624)
@@ -1200,12 +1200,6 @@
 
     gst_bin_add_many(GST_BIN(videoSink), upload, colorconvert, appsink, nullptr);
 
-    GRefPtr<GstCaps> caps = adoptGRef(gst_caps_from_string("video/x-raw, format = (string) " GST_GL_CAPS_FORMAT));
-    gst_caps_set_features(caps.get(), 0, gst_caps_features_new(GST_CAPS_FEATURE_MEMORY_GL_MEMORY, nullptr));
-    g_object_set(appsink, "caps", caps.get(), nullptr);
-
-    result &= gst_element_link_many(upload, colorconvert, appsink, nullptr);
-
     // 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
@@ -1218,22 +1212,22 @@
     // 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);
+    GRefPtr<GstCaps> caps;
+    if (webkitGstCheckVersion(1, 16, 2) || getenv("WEBKIT_GST_NO_RGBA_CONVERSION"))
+        caps = adoptGRef(gst_caps_from_string("video/x-raw, format = (string) " GST_GL_CAPS_FORMAT));
+    else {
+        GST_INFO_OBJECT(pipeline(), "Forcing RGBA as GStreamer is not new enough.");
+        caps = adoptGRef(gst_caps_from_string("video/x-raw, format = (string) RGBA"));
+    }
 
-        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);
+    gst_caps_set_features(caps.get(), 0, gst_caps_features_new(GST_CAPS_FEATURE_MEMORY_GL_MEMORY, nullptr));
+    g_object_set(appsink, "caps", caps.get(), nullptr);
 
-        GRefPtr<GstPad> pad = adoptGRef(gst_element_get_static_pad(capsFilter, "sink"));
-        gst_element_add_pad(videoSink, gst_ghost_pad_new("sink", pad.get()));
-    }
+    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()));
+
     if (!result) {
         GST_WARNING("Failed to link GstGL elements");
         gst_object_unref(videoSink);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to