update:VideoBuffer stop重命名为interrupt

This commit is contained in:
Barry 2019-06-15 18:29:19 +08:00
parent 83fbdb5c23
commit 667b09259c
3 changed files with 6 additions and 6 deletions

View file

@ -235,7 +235,7 @@ void Decoder::stopDecode()
{
m_quit = true;
if (m_vb) {
m_vb->stop();
m_vb->interrupt();
}
wait();
}

View file

@ -74,7 +74,7 @@ bool VideoBuffer::offerDecodedFrame()
#ifndef SKIP_FRAMES
// if SKIP_FRAMES is disabled, then the decoder must wait for the current
// frame to be consumed
while (!m_renderingFrameConsumed && !m_stopped) {
while (!m_renderingFrameConsumed && !m_interrupted) {
m_renderingFrameConsumedCond.wait(&m_mutex);
}
#else
@ -105,11 +105,11 @@ const AVFrame *VideoBuffer::consumeRenderedFrame()
return m_renderingframe;
}
void VideoBuffer::stop()
void VideoBuffer::interrupt()
{
#ifndef SKIP_FRAMES
m_mutex.lock();
m_stopped = true;
m_interrupted = true;
m_mutex.unlock();
// wake up blocking wait
m_renderingFrameConsumedCond.wakeOne();

View file

@ -33,7 +33,7 @@ public:
const AVFrame* consumeRenderedFrame();
// wake up and avoid any blocking call
void stop();
void interrupt();
private:
void swap();
@ -47,7 +47,7 @@ private:
#ifndef SKIP_FRAMES
QWaitCondition m_renderingFrameConsumedCond;
bool m_stopped = true;
bool m_interrupted = true;
#endif
};