Title: [223172] trunk/Source/WebCore
Revision
223172
Author
[email protected]
Date
2017-10-11 02:33:46 -0700 (Wed, 11 Oct 2017)

Log Message

[MSE][GStreamer] Add dump of append pipeline
https://bugs.webkit.org/show_bug.cgi?id=178074

Patch by Alicia Boya García <[email protected]> on 2017-10-11
Reviewed by Xabier Rodriguez-Calvar.

Enable dump of AppendPipeline.

* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::appendPipelineStateChangeMessageCallback):
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::handleStateChangeMessage):
* platform/graphics/gstreamer/mse/AppendPipeline.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (223171 => 223172)


--- trunk/Source/WebCore/ChangeLog	2017-10-11 07:59:43 UTC (rev 223171)
+++ trunk/Source/WebCore/ChangeLog	2017-10-11 09:33:46 UTC (rev 223172)
@@ -1,3 +1,18 @@
+2017-10-11  Alicia Boya García  <[email protected]>
+
+        [MSE][GStreamer] Add dump of append pipeline
+        https://bugs.webkit.org/show_bug.cgi?id=178074
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        Enable dump of AppendPipeline.
+
+        * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
+        (WebCore::appendPipelineStateChangeMessageCallback):
+        (WebCore::AppendPipeline::AppendPipeline):
+        (WebCore::AppendPipeline::handleStateChangeMessage):
+        * platform/graphics/gstreamer/mse/AppendPipeline.h:
+
 2017-09-27  Frederic Wang  <[email protected]>
 
         [iOS] Do not flatten frames when async frame scrolling is enabled

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp (223171 => 223172)


--- trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp	2017-10-11 07:59:43 UTC (rev 223171)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp	2017-10-11 09:33:46 UTC (rev 223172)
@@ -100,6 +100,11 @@
 }
 #endif
 
+static void appendPipelineStateChangeMessageCallback(GstBus*, GstMessage* message, AppendPipeline* appendPipeline)
+{
+    appendPipeline->handleStateChangeMessage(message);
+}
+
 AppendPipeline::AppendPipeline(Ref<MediaSourceClientGStreamerMSE> mediaSourceClient, Ref<SourceBufferPrivateGStreamer> sourceBufferPrivate, MediaPlayerPrivateGStreamerMSE& playerPrivate)
     : m_mediaSourceClient(mediaSourceClient.get())
     , m_sourceBufferPrivate(sourceBufferPrivate.get())
@@ -129,6 +134,7 @@
 #if ENABLE(ENCRYPTED_MEDIA)
     g_signal_connect(m_bus.get(), "message::element", G_CALLBACK(appendPipelineElementMessageCallback), this);
 #endif
+    g_signal_connect(m_bus.get(), "message::state-changed", G_CALLBACK(appendPipelineStateChangeMessageCallback), this);
 
     // We assign the created instances here instead of adoptRef() because gst_bin_add_many()
     // below will already take the initial reference and we need an additional one for us.
@@ -342,6 +348,24 @@
 }
 #endif
 
+void AppendPipeline::handleStateChangeMessage(GstMessage* message)
+{
+    ASSERT(WTF::isMainThread());
+
+    if (GST_MESSAGE_SRC(message) == reinterpret_cast<GstObject*>(m_pipeline.get())) {
+        GstState currentState, newState;
+        gst_message_parse_state_changed(message, &currentState, &newState, nullptr);
+        CString sourceBufferType = String(m_sourceBufferPrivate->type().raw())
+            .replace("/", "_").replace(" ", "_")
+            .replace("\"", "").replace("\'", "").utf8();
+        CString dotFileName = String::format("webkit-append-%s-%s_%s",
+            sourceBufferType.data(),
+            gst_element_state_get_name(currentState),
+            gst_element_state_get_name(newState)).utf8();
+        GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(m_pipeline.get()), GST_DEBUG_GRAPH_SHOW_ALL, dotFileName.data());
+    }
+}
+
 void AppendPipeline::handleAppsrcNeedDataReceived()
 {
     if (!m_appsrcAtLeastABufferLeft) {

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.h (223171 => 223172)


--- trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.h	2017-10-11 07:59:43 UTC (rev 223171)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.h	2017-10-11 09:33:46 UTC (rev 223172)
@@ -50,6 +50,7 @@
 
     void handleNeedContextSyncMessage(GstMessage*);
     void handleApplicationMessage(GstMessage*);
+    void handleStateChangeMessage(GstMessage*);
 #if ENABLE(ENCRYPTED_MEDIA)
     void handleElementMessage(GstMessage*);
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to