X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=theme.cpp;h=71970c90f3ac4e849f3c0252172cb558f65544bc;hb=f1ce3c5618f769b1388b39c637877d242c8ddeed;hp=bc57b0d209cb329571c594ed904991c6ff57d150;hpb=cd48c8ab6d7425d4b4d9fdb2493da69b44848c9e;p=nageru diff --git a/theme.cpp b/theme.cpp index bc57b0d..71970c9 100644 --- a/theme.cpp +++ b/theme.cpp @@ -431,6 +431,23 @@ int HTMLInput_set_url(lua_State* L) return 0; } +int HTMLInput_reload(lua_State* L) +{ + assert(lua_gettop(L) == 1); + CEFCapture **video_input = (CEFCapture **)luaL_checkudata(L, 1, "HTMLInput"); + (*video_input)->reload(); + return 0; +} + +int HTMLInput_set_max_fps(lua_State* L) +{ + assert(lua_gettop(L) == 2); + CEFCapture **video_input = (CEFCapture **)luaL_checkudata(L, 1, "HTMLInput"); + int max_fps = lrint(luaL_checknumber(L, 2)); + (*video_input)->set_max_fps(max_fps); + return 0; +} + int HTMLInput_get_signal_num(lua_State* L) { assert(lua_gettop(L) == 1); @@ -648,9 +665,11 @@ const luaL_Reg VideoInput_funcs[] = { }; const luaL_Reg HTMLInput_funcs[] = { - // TODO: reload, execute_javascript, perhaps set_max_fps? + // TODO: execute_javascript { "new", HTMLInput_new }, { "set_url", HTMLInput_set_url }, + { "reload", HTMLInput_reload }, + { "set_max_fps", HTMLInput_set_max_fps }, { "get_signal_num", HTMLInput_get_signal_num }, { NULL, NULL } };