Exemplo n.º 1
0
void DirectShowSampleScheduler::setFlushing(bool flushing)
{
    QMutexLocker locker(&m_mutex);

    const bool isFlushing = m_state & Flushing;

    if (isFlushing != flushing) {
        if (flushing) {
            m_state |= Flushing;

            for (DirectShowTimedSample *sample = m_head; sample; sample = sample->remove()) {
                sample->unschedule(m_clock);

                m_semaphore.release(1);
            }
            m_head = 0;
            m_tail = 0;

            ::SetEvent(m_flushEvent);
        } else {
            m_state &= ~Flushing;

            if (m_state != Stopped)
                ::ResetEvent(m_flushEvent);
        }
    }
}
Exemplo n.º 2
0
void DirectShowSampleScheduler::stop()
{
    QMutexLocker locker(&m_mutex);

    m_state = m_state & Flushing;

    for (DirectShowTimedSample *sample = m_head; sample; sample = sample->remove()) {
        sample->unschedule(m_clock);
        
        m_semaphore.release(1);
    }

    m_head = 0;
    m_tail = 0;
}