void V4L2encStreamHandler::Close(void)
{
#if 0
// VBI
    if (m_vbi_thread != nullptr)
    {
        m_vbi_thread->wait();
        delete m_vbi_thread;
        m_vbi_thread = nullptr;

        CloseVBIDevice();
    }
#endif

    if (m_drb)
    {
        m_drb->Stop();
        delete m_drb;
        m_drb = nullptr;
    }

    m_v4l2.Close();

    if (m_fd >= 0)
    {
        close(m_fd);
        m_fd = -1;
        LOG(VB_RECORD, LOG_INFO, LOC + "Closed.");
    }

    m_streaming_cnt.fetchAndStoreAcquire(0);
}
Example #2
0
V4LRecorder::~V4LRecorder()
{
    {
        QMutexLocker locker(&pauseLock);
        request_helper = false;
        unpauseWait.wakeAll();
    }

    if (vbi_thread)
    {
        vbi_thread->wait();
        delete vbi_thread;
        vbi_thread = NULL;
        CloseVBIDevice();
    }
}