move time-lapse frame grab from tick to rec_loop

This commit is contained in:
2019-11-09 14:14:59 +01:00
parent faff1dd979
commit a00f78de80
4 changed files with 18 additions and 43 deletions

View File

@@ -79,28 +79,6 @@ void App::tick(float dt)
main->tick(dt);
if (auto* main = layout[main_id])
main->tick(dt);
if (rec_running && Canvas::I->m_encoder)
{
auto t_now = std::chrono::high_resolution_clock::now();
float dt = std::chrono::duration<float>(t_now - canvas->m_canvas->m_disrty_stroke_time).count();
if (dt > 0.75f && canvas->m_canvas->m_dirty_stroke)
{
canvas->m_canvas->m_dirty_stroke = false;
LOG("rec tick");
PBO equirect;
App::I->render_task([&] {
Canvas::I->draw_merge(true);
});
equirect = Canvas::I->m_layers_merge.gen_equirect_pbo(Canvas::I->m_encoder->frame_size() / 4);
{
std::lock_guard<std::mutex> lock(rec_mutex);
rec_frames.emplace_back(std::make_unique<PBO>(std::move(equirect)));
rec_cv.notify_all();
}
}
}
}
void App::resize(float w, float h)