Title: [279873] trunk/Source/WebCore
Revision
279873
Author
[email protected]
Date
2021-07-13 09:33:26 -0700 (Tue, 13 Jul 2021)

Log Message

[GStreamer] Allow runtime opt-out of GL rendering
https://bugs.webkit.org/show_bug.cgi?id=227873

Patch by Philippe Normand <[email protected]> on 2021-07-13
Reviewed by Xabier Rodriguez-Calvar.

In some cases GL rendering is not really useful, such as on machines without GPU. In those
cases currently Mesa's llvmpipe is used, introducing CPU and RAM usage increase compared to
the non-gl rendering path. For these cases the user can set a new env var,
WEBKIT_GST_DISABLE_GL_SINK=1, allowing the player to use the Cairo sink.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (279872 => 279873)


--- trunk/Source/WebCore/ChangeLog	2021-07-13 14:19:38 UTC (rev 279872)
+++ trunk/Source/WebCore/ChangeLog	2021-07-13 16:33:26 UTC (rev 279873)
@@ -1,3 +1,18 @@
+2021-07-13  Philippe Normand  <[email protected]>
+
+        [GStreamer] Allow runtime opt-out of GL rendering
+        https://bugs.webkit.org/show_bug.cgi?id=227873
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        In some cases GL rendering is not really useful, such as on machines without GPU. In those
+        cases currently Mesa's llvmpipe is used, introducing CPU and RAM usage increase compared to
+        the non-gl rendering path. For these cases the user can set a new env var,
+        WEBKIT_GST_DISABLE_GL_SINK=1, allowing the player to use the Cairo sink.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::createVideoSinkGL):
+
 2021-07-13  Carlos Garcia Campos  <[email protected]>
 
         [GTK][WPE] Expose support for client certificate auth

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (279872 => 279873)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2021-07-13 14:19:38 UTC (rev 279872)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2021-07-13 16:33:26 UTC (rev 279873)
@@ -3354,6 +3354,12 @@
 #if USE(GSTREAMER_GL)
 GstElement* MediaPlayerPrivateGStreamer::createVideoSinkGL()
 {
+    const char* disableGLSink = g_getenv("WEBKIT_GST_DISABLE_GL_SINK");
+    if (disableGLSink && equal(disableGLSink, "1")) {
+        GST_INFO("Disabling hardware-accelerated rendering per user request.");
+        return nullptr;
+    }
+
     if (!webKitGLVideoSinkProbePlatform()) {
         g_warning("WebKit wasn't able to find the GL video sink dependencies. Hardware-accelerated zero-copy video rendering can't be enabled without this plugin.");
         return nullptr;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to