Autoplay to discover the pads for decodebin2

Do not try to connect the 2 elements when double
click on a pad.
This commit is contained in:
dabrain34 2016-12-11 23:02:56 +01:00
parent 3dbb6ffd1d
commit babeda105f

View file

@ -363,6 +363,11 @@ void GraphDisplay::mouseReleaseEvent (QMouseEvent *event)
if(srcPad != NULL && dstPad != NULL) if(srcPad != NULL && dstPad != NULL)
break; break;
} }
if(!infoSrc.m_name.compare(infoDst.m_name)) {
qDebug() << "infoSrc == infoDst. No need to connect anything.";
goto exit;
}
assert(srcPad != NULL && dstPad != NULL); assert(srcPad != NULL && dstPad != NULL);
@ -380,8 +385,13 @@ void GraphDisplay::mouseReleaseEvent (QMouseEvent *event)
QMessageBox::warning(this, "Coonection failed", msg); QMessageBox::warning(this, "Coonection failed", msg);
} }
m_info = m_pGraph -> GetInfo(); m_info = m_pGraph -> GetInfo();
updateDisplayInfoIds(); updateDisplayInfoIds();
if(g_str_has_prefix(infoDst.m_name.c_str(),"decodebin")) {
m_pGraph->Play();
qDebug() << "Launch play to discover the new pad";
}
} }
} }
else if(m_moveInfo.m_action == Select) else if(m_moveInfo.m_action == Select)
@ -420,7 +430,7 @@ void GraphDisplay::mouseReleaseEvent (QMouseEvent *event)
} }
} }
exit:
m_moveInfo.m_action = None; m_moveInfo.m_action = None;
m_moveInfo.m_elementId = -1; m_moveInfo.m_elementId = -1;
m_moveInfo.m_padId = -1; m_moveInfo.m_padId = -1;