[GStreamer] Enable fpsdisplaysink only when MEDIA_STATISTICS is enabled
authorphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Aug 2018 08:54:00 +0000 (08:54 +0000)
committerphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Aug 2018 08:54:00 +0000 (08:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188648

Patch by Philippe Normand <philn@igalia.com> on 2018-08-17
Reviewed by Xabier Rodriguez-Calvar.

The fpsdisplaysink is useful only when MEDIA_STATISTICS is turned on.
The text overlay is now enabled when GST_DEBUG tracing is enabled for the player.

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234978 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp

index 28a1a90..9116ba0 100644 (file)
@@ -1,5 +1,18 @@
 2018-08-17  Philippe Normand  <philn@igalia.com>
 
+        [GStreamer] Enable fpsdisplaysink only when MEDIA_STATISTICS is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=188648
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        The fpsdisplaysink is useful only when MEDIA_STATISTICS is turned on.
+        The text overlay is now enabled when GST_DEBUG tracing is enabled for the player.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
+
+2018-08-17  Philippe Normand  <philn@igalia.com>
+
         [GStreamer][MSE] Disable last-sample support in AppendPipeline
         https://bugs.webkit.org/show_bug.cgi?id=188649
 
index 49ccf86..db6088e 100644 (file)
@@ -1175,17 +1175,14 @@ GstElement* MediaPlayerPrivateGStreamerBase::createVideoSink()
     }
 
     GstElement* videoSink = nullptr;
+#if ENABLE(MEDIA_STATISTICS)
     m_fpsSink = gst_element_factory_make("fpsdisplaysink", "sink");
     if (m_fpsSink) {
         g_object_set(m_fpsSink.get(), "silent", TRUE , nullptr);
 
-        // Turn off text overlay unless logging is enabled.
-#if LOG_DISABLED
-        g_object_set(m_fpsSink.get(), "text-overlay", FALSE , nullptr);
-#else
-        if (!isLogChannelEnabled("Media"))
+        // Turn off text overlay unless tracing is enabled.
+        if (gst_debug_category_get_threshold(webkit_media_player_debug) < GST_LEVEL_TRACE)
             g_object_set(m_fpsSink.get(), "text-overlay", FALSE , nullptr);
-#endif // LOG_DISABLED
 
         if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_fpsSink.get()), "video-sink")) {
             g_object_set(m_fpsSink.get(), "video-sink", m_videoSink.get(), nullptr);
@@ -1193,6 +1190,7 @@ GstElement* MediaPlayerPrivateGStreamerBase::createVideoSink()
         } else
             m_fpsSink = nullptr;
     }
+#endif
 
     if (!m_fpsSink)
         videoSink = m_videoSink.get();