Пример #1
0
bool fcExrContext::beginFrame(const char *path, int width, int height)
{
    if (m_task != nullptr) {
        fcDebugLog("fcExrContext::beginFrame(): beginFrame() is already called. maybe you forgot to call endFrame().");
        return false;
    }

    // 実行中のタスクの数が上限に達している場合適当に待つ
    if (m_active_task_count >= m_conf.max_tasks)
    {
        std::this_thread::sleep_for(std::chrono::milliseconds(10));
        if (m_active_task_count >= m_conf.max_tasks)
        {
            m_tasks.wait();
        }
    }

    m_task = new fcExrTaskData(path, width, height, m_conf.compression);
    return true;
}