Commit b5008b3b authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Removed major part of the debug... since it was way to bloated...

parent d69b99d2
......@@ -75,7 +75,7 @@ void ClipWorkflow::checkStateChange()
QWriteLocker lock2( m_stateLock );
if ( m_requiredState != ClipWorkflow::None )
{
qDebug() << "Changed state from" << m_state << "to state" << m_requiredState;
// qDebug() << "Changed state from" << m_state << "to state" << m_requiredState;
m_state = m_requiredState;
m_requiredState = ClipWorkflow::None;
checkSynchronisation( m_state );
......@@ -93,13 +93,13 @@ void ClipWorkflow::lock( ClipWorkflow* cw, void** pp_ret )
// else
// {
*pp_ret = cw->m_buffer;
qDebug() << "Clip workflow locking <<<<<<<<<<<<<<<<<<<<<<<<<<";
// qDebug() << "Clip workflow locking <<<<<<<<<<<<<<<<<<<<<<<<<<";
// }
}
void ClipWorkflow::unlock( ClipWorkflow* cw )
{
qDebug() << "ClipWorkflow::unlock()";
// qDebug() << "ClipWorkflow::unlock()";
cw->m_stateLock->lockForWrite();
// if ( cw->m_oneFrameOnly )
......@@ -119,7 +119,7 @@ void ClipWorkflow::unlock( ClipWorkflow* cw )
cw->m_stateLock->unlock();
//Signal that render has been completed.
cw->m_renderWaitCond->wake();
qDebug() << "Clip render completed";
// qDebug() << "Clip render completed";
cw->emit renderComplete( cw );
// qDebug() << "Entering condwait";
......@@ -138,16 +138,16 @@ void ClipWorkflow::unlock( ClipWorkflow* cw )
QMutexLocker lock( cw->m_condMutex );
cw->m_stateLock->unlock();
qDebug() << "Entering forced pause condwait";
// qDebug() << "Entering forced pause condwait";
cw->setState( ClipWorkflow::ThreadPaused );
cw->m_pausedThreadCondWait->wake();
cw->m_waitCond->wait( cw->m_condMutex );
qDebug() << "Leaving forced pause condwait";
// qDebug() << "Leaving forced pause condwait";
cw->setState( ClipWorkflow::Paused );
}
else
cw->m_stateLock->unlock();
qDebug() << "End of the ClipWorkflow::unlock()";
// qDebug() << "End of the ClipWorkflow::unlock()";
cw->checkStateChange();
}
......@@ -355,7 +355,7 @@ void ClipWorkflow::unpause( bool wakeRenderThread /*= true*/ )
// m_requiredState = ClipWorkflow::None;
if ( wakeRenderThread == true )
{
qDebug() << "Unpausing and waking thread";
// qDebug() << "Unpausing and waking thread";
wake();
}
}
......@@ -370,8 +370,8 @@ void ClipWorkflow::waitForCompleteRender( bool dontCheckRenderStarted /*=
{
if ( isRendering() == true || dontCheckRenderStarted == true )
m_renderWaitCond->wait();
else
qDebug() << "waitForCompleteRender(), not rendering. State == " << getState();
// else
// qDebug() << "waitForCompleteRender(), not rendering. State == " << getState();
}
void ClipWorkflow::waitForCompleteInit()
......
......@@ -157,7 +157,7 @@ void MainWorkflow::pause()
void MainWorkflow::nextFrame()
{
qDebug() << "Going to the next frame";
// qDebug() << "Going to the next frame";
++m_currentFrame;
//FIXME: This is probably a bit much...
emit frameChanged( m_currentFrame );
......@@ -166,7 +166,7 @@ void MainWorkflow::nextFrame()
void MainWorkflow::previousFrame()
{
qDebug() << "Going to the previous frame";
// qDebug() << "Going to the previous frame";
--m_currentFrame;
//FIXME: This is probably a bit much...
emit frameChanged( m_currentFrame );
......@@ -278,7 +278,7 @@ void MainWorkflow::trackPaused()
m_nbTracksToPause.fetchAndAddAcquire( -1 );
if ( m_nbTracksToPause <= 0 )
{
qDebug() << "MainWorkflow is paused";
// qDebug() << "MainWorkflow is paused";
emit mainWorkflowPaused();
}
}
......@@ -299,12 +299,12 @@ void MainWorkflow::tracksRenderCompleted( unsigned int trackId )
//therefore, m_nbTracksToRender will be equal to -1
if ( m_nbTracksToRender <= 0 )
{
qDebug() << "MainWorkflow render is completed. Acquiring synchronization lock";
// qDebug() << "MainWorkflow render is completed. Acquiring synchronization lock";
//Just a synchronisation barriere
{
QMutexLocker lock( m_synchroneRenderWaitConditionMutex );
}
qDebug() << "Waking synchronisation threads";
// qDebug() << "Waking synchronisation threads";
m_synchroneRenderWaitCondition->wakeAll();
}
// else
......@@ -315,9 +315,9 @@ unsigned char* MainWorkflow::getSynchroneOutput()
{
m_synchroneRenderWaitConditionMutex->lock();
getOutput();
qDebug() << "Waiting for synchrone output";
// qDebug() << "Waiting for synchrone output";
m_synchroneRenderWaitCondition->wait( m_synchroneRenderWaitConditionMutex );
qDebug() << "Got it";
// qDebug() << "Got it";
m_synchroneRenderWaitConditionMutex->unlock();
qDebug() << (void*)m_synchroneRenderingBuffer;
if ( m_synchroneRenderingBuffer == NULL )
......
......@@ -90,10 +90,10 @@ unsigned char* TrackWorkflow::renderClip( ClipWorkflow* cw, qint64 currentF
cw->getStateLock()->lockForRead();
qDebug() << "Rendering clip";
// qDebug() << "Rendering clip";
if ( cw->getState() == ClipWorkflow::ThreadPaused && pauseAfterRender == false )
{
qDebug() << "Paused clip, but no need to repause it after";
// qDebug() << "Paused clip, but no need to repause it after";
cw->getStateLock()->unlock();
//If we must pause after render, we must NOT wake the renderer thread, or it could render more than one frame
// (since this is for the next/previous frame)
......@@ -117,9 +117,9 @@ unsigned char* TrackWorkflow::renderClip( ClipWorkflow* cw, qint64 currentF
//If frame has been rendered :
if ( cw->getState() == ClipWorkflow::Sleeping || pauseAfterRender == true )
{
qDebug() << "rendering a sleeping clip workflow";
if ( pauseAfterRender == true )
qDebug() << "Rendering only one frame";
// qDebug() << "rendering a sleeping clip workflow";
// if ( pauseAfterRender == true )
// qDebug() << "Rendering only one frame";
cw->getStateLock()->unlock();
if ( needRepositioning == true )
......@@ -127,7 +127,7 @@ unsigned char* TrackWorkflow::renderClip( ClipWorkflow* cw, qint64 currentF
float pos = ( (float)( currentFrame - start ) / (float)(cw->getClip()->getLength()) );
cw->setPosition( pos );
}
qDebug() << "getting clip output";
// qDebug() << "getting clip output";
ret = cw->getOutput();
if ( pauseAfterRender == false )
{
......@@ -140,19 +140,19 @@ unsigned char* TrackWorkflow::renderClip( ClipWorkflow* cw, qint64 currentF
// cw->unpause( true );
cw->getMediaPlayer()->pause();
cw->wake();
qDebug() << "Waiting for render now...";
// qDebug() << "Waiting for render now...";
cw->waitForCompleteRender( true );
{
QMutexLocker lock( cw->getSleepMutex() );
}
qDebug() << "Querying state back to pause after render";
// qDebug() << "Querying state back to pause after render";
cw->queryStateChange( ClipWorkflow::Paused );
cw->wake();
}
}
else if ( cw->getState() == ClipWorkflow::Stopped )
{
qDebug() << "Rendering a stopped clip workflow";
// qDebug() << "Rendering a stopped clip workflow";
cw->getStateLock()->unlock();
cw->initialize( );
cw->startRender();
......@@ -295,7 +295,7 @@ unsigned char* TrackWorkflow::getOutput( qint64 currentFrame )
if ( m_oneFrameOnly == 1 )
{
qDebug() << "Activating oneFrameOnlyFlag";
// qDebug() << "Activating oneFrameOnlyFlag";
oneFrameOnlyFlag = true;
}
if ( checkEnd( currentFrame ) == true )
......@@ -393,9 +393,9 @@ void TrackWorkflow::pauseClipWorkflow( ClipWorkflow* cw )
}
cw->waitForPausingState();
cw->pause();
qDebug() << "Wait for pausedthread state";
// qDebug() << "Wait for pausedthread state";
cw->waitForPausedThread();
qDebug() << "Ok thread is paused";
// qDebug() << "Ok thread is paused";
}
void TrackWorkflow::pause()
......@@ -428,7 +428,7 @@ void TrackWorkflow::pause()
{
//This should never be used.
//TODO: remove this in a few revision (wrote on July 16 2009 )
qDebug() << "Asking to pause in an already paused state";
// qDebug() << "Asking to pause in an already paused state";
cw->getStateLock()->unlock();
}
}
......@@ -500,15 +500,13 @@ void TrackWorkflow::clipWorkflowPaused()
void TrackWorkflow::clipWorkflowRenderCompleted( ClipWorkflow* cw )
{
qDebug() << "clip workflow render complete. Checking for track completed";
// qDebug() << "clip workflow render complete. Checking for track completed";
if ( cw != NULL )
{
qDebug() << " There is a complete buffer to return/////////////////////";
m_synchroneRenderBuffer = cw->getOutput();
}
else
{
qDebug() << "cw is null, no tracks to render/////////////////////////";
m_synchroneRenderBuffer = NULL;
}
m_nbClipToRender.fetchAndAddAcquire( -1 );
......
......@@ -108,6 +108,7 @@ void* WorkflowRenderer::lock( void* datas )
// {
qDebug() << "Asking synchrone frame";
ret = self->m_mainWorkflow->getSynchroneOutput();
qDebug() << "Got it";
// }
self->m_lastFrame = static_cast<unsigned char*>( ret );
qDebug() << "Returning new frame";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment