1 #ifndef _TIMECODE_RENDERER_H
2 #define _TIMECODE_RENDERER_H 1
9 // A class to render a simple text string onto the picture using Qt and OpenGL.
19 class TimecodeRenderer {
21 TimecodeRenderer(movit::ResourcePool *resource_pool, unsigned display_width, unsigned display_height);
24 // Return a string with the current wall clock time and the
25 // logical stream time.
26 static std::string get_timecode_text(double pts, unsigned frame_num);
28 // The FBO is assumed to contain three outputs (Y', Cb/Cr and RGBA).
29 void render_timecode(GLuint fbo, const std::string &text);
32 void render_string_to_buffer(const std::string &text);
33 void render_buffer_to_fbo(GLuint fbo);
35 movit::ResourcePool *resource_pool;
36 unsigned display_width, display_height, height;
38 GLuint vbo; // Holds position and texcoord data.
40 //std::unique_ptr<unsigned char[]> pixel_buffer;
41 std::unique_ptr<QImage> image;
43 GLuint program_num; // Owned by <resource_pool>.
44 GLuint texture_sampler_uniform;
45 GLuint position_attribute_index, texcoord_attribute_index;