2014-01-18 00:19:20 +00:00
|
|
|
#ifndef MP_OSD_STATE_H_
|
|
|
|
#define MP_OSD_STATE_H_
|
|
|
|
|
|
|
|
#include <pthread.h>
|
|
|
|
|
|
|
|
#include "osd.h"
|
|
|
|
|
2016-03-08 20:54:17 +00:00
|
|
|
enum mp_osdtype {
|
|
|
|
OSDTYPE_SUB,
|
|
|
|
OSDTYPE_SUB2, // IDs must be numerically successive
|
|
|
|
|
|
|
|
OSDTYPE_OSD,
|
|
|
|
|
|
|
|
OSDTYPE_EXTERNAL,
|
|
|
|
OSDTYPE_EXTERNAL2,
|
|
|
|
|
|
|
|
OSDTYPE_COUNT
|
|
|
|
};
|
|
|
|
|
2016-03-08 20:29:29 +00:00
|
|
|
struct ass_state {
|
|
|
|
struct mp_log *log;
|
|
|
|
struct ass_track *track;
|
|
|
|
struct ass_renderer *render;
|
|
|
|
struct ass_library *library;
|
|
|
|
};
|
|
|
|
|
2014-01-18 00:19:20 +00:00
|
|
|
struct osd_object {
|
|
|
|
int type; // OSDTYPE_*
|
|
|
|
bool is_sub;
|
|
|
|
|
2016-03-08 20:42:08 +00:00
|
|
|
// OSDTYPE_OSD
|
2016-09-16 15:17:32 +00:00
|
|
|
bool osd_changed;
|
2014-01-18 00:19:20 +00:00
|
|
|
char *text;
|
|
|
|
struct osd_progbar_state progbar_state;
|
|
|
|
|
|
|
|
// OSDTYPE_SUB/OSDTYPE_SUB2
|
2015-11-17 00:54:02 +00:00
|
|
|
struct dec_sub *sub;
|
2014-01-18 00:19:20 +00:00
|
|
|
|
|
|
|
// OSDTYPE_EXTERNAL
|
2016-03-08 20:42:08 +00:00
|
|
|
struct osd_external *externals;
|
|
|
|
int num_externals;
|
2014-01-18 00:19:20 +00:00
|
|
|
|
|
|
|
// OSDTYPE_EXTERNAL2
|
|
|
|
struct sub_bitmaps *external2;
|
|
|
|
|
|
|
|
// VO cache state
|
2015-03-18 11:33:14 +00:00
|
|
|
int vo_change_id;
|
2014-01-18 00:19:20 +00:00
|
|
|
struct mp_osd_res vo_res;
|
|
|
|
|
|
|
|
// Internally used by osd_libass.c
|
2016-06-30 19:38:50 +00:00
|
|
|
bool changed;
|
2016-03-08 20:29:29 +00:00
|
|
|
struct ass_state ass;
|
2016-06-30 19:38:50 +00:00
|
|
|
struct mp_ass_packer *ass_packer;
|
|
|
|
struct ass_image **ass_imgs;
|
2014-01-18 00:19:20 +00:00
|
|
|
};
|
|
|
|
|
2016-03-08 20:42:08 +00:00
|
|
|
struct osd_external {
|
|
|
|
void *id;
|
|
|
|
char *text;
|
|
|
|
int res_x, res_y;
|
|
|
|
struct ass_state ass;
|
|
|
|
};
|
|
|
|
|
2014-01-18 00:19:20 +00:00
|
|
|
struct osd_state {
|
|
|
|
pthread_mutex_t lock;
|
|
|
|
|
|
|
|
struct osd_object *objs[MAX_OSD_PARTS];
|
|
|
|
|
|
|
|
bool render_subs_in_filter;
|
|
|
|
|
|
|
|
bool want_redraw;
|
2016-09-15 12:22:48 +00:00
|
|
|
bool want_redraw_notification;
|
2014-01-18 00:19:20 +00:00
|
|
|
|
|
|
|
struct MPOpts *opts;
|
|
|
|
struct mpv_global *global;
|
|
|
|
struct mp_log *log;
|
|
|
|
|
|
|
|
struct mp_draw_sub_cache *draw_cache;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|