1 #ifndef MP_OSD_STATE_H_ 2 #define MP_OSD_STATE_H_ 3 4 #include <pthread.h> 5 6 #include "osd.h" 7 8 enum mp_osdtype { 9 OSDTYPE_SUB, 10 OSDTYPE_SUB2, // IDs must be numerically successive 11 12 OSDTYPE_OSD, 13 14 OSDTYPE_EXTERNAL, 15 OSDTYPE_EXTERNAL2, 16 17 OSDTYPE_COUNT 18 }; 19 20 struct ass_state { 21 struct mp_log *log; 22 struct ass_track *track; 23 struct ass_renderer *render; 24 struct ass_library *library; 25 int res_x, res_y; 26 bool changed; 27 struct mp_osd_res vo_res; // last known value 28 }; 29 30 struct osd_object { 31 int type; // OSDTYPE_* 32 bool is_sub; 33 34 // OSDTYPE_OSD 35 bool osd_changed; 36 char *text; 37 struct osd_progbar_state progbar_state; 38 39 // OSDTYPE_SUB/OSDTYPE_SUB2 40 struct dec_sub *sub; 41 42 // OSDTYPE_EXTERNAL 43 struct osd_external **externals; 44 int num_externals; 45 46 // OSDTYPE_EXTERNAL2 47 struct sub_bitmaps *external2; 48 49 // VO cache state 50 int vo_change_id; 51 struct mp_osd_res vo_res; 52 bool vo_had_output; 53 54 // Internally used by osd_libass.c 55 bool changed; 56 struct ass_state ass; 57 struct mp_ass_packer *ass_packer; 58 struct sub_bitmap_copy_cache *copy_cache; 59 struct ass_image **ass_imgs; 60 }; 61 62 struct osd_external { 63 struct osd_external_ass ov; 64 struct ass_state ass; 65 }; 66 67 struct osd_state { 68 pthread_mutex_t lock; 69 70 struct osd_object *objs[MAX_OSD_PARTS]; 71 72 bool render_subs_in_filter; 73 double force_video_pts; 74 75 bool want_redraw; 76 bool want_redraw_notification; 77 78 struct m_config_cache *opts_cache; 79 struct mp_osd_render_opts *opts; 80 struct mpv_global *global; 81 struct mp_log *log; 82 struct stats_ctx *stats; 83 84 struct mp_draw_sub_cache *draw_cache; 85 }; 86 87 // defined in osd_libass.c 88 struct sub_bitmaps *osd_object_get_bitmaps(struct osd_state *osd, 89 struct osd_object *obj, int format); 90 void osd_init_backend(struct osd_state *osd); 91 void osd_destroy_backend(struct osd_state *osd); 92 93 #endif 94