X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=video_encoder.h;fp=video_encoder.h;h=368037d94fbdfcebcd098047a5acfc3e878dffa4;hb=e066f18188fde1e6bd0b698c89427119cbffaaa3;hp=acb8340fdee333c16b86f9b7e690e7c311afecea;hpb=a59184c5ad3126b439e11cf238c702680909b023;p=nageru diff --git a/video_encoder.h b/video_encoder.h index acb8340..368037d 100644 --- a/video_encoder.h +++ b/video_encoder.h @@ -40,8 +40,18 @@ public: ~VideoEncoder(); void add_audio(int64_t pts, std::vector audio); - bool begin_frame(GLuint *y_tex, GLuint *cbcr_tex); - RefCountedGLsync end_frame(int64_t pts, int64_t duration, const std::vector &input_frames); + + // Allocate a frame to render into. The returned two textures + // are yours to render into (build them into an FBO). + // Call end_frame() when you're done. + bool begin_frame(int64_t pts, int64_t duration, const std::vector &input_frames, GLuint *y_tex, GLuint *cbcr_tex); + + // Call after you are done rendering into the frame; at this point, + // y_tex and cbcr_tex will be assumed done, and handed over to the + // encoder. The returned fence is purely a convenience; you do not + // need to use it for anything, but it's useful if you wanted to set + // one anyway. + RefCountedGLsync end_frame(); // Does a cut of the disk stream immediately ("frame" is used for the filename only). void do_cut(int frame);