Minor fixes in Modules handles and introduction of threads into each module
The modules are applied inside a different thread in order to avoid lag in the main window while processing. This still need further testing A new flag is added to selected if the threads should be used in this purpose
This commit is contained in:
1 parent
13f39eee4b
commit
0fe1cdce48
8 files changed
+169
-52
No files matched your search
@@ -74,7 +74,6 @@ SubWindowHandle* ModulesHandle::processModuleHandlingOpt()
|
||||
else
|
||||
{
|
||||
destroyModuleIf( pcCurrModuleIf );
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -154,6 +153,8 @@ SubWindowHandle* ModulesHandle::enableModuleIf( PlaYUVerModuleIf *pcCurrModuleIf
|
||||
{
|
||||
pcCurrModuleIf->m_pcSubWindow[i]->enableModule( pcCurrModuleIf );
|
||||
}
|
||||
applyModuleIf( pcCurrModuleIf, false );
|
||||
|
||||
return interfaceChild;
|
||||
}
|
||||
|
||||
@@ -186,32 +187,18 @@ Void ModulesHandle::destroyAllModulesIf()
|
||||
|
||||
Bool ModulesHandle::applyModuleIf( PlaYUVerModuleIf *pcCurrModuleIf, Bool isPlaying )
|
||||
{
|
||||
PlaYUVerFrame* processedFrame = NULL;
|
||||
Bool bRet = false;
|
||||
if( !isPlaying || ( isPlaying && pcCurrModuleIf->m_cModuleDef.m_bApplyWhilePlaying ) )
|
||||
{
|
||||
switch( pcCurrModuleIf->m_cModuleDef.m_uiNumberOfFrames )
|
||||
{
|
||||
case MODULE_REQUIRES_ONE_FRAME:
|
||||
processedFrame = pcCurrModuleIf->process( pcCurrModuleIf->m_pcSubWindow[0]->getCurrFrame() );
|
||||
break;
|
||||
case MODULE_REQUIRES_TWO_FRAMES:
|
||||
processedFrame = pcCurrModuleIf->process( pcCurrModuleIf->m_pcSubWindow[0]->getCurrFrame(), pcCurrModuleIf->m_pcSubWindow[1]->getCurrFrame() );
|
||||
break;
|
||||
case MODULE_REQUIRES_THREE_FRAMES:
|
||||
processedFrame = pcCurrModuleIf->process( pcCurrModuleIf->m_pcSubWindow[0]->getCurrFrame(), pcCurrModuleIf->m_pcSubWindow[1]->getCurrFrame(),
|
||||
pcCurrModuleIf->m_pcSubWindow[2]->getCurrFrame() );
|
||||
break;
|
||||
}
|
||||
#ifdef PLAYUVER_THREADED_MODULES
|
||||
pcCurrModuleIf->start();
|
||||
#else
|
||||
pcCurrModuleIf->run();
|
||||
#endif
|
||||
if( pcCurrModuleIf->m_pcDisplaySubWindow )
|
||||
{
|
||||
pcCurrModuleIf->m_pcDisplaySubWindow->setCurrFrame( processedFrame );
|
||||
bRet = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
pcCurrModuleIf->m_pcSubWindow[0]->setCurrFrame( processedFrame );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -220,6 +207,21 @@ Bool ModulesHandle::applyModuleIf( PlaYUVerModuleIf *pcCurrModuleIf, Bool isPlay
|
||||
return bRet;
|
||||
}
|
||||
|
||||
Bool ModulesHandle::showModuleIf( PlaYUVerModuleIf *pcCurrModuleIf, PlaYUVerFrame* processedFrame )
|
||||
{
|
||||
Bool bRet = false;
|
||||
if( pcCurrModuleIf->m_pcDisplaySubWindow )
|
||||
{
|
||||
pcCurrModuleIf->m_pcDisplaySubWindow->setCurrFrame( processedFrame );
|
||||
bRet = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
pcCurrModuleIf->m_pcSubWindow[0]->setCurrFrame( processedFrame );
|
||||
}
|
||||
return bRet;
|
||||
}
|
||||
|
||||
Void ModulesHandle::swapModulesWindowsIf( PlaYUVerModuleIf *pcCurrModuleIf )
|
||||
{
|
||||
if( pcCurrModuleIf->m_cModuleDef.m_uiNumberOfFrames == MODULE_REQUIRES_TWO_FRAMES )
|
||||
@@ -230,6 +232,19 @@ Void ModulesHandle::swapModulesWindowsIf( PlaYUVerModuleIf *pcCurrModuleIf )
|
||||
}
|
||||
}
|
||||
|
||||
Void ModulesHandle::customEvent( QEvent *event )
|
||||
{
|
||||
if( !event )
|
||||
{
|
||||
return;
|
||||
}
|
||||
PlaYUVerModuleIf::EventData *eventData = ( PlaYUVerModuleIf::EventData* )event;
|
||||
if( eventData->m_bSuccess )
|
||||
{
|
||||
showModuleIf( eventData->m_pcModule, eventData->m_pcProcessedFrame );
|
||||
}
|
||||
}
|
||||
|
||||
QMenu* ModulesHandle::createMenus( QMenuBar *MainAppMenuBar )
|
||||
{
|
||||
PlaYUVerModuleIf* pcCurrModuleIf;
|
||||
@@ -246,6 +261,7 @@ QMenu* ModulesHandle::createMenus( QMenuBar *MainAppMenuBar )
|
||||
for( Int i = 0; i < m_pcPlaYUVerModules.size(); i++ )
|
||||
{
|
||||
pcCurrModuleIf = m_pcPlaYUVerModules.at( i );
|
||||
pcCurrModuleIf->setParent( this );
|
||||
|
||||
currSubMenu = NULL;
|
||||
if( pcCurrModuleIf->m_cModuleDef.m_pchModuleCategory )
|
||||
|
||||
Reference in new issue
Block a user