use PBO for timelapse data read

This commit is contained in:
2019-11-05 18:25:25 +01:00
parent 4b6316bf68
commit 52ad58aec4
8 changed files with 212 additions and 9 deletions

View File

@@ -792,7 +792,7 @@ void App::rec_loop()
rec_running = true;
while(rec_running)
{
std::unique_ptr<Image> frame;
std::unique_ptr<PBO> frame;
std::unique_lock<std::mutex> lock(rec_mutex);
rec_cv.wait(lock, [this] { return !(rec_frames.empty() && rec_running); });
if (!rec_running)
@@ -809,7 +809,10 @@ void App::rec_loop()
lock.unlock();
if (frame && Canvas::I->m_encoder)
{
Canvas::I->m_encoder->encode(*frame);
ImageRef img;
img.create(frame->width, frame->height, frame->map());
Canvas::I->m_encoder->encode(img);
frame->unmap();
LOG("frame encoded");
}
update_rec_frames();