The legacy mp.set_osd_ass(...) is still supported (but also still undocumented) as a wrapper for the new mp.create_osd_overlay(...).
Showing the changes to player/javascript.c (1 of 3 files). Show all
Unified · Split
| @@ -732,17 +732,6 @@ static void script_get_time_ms(js_State *J) · 731 unmodified lines | ||
| 732 | 732 | js_pushnumber(J, mpv_get_time_us(jclient(J)) / (double)(1000)); |
| 733 | 733 | } |
| 734 | 734 | |
| 735 | −static void script_set_osd_ass(js_State *J) | |
| 736 | −{ | |
| 737 | − struct script_ctx *ctx = jctx(J); | |
| 738 | − int res_x = jsL_checkint(J, 1); | |
| 739 | − int res_y = jsL_checkint(J, 2); | |
| 740 | − const char *text = js_tostring(J, 3); | |
| 741 | − //osd_set_external(ctx->mpctx->osd, ctx->client, res_x, res_y, (char *)text); | |
| 742 | − mp_wakeup_core(ctx->mpctx); | |
| 743 | − push_success(J); | |
| 744 | −} | |
| 745 | − | |
| 746 | 735 | // push object with properties names (NULL terminated) with respective vals |
| 747 | 736 | static void push_nums_obj(js_State *J, const char * const names[], |
| 748 | 737 | const double vals[]) |
| @@ -754,16 +743,6 @@ static void push_nums_obj(js_State *J, const char * const names[], · 5 unmodified lines | ||
| 754 | 743 | } |
| 755 | 744 | } |
| 756 | 745 | |
| 757 | −// args: none, return: object with properties width, height, aspect | |
| 758 | −static void script_get_osd_size(js_State *J) | |
| 759 | −{ | |
| 760 | − struct mp_osd_res r = osd_get_vo_res(jctx(J)->mpctx->osd); | |
| 761 | − double ar = 1.0 * r.w / MPMAX(r.h, 1) / (r.display_par ? r.display_par : 1); | |
| 762 | − const char * const names[] = {"width", "height", "aspect", NULL}; | |
| 763 | − const double vals[] = {r.w, r.h, ar}; | |
| 764 | − push_nums_obj(J, names, vals); | |
| 765 | −} | |
| 766 | − | |
| 767 | 746 | // args: none, return: object with properties top, bottom, left, right |
| 768 | 747 | static void script_get_osd_margins(js_State *J) |
| 769 | 748 | { |
| @@ -1258,8 +1237,6 @@ static const struct fn_entry main_fns[] = { · 488 unmodified lines | ||
| 1258 | 1237 | FN_ENTRY(get_wakeup_pipe, 0), |
| 1259 | 1238 | FN_ENTRY(_hook_add, 3), |
| 1260 | 1239 | FN_ENTRY(_hook_continue, 1), |
| 1261 | − FN_ENTRY(set_osd_ass, 3), | |
| 1262 | − FN_ENTRY(get_osd_size, 0), | |
| 1263 | 1240 | FN_ENTRY(get_osd_margins, 0), |
| 1264 | 1241 | FN_ENTRY(get_mouse_pos, 0), |
| 1265 | 1242 | FN_ENTRY(input_set_section_mouse_area, 5), |