Commit 90e6d3cd authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Removed (lots of) debug

parent 544ed18a
...@@ -80,15 +80,12 @@ void MetaDataManager::run() ...@@ -80,15 +80,12 @@ void MetaDataManager::run()
m_mediaPlayer->play(); m_mediaPlayer->play();
} }
usleep( 10000 ); usleep( 10000 );
qDebug() << "New metadata threaad mainloop iteration";
} }
qDebug() << "End of metamanager thread";
return; return;
} }
void MetaDataManager::getMetaData() void MetaDataManager::getMetaData()
{ {
qDebug() << "getMetaData();";
m_mediaIsPlaying = false; m_mediaIsPlaying = false;
//TODO: restore this when VLC1.1 comes out. //TODO: restore this when VLC1.1 comes out.
// m_lengthHasChanged = false; // m_lengthHasChanged = false;
...@@ -215,7 +212,6 @@ void MetaDataManager::entrypointLengthChanged() ...@@ -215,7 +212,6 @@ void MetaDataManager::entrypointLengthChanged()
void MetaDataManager::entrypointPlaying() void MetaDataManager::entrypointPlaying()
{ {
disconnect( m_mediaPlayer, SIGNAL( playing() ), this, SLOT( entrypointPlaying() ) ); disconnect( m_mediaPlayer, SIGNAL( playing() ), this, SLOT( entrypointPlaying() ) );
qDebug() << "Playing the media";
m_mediaIsPlaying = true; m_mediaIsPlaying = true;
if ( m_lengthHasChanged == true ) if ( m_lengthHasChanged == true )
getMetaData(); getMetaData();
......
...@@ -105,10 +105,6 @@ void ClipWorkflow::unlock( ClipWorkflow* cw ) ...@@ -105,10 +105,6 @@ void ClipWorkflow::unlock( ClipWorkflow* cw )
cw->m_stateLock->lockForWrite(); cw->m_stateLock->lockForWrite();
cw->m_state = Rendering; cw->m_state = Rendering;
} }
else
{
qDebug() << "UnLocking. State = " << cw->m_state << "Debug Id = " << cw->debugId;
}
cw->m_stateLock->unlock(); cw->m_stateLock->unlock();
cw->checkStateChange(); cw->checkStateChange();
...@@ -119,7 +115,6 @@ void ClipWorkflow::setVmem() ...@@ -119,7 +115,6 @@ void ClipWorkflow::setVmem()
{ {
char buffer[32]; char buffer[32];
qDebug() << "Setting vmem from clip " << this->debugId;
//TODO: it would be good if we somehow backup the old media parameters to restore it later. //TODO: it would be good if we somehow backup the old media parameters to restore it later.
m_clip->getParent()->getVLCMedia()->addOption( ":vout=vmem" ); m_clip->getParent()->getVLCMedia()->addOption( ":vout=vmem" );
m_clip->getParent()->getVLCMedia()->setDataCtx( this ); m_clip->getParent()->getVLCMedia()->setDataCtx( this );
...@@ -170,7 +165,6 @@ void ClipWorkflow::pausedMediaPlayer() ...@@ -170,7 +165,6 @@ void ClipWorkflow::pausedMediaPlayer()
{ {
disconnect( m_mediaPlayer, SIGNAL( paused() ), this, SLOT( pausedMediaPlayer() ) ); disconnect( m_mediaPlayer, SIGNAL( paused() ), this, SLOT( pausedMediaPlayer() ) );
setState( Ready ); setState( Ready );
qDebug() << "Set Ready state";
} }
bool ClipWorkflow::isReady() const bool ClipWorkflow::isReady() const
...@@ -206,7 +200,6 @@ void ClipWorkflow::startRender() ...@@ -206,7 +200,6 @@ void ClipWorkflow::startRender()
void ClipWorkflow::endReached() void ClipWorkflow::endReached()
{ {
qDebug() << "End reached";
setState( EndReached ); setState( EndReached );
} }
...@@ -217,15 +210,12 @@ const Clip* ClipWorkflow::getClip() const ...@@ -217,15 +210,12 @@ const Clip* ClipWorkflow::getClip() const
void ClipWorkflow::stop() void ClipWorkflow::stop()
{ {
qDebug() << "ClipWorkflow::stop()";
Q_ASSERT( m_mediaPlayer != NULL ); Q_ASSERT( m_mediaPlayer != NULL );
m_mediaPlayer->stop(); m_mediaPlayer->stop();
qDebug() << "Stopped media player";
m_mediaPlayer = NULL; m_mediaPlayer = NULL;
setState( Stopped ); setState( Stopped );
QMutexLocker lock( m_requiredStateLock ); QMutexLocker lock( m_requiredStateLock );
m_requiredState = ClipWorkflow::None; m_requiredState = ClipWorkflow::None;
qDebug() << "Changed state";
} }
void ClipWorkflow::setPosition( float pos ) void ClipWorkflow::setPosition( float pos )
...@@ -241,14 +231,12 @@ bool ClipWorkflow::isRendering() const ...@@ -241,14 +231,12 @@ bool ClipWorkflow::isRendering() const
void ClipWorkflow::setState( State state ) void ClipWorkflow::setState( State state )
{ {
qDebug() << "Setting state : " << state;
QWriteLocker lock( m_stateLock ); QWriteLocker lock( m_stateLock );
m_state = state; m_state = state;
} }
void ClipWorkflow::queryStateChange( State newState ) void ClipWorkflow::queryStateChange( State newState )
{ {
qDebug() << "Querying state change";
QMutexLocker lock( m_requiredStateLock ); QMutexLocker lock( m_requiredStateLock );
m_requiredState = newState; m_requiredState = newState;
} }
...@@ -269,4 +257,3 @@ void ClipWorkflow::reinitialize() ...@@ -269,4 +257,3 @@ void ClipWorkflow::reinitialize()
m_state = Stopped; m_state = Stopped;
queryStateChange( None ); queryStateChange( None );
} }
...@@ -44,7 +44,6 @@ TrackWorkflow::~TrackWorkflow() ...@@ -44,7 +44,6 @@ TrackWorkflow::~TrackWorkflow()
void TrackWorkflow::addClip( Clip* clip, qint64 start ) void TrackWorkflow::addClip( Clip* clip, qint64 start )
{ {
qDebug() << "Inserting clip at frame nb" << start;
ClipWorkflow* cw = new ClipWorkflow( clip ); ClipWorkflow* cw = new ClipWorkflow( clip );
m_clips.insert( start, cw ); m_clips.insert( start, cw );
computeLength(); computeLength();
...@@ -76,11 +75,12 @@ unsigned char* TrackWorkflow::renderClip( ClipWorkflow* cw, bool needReposi ...@@ -76,11 +75,12 @@ unsigned char* TrackWorkflow::renderClip( ClipWorkflow* cw, bool needReposi
cw->getStateLock()->unlock(); cw->getStateLock()->unlock();
while ( cw->isRendering() == true ) while ( cw->isRendering() == true )
{ {
// qDebug() << "Waiting for complete render. State == " << cw->getState();
usleep( 100 ); usleep( 100 );
} }
cw->getStateLock()->lockForRead();
//This way we can trigger the appropriate if just below. //This way we can trigger the appropriate if just below.
//by restoring the initial state of the function, and just pretend that
//nothing happened.
cw->getStateLock()->lockForRead();
} }
//If frame has been rendered : //If frame has been rendered :
...@@ -99,7 +99,6 @@ unsigned char* TrackWorkflow::renderClip( ClipWorkflow* cw, bool needReposi ...@@ -99,7 +99,6 @@ unsigned char* TrackWorkflow::renderClip( ClipWorkflow* cw, bool needReposi
cw->getStateLock()->unlock(); cw->getStateLock()->unlock();
cw->initialize( m_mediaPlayer ); cw->initialize( m_mediaPlayer );
cw->startRender(); cw->startRender();
qDebug() << "Render started for clip" << cw->debugId;
} }
else if ( cw->getState() == ClipWorkflow::Ready || else if ( cw->getState() == ClipWorkflow::Ready ||
cw->getState() == ClipWorkflow::Initializing ) cw->getState() == ClipWorkflow::Initializing )
...@@ -108,7 +107,6 @@ unsigned char* TrackWorkflow::renderClip( ClipWorkflow* cw, bool needReposi ...@@ -108,7 +107,6 @@ unsigned char* TrackWorkflow::renderClip( ClipWorkflow* cw, bool needReposi
//Otherwise, it will start directly. //Otherwise, it will start directly.
cw->getStateLock()->unlock(); cw->getStateLock()->unlock();
cw->startRender(); cw->startRender();
qDebug() << "Started render for clip" << cw->debugId;
} }
else else
{ {
...@@ -144,7 +142,6 @@ void TrackWorkflow::stopClipWorkflow( ClipWorkflow* cw ) ...@@ -144,7 +142,6 @@ void TrackWorkflow::stopClipWorkflow( ClipWorkflow* cw )
cw->getState() == ClipWorkflow::Ready || cw->getState() == ClipWorkflow::Ready ||
cw->getState() == ClipWorkflow::EndReached ) cw->getState() == ClipWorkflow::EndReached )
{ {
qDebug() << "Stopping from sleeping / ready / endreached state for clip " << cw->debugId;
cw->getStateLock()->unlock(); cw->getStateLock()->unlock();
cw->queryStateChange( ClipWorkflow::Stopping ); cw->queryStateChange( ClipWorkflow::Stopping );
cw->wake(); cw->wake();
...@@ -152,19 +149,15 @@ void TrackWorkflow::stopClipWorkflow( ClipWorkflow* cw ) ...@@ -152,19 +149,15 @@ void TrackWorkflow::stopClipWorkflow( ClipWorkflow* cw )
} }
else if ( cw->getState() == ClipWorkflow::Rendering ) else if ( cw->getState() == ClipWorkflow::Rendering )
{ {
qDebug() << "Stopping from rendering state for clip" << cw->debugId;
cw->getStateLock()->unlock(); cw->getStateLock()->unlock();
while ( cw->isRendering() == true ) while ( cw->isRendering() == true )
usleep( 100 ); usleep( 100 );
qDebug() << "Rendering completed" << cw->debugId;
cw->queryStateChange( ClipWorkflow::Stopping ); cw->queryStateChange( ClipWorkflow::Stopping );
cw->wake(); cw->wake();
cw->stop(); cw->stop();
qDebug() << "Mediaplayer Stop asked for clip" << cw->debugId;
} }
else if ( cw->getState() == ClipWorkflow::Initializing ) else if ( cw->getState() == ClipWorkflow::Initializing )
{ {
qDebug() << "Stopping from initializing state for clip" << cw->debugId;
cw->getStateLock()->unlock(); cw->getStateLock()->unlock();
while ( cw->isReady() == false ) while ( cw->isReady() == false )
usleep( 20 ); usleep( 20 );
...@@ -196,7 +189,6 @@ unsigned char* TrackWorkflow::getOutput( qint64 currentFrame ) ...@@ -196,7 +189,6 @@ unsigned char* TrackWorkflow::getOutput( qint64 currentFrame )
{ {
if ( needRepositioning == true ) if ( needRepositioning == true )
{ {
qDebug() << "Repositionning";
ret = renderClip( cw, true, ret = renderClip( cw, true,
( (float)( currentFrame - start ) / (float)(cw->getClip()->getLength()) ) ); ( (float)( currentFrame - start ) / (float)(cw->getClip()->getLength()) ) );
} }
......
...@@ -49,11 +49,8 @@ void ListViewMediaItem::snapshotChanged() ...@@ -49,11 +49,8 @@ void ListViewMediaItem::snapshotChanged()
QTime length; QTime length;
length = length.addSecs( m_media->getLength() / 1000 ); length = length.addSecs( m_media->getLength() / 1000 );
qDebug() << m_media->getLength();
qDebug() << length;
setToolTip( "Filename: " + m_media->getFileInfo()->fileName() + "\n" + setToolTip( "Filename: " + m_media->getFileInfo()->fileName() + "\n" +
"Length: " + length.toString() ); "Length: " + length.toString() );
//"Length: " + length.toString("h 'h' m 'm' s 's'") );
} }
const Media* ListViewMediaItem::getMedia() const const Media* ListViewMediaItem::getMedia() const
......
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