mirror of
https://gitlab.freedesktop.org/dabrain34/GstPipelineStudio.git
synced 2025-01-10 17:05:31 +00:00
commit
692b81f393
3 changed files with 27 additions and 19 deletions
|
@ -329,26 +329,30 @@ bool PipelineIE::Export(QSharedPointer<GraphManager> pgraph, const QString &file
|
||||||
GstPad *pad = gst_element_get_static_pad(element, info[i].m_pads[j].m_name.c_str());
|
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);
|
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;
|
case GST_PAD_SOMETIMES:
|
||||||
switch(GST_PAD_TEMPLATE_PRESENCE(templ))
|
presence = "sometimes";
|
||||||
{
|
break;
|
||||||
case GST_PAD_ALWAYS:
|
|
||||||
presence = "always";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GST_PAD_SOMETIMES:
|
case GST_PAD_REQUEST:
|
||||||
presence = "sometimes";
|
presence = "request";
|
||||||
break;
|
break;
|
||||||
|
};
|
||||||
case GST_PAD_REQUEST:
|
|
||||||
presence = "request";
|
|
||||||
break;
|
|
||||||
};
|
|
||||||
|
|
||||||
xmlWriter.writeAttribute("presence", presence);
|
|
||||||
xmlWriter.writeAttribute("template-name", GST_PAD_TEMPLATE_NAME_TEMPLATE(templ));
|
|
||||||
|
|
||||||
|
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);
|
gst_object_unref(pad);
|
||||||
|
|
||||||
if(info[i].m_connections[j].m_elementId != (size_t)-1 &&
|
if(info[i].m_connections[j].m_elementId != (size_t)-1 &&
|
||||||
|
|
|
@ -165,6 +165,10 @@ void PluginsList::showInfo(QListWidgetItem *pitem, QListWidgetItem *previous)
|
||||||
|
|
||||||
void PluginsList::insert(QListWidgetItem *pitem)
|
void PluginsList::insert(QListWidgetItem *pitem)
|
||||||
{
|
{
|
||||||
|
if(!pitem) {
|
||||||
|
qDebug() << "Do not insert null item";
|
||||||
|
return;
|
||||||
|
}
|
||||||
qDebug() << "Insert: " << pitem -> text();
|
qDebug() << "Insert: " << pitem -> text();
|
||||||
|
|
||||||
if(!m_pGraph || !m_pGraph -> AddPlugin(pitem -> text().toStdString().c_str(), NULL))
|
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<QKeyEvent*>(event);
|
QKeyEvent *key = static_cast<QKeyEvent*>(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());
|
insert(m_pPlugins -> currentItem());
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -15,7 +15,7 @@ class PluginsList: public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
PluginsList(QWidget *pwgt = NULL, Qt::WindowFlags f = 0);
|
PluginsList(QWidget *pwgt = NULL, Qt::WindowFlags f = Qt::Window);
|
||||||
|
|
||||||
GraphManager *m_pGraph;
|
GraphManager *m_pGraph;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue