summaryrefslogtreecommitdiffstats
path: root/sub/osd_state.h
diff options
context:
space:
mode:
Diffstat (limited to 'sub/osd_state.h')
-rw-r--r--sub/osd_state.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/sub/osd_state.h b/sub/osd_state.h
index 8207cf0dda..9bb48f8153 100644
--- a/sub/osd_state.h
+++ b/sub/osd_state.h
@@ -1,9 +1,10 @@
#ifndef MP_OSD_STATE_H_
#define MP_OSD_STATE_H_
-#include <pthread.h>
+#include <stdatomic.h>
#include "osd.h"
+#include "osdep/threads.h"
enum mp_osdtype {
OSDTYPE_SUB,
@@ -23,6 +24,8 @@ struct ass_state {
struct ass_renderer *render;
struct ass_library *library;
int res_x, res_y;
+ bool changed;
+ struct mp_osd_res vo_res; // last known value
};
struct osd_object {
@@ -47,11 +50,13 @@ struct osd_object {
// VO cache state
int vo_change_id;
struct mp_osd_res vo_res;
+ bool vo_had_output;
// Internally used by osd_libass.c
bool changed;
struct ass_state ass;
struct mp_ass_packer *ass_packer;
+ struct sub_bitmap_copy_cache *copy_cache;
struct ass_image **ass_imgs;
};
@@ -61,12 +66,12 @@ struct osd_external {
};
struct osd_state {
- pthread_mutex_t lock;
+ mp_mutex lock;
struct osd_object *objs[MAX_OSD_PARTS];
bool render_subs_in_filter;
- double force_video_pts;
+ _Atomic double force_video_pts;
bool want_redraw;
bool want_redraw_notification;
@@ -75,13 +80,14 @@ struct osd_state {
struct mp_osd_render_opts *opts;
struct mpv_global *global;
struct mp_log *log;
+ struct stats_ctx *stats;
struct mp_draw_sub_cache *draw_cache;
};
-// defined in osd_libass.c and osd_dummy.c
-void osd_object_get_bitmaps(struct osd_state *osd, struct osd_object *obj,
- int format, struct sub_bitmaps *out_imgs);
+// defined in osd_libass.c
+struct sub_bitmaps *osd_object_get_bitmaps(struct osd_state *osd,
+ struct osd_object *obj, int format);
void osd_init_backend(struct osd_state *osd);
void osd_destroy_backend(struct osd_state *osd);