History

js: support mp.create_osd_overlay (match 07287262)

The legacy mp.set_osd_ass(...) is still supported (but also still undocumented) as a wrapper for the new mp.create_osd_overlay(...).

Avi Halachmi (:avih) committed 6 years ago

Commit 9f2fda71 parent 5a74bf53 files · +57 −23Browse files

Showing the changes to player/javascript.c (1 of 3 files). Show all

Unified · Split

player/javascript.c+0−23
@@ -732,17 +732,6 @@ static void script_get_time_ms(js_State *J) · 731 unmodified lines
732732 js_pushnumber(J, mpv_get_time_us(jclient(J)) / (double)(1000));
733733 }
734734
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−
746735 // push object with properties names (NULL terminated) with respective vals
747736 static void push_nums_obj(js_State *J, const char * const names[],
748737 const double vals[])
@@ -754,16 +743,6 @@ static void push_nums_obj(js_State *J, const char * const names[], · 5 unmodified lines
754743 }
755744 }
756745
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−
767746 // args: none, return: object with properties top, bottom, left, right
768747 static void script_get_osd_margins(js_State *J)
769748 {
@@ -1258,8 +1237,6 @@ static const struct fn_entry main_fns[] = { · 488 unmodified lines
12581237 FN_ENTRY(get_wakeup_pipe, 0),
12591238 FN_ENTRY(_hook_add, 3),
12601239 FN_ENTRY(_hook_continue, 1),
1261− FN_ENTRY(set_osd_ass, 3),
1262− FN_ENTRY(get_osd_size, 0),
12631240 FN_ENTRY(get_osd_margins, 0),
12641241 FN_ENTRY(get_mouse_pos, 0),
12651242 FN_ENTRY(input_set_section_mouse_area, 5),

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t