fprintf(stderr, "%s: avformat_new_stream() failed\n", output_filename);
exit(1);
}
- avstream->time_base = AVRational{1, frame_rate}; // TODO
+ avstream->time_base = AVRational{1, frame_rate};
avstream->codec->width = width;
avstream->codec->height = height;
- //avstream->codec->time_base = AVRational{1, 60}; // TODO
avstream->codec->time_base = AVRational{1, frame_rate};
avstream->codec->ticks_per_frame = 1; // or 2?
return true;
}
-void H264Encoder::end_frame(GLsync fence, const std::vector<FrameAllocator::Frame> &input_frames_to_release)
+void H264Encoder::end_frame(RefCountedGLsync fence, const std::vector<FrameAllocator::Frame> &input_frames_to_release)
{
{
unique_lock<mutex> lock(frame_queue_mutex);
}
// Wait for the GPU to be done with the frame.
- glClientWaitSync(frame.fence, 0, 0);
- glDeleteSync(frame.fence);
+ glClientWaitSync(frame.fence.get(), 0, 0);
// Release back any input frames we needed to render this frame.
// (Actually, those that were needed one output frame ago.)