Commit 9d0937b9 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Removing the concept of required_state, as it is made useless by the refactor.

parent 5421947d
......@@ -32,12 +32,10 @@
ClipWorkflow::ClipWorkflow( Clip::Clip* clip ) :
m_mediaPlayer(NULL),
m_requiredState( ClipWorkflow::None ),
m_clip( clip ),
m_state( ClipWorkflow::Stopped )
{
m_stateLock = new QReadWriteLock;
m_requiredStateLock = new QMutex;
m_initWaitCond = new WaitCondition;
m_pausingStateWaitCond = new WaitCondition;
m_renderLock = new QMutex;
......@@ -51,24 +49,11 @@ ClipWorkflow::~ClipWorkflow()
delete m_renderLock;
delete m_pausingStateWaitCond;
delete m_initWaitCond;
delete m_requiredStateLock;
delete m_stateLock;
delete m_availableBuffersMutex;
delete m_computedBuffersMutex;
}
void ClipWorkflow::checkStateChange()
{
QMutexLocker lock( m_requiredStateLock );
QWriteLocker lock2( m_stateLock );
if ( m_requiredState != ClipWorkflow::None )
{
m_state = m_requiredState;
// qDebug() << '[' << (void*)this << "] Applying required state change:" << m_state;
m_requiredState = ClipWorkflow::None;
}
}
void ClipWorkflow::initialize()
{
if ( m_clip->getParent()->getFileType() == Media::Image )
......@@ -140,8 +125,6 @@ void ClipWorkflow::stop()
MemoryPool<LibVLCpp::MediaPlayer>::getInstance()->release( m_mediaPlayer );
m_mediaPlayer = NULL;
setState( Stopped );
QMutexLocker lock( m_requiredStateLock );
m_requiredState = ClipWorkflow::None;
delete m_vlcMedia;
}
else
......@@ -168,12 +151,6 @@ void ClipWorkflow::setState( State state )
m_state = state;
}
void ClipWorkflow::queryStateChange( State newState )
{
QMutexLocker lock( m_requiredStateLock );
m_requiredState = newState;
}
QReadWriteLock* ClipWorkflow::getStateLock()
{
return m_stateLock;
......@@ -245,7 +222,6 @@ void ClipWorkflow::commonUnlock()
// qDebug() << "feeding cont wait mutex acquired. Type:" << debugType;
m_feedingCondWait->wake();
}
checkStateChange();
}
void ClipWorkflow::computePtsDiff( qint64 pts )
......
......@@ -178,9 +178,6 @@ class ClipWorkflow : public QObject
private:
LibVLCpp::MediaPlayer* m_mediaPlayer;
State m_requiredState;
QMutex* m_requiredStateLock;
WaitCondition* m_initWaitCond;
WaitCondition* m_pausingStateWaitCond;
......@@ -207,13 +204,6 @@ class ClipWorkflow : public QObject
qint64 m_pauseDuration;
int debugType;
protected:
/**
* \warning Don't ever call this method from anywhere else than the unlock() method
*/
void checkStateChange();
private slots:
void loadingComplete();
void clipEndReached();
......
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