Title: [268790] trunk/Source/WebCore
Revision
268790
Author
[email protected]
Date
2020-10-21 03:50:48 -0700 (Wed, 21 Oct 2020)

Log Message

[GStreamer] Create video sink only for video player
https://bugs.webkit.org/show_bug.cgi?id=217974

Reviewed by Xabier Rodriguez-Calvar.

There's no need for a video sink when the media player is created for an <audio> element.

* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::initializeGStreamerAndRegisterWebKitElements): Downrank the GL video sink, as we
create it on-demand and not through autovideosink anyway.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Avoid creating useless video sink.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (268789 => 268790)


--- trunk/Source/WebCore/ChangeLog	2020-10-21 08:17:53 UTC (rev 268789)
+++ trunk/Source/WebCore/ChangeLog	2020-10-21 10:50:48 UTC (rev 268790)
@@ -1,3 +1,18 @@
+2020-10-21  Philippe Normand  <[email protected]>
+
+        [GStreamer] Create video sink only for video player
+        https://bugs.webkit.org/show_bug.cgi?id=217974
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        There's no need for a video sink when the media player is created for an <audio> element.
+
+        * platform/graphics/gstreamer/GStreamerCommon.cpp:
+        (WebCore::initializeGStreamerAndRegisterWebKitElements): Downrank the GL video sink, as we
+        create it on-demand and not through autovideosink anyway.
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Avoid creating useless video sink.
+
 2020-10-20  Julian Gonzalez  <[email protected]>
 
         Release assert in ~Node due to render element of pseudo element not getting removed in time

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp (268789 => 268790)


--- trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp	2020-10-21 08:17:53 UTC (rev 268789)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp	2020-10-21 10:50:48 UTC (rev 268790)
@@ -317,7 +317,7 @@
 #if ENABLE(VIDEO)
         gst_element_register(0, "webkitwebsrc", GST_RANK_PRIMARY + 100, WEBKIT_TYPE_WEB_SRC);
 #if USE(GSTREAMER_GL)
-        gst_element_register(0, "webkitglvideosink", GST_RANK_PRIMARY, WEBKIT_TYPE_GL_VIDEO_SINK);
+        gst_element_register(0, "webkitglvideosink", GST_RANK_NONE, WEBKIT_TYPE_GL_VIDEO_SINK);
 #endif
 #endif
         // We don't want autoaudiosink to autoplug our sink.

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


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2020-10-21 08:17:53 UTC (rev 268789)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2020-10-21 10:50:48 UTC (rev 268790)
@@ -2729,6 +2729,7 @@
 
 void MediaPlayerPrivateGStreamer::createGSTPlayBin(const URL& url, const String& pipelineName)
 {
+    GST_INFO("Creating pipeline for %s player", m_player->isVideoPlayer() ? "video" : "audio");
     const char* playbinName = "playbin";
 
     // MSE doesn't support playbin3. Mediastream requires playbin3. Regular
@@ -2813,7 +2814,9 @@
 
     g_object_set(m_pipeline.get(), "text-sink", m_textAppSink.get(), nullptr);
 
-    g_object_set(m_pipeline.get(), "video-sink", createVideoSink(), "audio-sink", createAudioSink(), nullptr);
+    g_object_set(m_pipeline.get(), "audio-sink", createAudioSink(), nullptr);
+    if (m_player->isVideoPlayer())
+        g_object_set(m_pipeline.get(), "video-sink", createVideoSink(), nullptr);
 
     configurePlaySink();
 
@@ -2826,6 +2829,9 @@
             g_object_set(m_pipeline.get(), "audio-filter", scale, nullptr);
     }
 
+    if (!m_player->isVideoPlayer())
+        return;
+
     if (!m_canRenderingBeAccelerated) {
         // If not using accelerated compositing, let GStreamer handle
         // the image-orientation tag.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to