[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    =?utf-8?q?=5Bphonon-gstreamer=5D_gstreamer=3A_Add_MRL_to_the_dot?=
From:       Trever Fischer <tdfischer () fedoraproject ! org>
Date:       2011-05-03 19:25:30
Message-ID: 20110503192530.54198A60A9 () git ! kde ! org
[Download RAW message or body]

Git commit e248ab276c050bf5985351654a79db6834b9b9b2 by Trever Fischer.
Committed on 03/05/2011 at 21:19.
Pushed by tdfischer into branch 'master'.

Add MRL to the dot file that gets generated

M  +6    -2    gstreamer/gsthelper.cpp     
M  +2    -1    gstreamer/gsthelper.h     
M  +14   -4    gstreamer/mediaobject.cpp     

http://commits.kde.org/phonon-gstreamer/e248ab276c050bf5985351654a79db6834b9b9b2

diff --git a/gstreamer/gsthelper.cpp b/gstreamer/gsthelper.cpp
index d48775e..acc6839 100644
--- a/gstreamer/gsthelper.cpp
+++ b/gstreamer/gsthelper.cpp
@@ -18,6 +18,8 @@
 #include <gst/interfaces/propertyprobe.h>
 #include <gst/gst.h>
 #include "gsthelper.h"
+#include "mediaobject.h"
+#include "backend.h"
 
 #include <QtCore/QList>
 
@@ -125,9 +127,11 @@ QString GstHelper::stateName(GstState state)
     return "";
 }
 
-void GstHelper::writePipelineDot(GstBin *bin, const char *type)
+void GstHelper::writePipelineDot(MediaObject *media, const QString &type)
 {
-    GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(bin, GST_DEBUG_GRAPH_SHOW_ALL, type);
+    GstBin *bin = GST_BIN(media->pipeline());
+    media->backend()->logMessage(QString("Dumping %0.dot").arg(type), \
Backend::Debug, media); +    GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(bin, \
GST_DEBUG_GRAPH_SHOW_ALL, QString("phonon-%0").arg(type).toUtf8().constData());  }
 
 
diff --git a/gstreamer/gsthelper.h b/gstreamer/gsthelper.h
index 641ee99..ae94d17 100644
--- a/gstreamer/gsthelper.h
+++ b/gstreamer/gsthelper.h
@@ -33,6 +33,7 @@ namespace Phonon
 {
 namespace Gstreamer
 {
+class MediaObject;
 class GstHelper
 {
 public:
@@ -41,7 +42,7 @@ public:
     static QByteArray property(GstElement *elem, const char *propertyName);
     static QByteArray name(GstObject *elem);
     static QString stateName(GstState);
-    static void writePipelineDot(GstBin *elem, const char *type);
+    static void writePipelineDot(MediaObject *media, const QString &type);
 };
 
 } // ns Gstreamer
diff --git a/gstreamer/mediaobject.cpp b/gstreamer/mediaobject.cpp
index 0695289..3e27c59 100644
--- a/gstreamer/mediaobject.cpp
+++ b/gstreamer/mediaobject.cpp
@@ -983,14 +983,14 @@ void MediaObject::updateSeekable()
 
         if (m_seekable) {
             m_backend->logMessage("Stream is seekable", Backend::Info, this);
-            GstHelper::writePipelineDot(GST_BIN(m_pipeline), \
"pgst-updateSeekable-true"); +            GstHelper::writePipelineDot(this, \
"updateSeekable-true");  } else {
             m_backend->logMessage("Stream is non-seekable", Backend::Info, this);
-            GstHelper::writePipelineDot(GST_BIN(m_pipeline), \
"pgst-updateSeekable-false"); +            GstHelper::writePipelineDot(this, \
"updateSeekable-false");  }
     } else {
         m_backend->logMessage("updateSeekable query failed", Backend::Info, this);
-        GstHelper::writePipelineDot(GST_BIN(m_pipeline), \
"pgst-updateSeekable-failed"); +        GstHelper::writePipelineDot(this, \
"updateSeekable-failed");  }
     gst_query_unref (query);
 }
@@ -1092,6 +1092,9 @@ void MediaObject::setSource(const MediaSource &source)
         if (!createPipefromURL(source.mrl()))
             setError(tr("Could not open media source."));
         }
+        GstHelper::writePipelineDot(this,
+                                    QString("setSource-mrl-%0")
+                                    \
.arg(QUrl::toPercentEncoding(source.mrl().toString()).constData()));  break;
 
     case MediaSource::Invalid:
@@ -1104,6 +1107,7 @@ void MediaObject::setSource(const MediaSource &source)
     case MediaSource::Stream:
         if (!createPipefromStream(source))
             setError(tr("Could not open media source."));
+        GstHelper::writePipelineDot(this, "setSource-stream");
         break;
 
     case MediaSource::Disc:
@@ -1111,6 +1115,7 @@ void MediaObject::setSource(const MediaSource &source)
             if (source.discType() == Phonon::Dvd) {
                 if (!createPipefromDVD(source))
                     setError(tr("Could not open DVD."));
+                GstHelper::writePipelineDot(this, "setSource-dvd");
             } else {
                 QString mediaUrl;
                 switch (source.discType()) {
@@ -1129,6 +1134,9 @@ void MediaObject::setSource(const MediaSource &source)
                 }
                 if (mediaUrl.isEmpty() || !createPipefromURL(QUrl(mediaUrl)))
                     setError(tr("Could not open media source."));
+                GstHelper::writePipelineDot(this,
+                                            QString("setSource-disc-%0")
+                                            .arg(mediaUrl));
             }
         }
         break;
@@ -1148,7 +1156,9 @@ void MediaObject::setSource(const MediaSource &source)
     MediaNodeEvent event(MediaNodeEvent::SourceChanged);
     notify(&event);
 
-    GstHelper::writePipelineDot(GST_BIN(m_pipeline), "pgst-setSource-complete");
+    GstHelper::writePipelineDot(this,
+                                QString("setSource-complete-%0")
+                                \
.arg(QUrl::toPercentEncoding(source.mrl().toString()).constData()));  
     // We need to link this node to ensure that fake sinks are connected
     // before loading, otherwise the stream will be blocked


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic