Frame frame;
frame.data = (uint8_t *)glMapBufferRange(buffer, 0, frame_size, permissions | map_bits | GL_MAP_PERSISTENT_BIT);
frame.data2 = frame.data + frame_size / 2;
+ frame.data_copy = new uint8_t[frame_size];
check_error();
frame.size = frame_size;
frame.userdata = &userdata[frame_idx];
void PBOFrameAllocator::destroy_frame(Frame *frame)
{
+ delete[] frame->data_copy;
+
GLuint pbo = ((Userdata *)frame->userdata)->pbo;
glBindBuffer(buffer, pbo);
check_error();
{
Frame vf;
- unique_lock<mutex> lock(freelist_mutex); // Meh.
+ lock_guard<mutex> lock(freelist_mutex); // Meh.
if (freelist.empty()) {
printf("Frame overrun (no more spare PBO frames), dropping frame!\n");
} else {
}
#endif
- unique_lock<mutex> lock(freelist_mutex);
+ lock_guard<mutex> lock(freelist_mutex);
freelist.push(frame);
//--sumsum;
}