From d246dc875f0979e9c2349d348aa7fa58dbf11bab Mon Sep 17 00:00:00 2001 From: Stephane Cerveau Date: Fri, 11 Nov 2016 11:26:13 +0100 Subject: [PATCH 1/3] PluginlistW should be a separate window Be able to move the plugin window independently from the base windown in order to see when we add an element. --- src/PluginsList.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PluginsList.h b/src/PluginsList.h index ea4ae4e..ae46453 100644 --- a/src/PluginsList.h +++ b/src/PluginsList.h @@ -15,7 +15,7 @@ class PluginsList: public QDialog { Q_OBJECT public: - PluginsList(QWidget *pwgt = NULL, Qt::WindowFlags f = 0); + PluginsList(QWidget *pwgt = NULL, Qt::WindowFlags f = Qt::Window); GraphManager *m_pGraph; From 4c1ae2e2b0cdde752ecbb5221b7f8d3e7a759305 Mon Sep 17 00:00:00 2001 From: Stephane Cerveau Date: Fri, 11 Nov 2016 11:27:55 +0100 Subject: [PATCH 2/3] Fix a crash when pressing enter with no selection. Crash when pressing ok with no plugin selected. --- src/PluginsList.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/PluginsList.cpp b/src/PluginsList.cpp index e152624..8fa8ba0 100644 --- a/src/PluginsList.cpp +++ b/src/PluginsList.cpp @@ -165,6 +165,10 @@ void PluginsList::showInfo(QListWidgetItem *pitem, QListWidgetItem *previous) void PluginsList::insert(QListWidgetItem *pitem) { + if(!pitem) { + qDebug() << "Do not insert null item"; + return; + } qDebug() << "Insert: " << pitem -> text(); if(!m_pGraph || !m_pGraph -> AddPlugin(pitem -> text().toStdString().c_str(), NULL)) @@ -183,7 +187,7 @@ bool PluginsList::eventFilter(QObject *obj, QEvent *event) { QKeyEvent *key = static_cast(event); - if((key -> key() == Qt::Key_Enter) || (key -> key() == Qt::Key_Return)) + if((key -> key() == Qt::Key_Enter) || (key -> key() == Qt::Key_Return) && m_pPlugins -> currentItem()) { insert(m_pPlugins -> currentItem()); return true; From 8418e0022c0b269e0d7f3992a9368b827f8836a9 Mon Sep 17 00:00:00 2001 From: Stephane Cerveau Date: Fri, 11 Nov 2016 11:29:22 +0100 Subject: [PATCH 3/3] Fix crash during pipeline backup Videotestsrc -> autovideosink is crashing during the backup --- src/PipelineIE.cpp | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/PipelineIE.cpp b/src/PipelineIE.cpp index 56e0f5a..b092d00 100644 --- a/src/PipelineIE.cpp +++ b/src/PipelineIE.cpp @@ -329,26 +329,30 @@ bool PipelineIE::Export(QSharedPointer pgraph, const QString &file GstPad *pad = gst_element_get_static_pad(element, info[i].m_pads[j].m_name.c_str()); GstPadTemplate *templ = gst_pad_get_pad_template(pad); + if (templ) { + QString presence; + switch(GST_PAD_TEMPLATE_PRESENCE(templ)) + { + case GST_PAD_ALWAYS: + presence = "always"; + break; - QString presence; - switch(GST_PAD_TEMPLATE_PRESENCE(templ)) - { - case GST_PAD_ALWAYS: - presence = "always"; - break; + case GST_PAD_SOMETIMES: + presence = "sometimes"; + break; - case GST_PAD_SOMETIMES: - presence = "sometimes"; - break; - - case GST_PAD_REQUEST: - presence = "request"; - break; - }; - - xmlWriter.writeAttribute("presence", presence); - xmlWriter.writeAttribute("template-name", GST_PAD_TEMPLATE_NAME_TEMPLATE(templ)); + case GST_PAD_REQUEST: + presence = "request"; + break; + }; + xmlWriter.writeAttribute("presence", presence); + xmlWriter.writeAttribute("template-name", GST_PAD_TEMPLATE_NAME_TEMPLATE(templ)); + } else { + qDebug() << "Unable to find a template for" << info[i].m_pads[j].m_name.c_str(); + xmlWriter.writeAttribute("presence", "always"); + xmlWriter.writeAttribute("template-name", ""); + } gst_object_unref(pad); if(info[i].m_connections[j].m_elementId != (size_t)-1 &&