]> git.sesse.net Git - nageru/blobdiff - theme.cpp
Implement HTMLInput::set_max_fps().
[nageru] / theme.cpp
index d43cc3299c529f759fcbd692fa98fec74465aabe..71970c90f3ac4e849f3c0252172cb558f65544bc 100644 (file)
--- a/theme.cpp
+++ b/theme.cpp
@@ -422,6 +422,32 @@ int HTMLInput_new(lua_State* L)
        return ret;
 }
 
+int HTMLInput_set_url(lua_State* L)
+{
+       assert(lua_gettop(L) == 2);
+       CEFCapture **video_input = (CEFCapture **)luaL_checkudata(L, 1, "HTMLInput");
+       string new_url = checkstdstring(L, 2);
+       (*video_input)->set_url(new_url);
+       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);
@@ -639,8 +665,11 @@ const luaL_Reg VideoInput_funcs[] = {
 };
 
 const luaL_Reg HTMLInput_funcs[] = {
-       // TODO: reload, set_url, execute_javascript, perhaps change_framerate?
+       // 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 }
 };