New upstream version 21.1.2+dfsg1

This commit is contained in:
Sebastian Ramacher 2018-05-29 21:13:02 +02:00
parent baafb6325b
commit 665f64a933
152 changed files with 3957 additions and 356 deletions

View file

@ -377,7 +377,7 @@ static void obs_lua_tick_callback(void *priv, float seconds)
lock_callback();
lua_pushnumber(script, (lua_Number)seconds);
call_func(obs_lua_tick_callback, 2, 0);
call_func(obs_lua_tick_callback, 1, 0);
unlock_callback();
}
@ -579,6 +579,32 @@ static int enum_sources(lua_State *script)
return 1;
}
/* -------------------------------------------- */
static bool source_enum_filters_proc(obs_source_t *source, obs_source_t *filter, void *param)
{
lua_State *script = param;
obs_source_get_ref(filter);
ls_push_libobs_obj(obs_source_t, filter, false);
size_t idx = lua_rawlen(script, -2);
lua_rawseti(script, -2, (int)idx + 1);
return true;
}
static int source_enum_filters(lua_State *script)
{
obs_source_t *source;
if (!ls_get_libobs_obj(obs_source_t, 1, &source))
return 0;
lua_newtable(script);
obs_source_enum_filters(source, source_enum_filters_proc, script);
return 1;
}
/* -------------------------------------------- */
static bool enum_items_proc(obs_scene_t *scene, obs_sceneitem_t *item,
@ -972,6 +998,7 @@ static void add_hook_functions(lua_State *script)
add_func("timer_remove", timer_remove);
add_func("timer_add", timer_add);
add_func("obs_enum_sources", enum_sources);
add_func("obs_source_enum_filters", source_enum_filters);
add_func("obs_scene_enum_items", scene_enum_items);
add_func("source_list_release", source_list_release);
add_func("sceneitem_list_release", sceneitem_list_release);

View file

@ -1595,6 +1595,8 @@ void obs_python_load(void)
extern void add_python_frontend_funcs(PyObject *module);
static bool python_loaded_at_all = false;
bool obs_scripting_load_python(const char *python_path)
{
if (python_loaded)
@ -1696,6 +1698,8 @@ out:
obs_python_unload();
}
python_loaded_at_all = success;
if (python_loaded)
obs_add_tick_callback(python_tick, NULL);
@ -1704,6 +1708,9 @@ out:
void obs_python_unload(void)
{
if (!python_loaded_at_all)
return;
if (python_loaded && Py_IsInitialized()) {
PyGILState_Ensure();
@ -1722,4 +1729,6 @@ void obs_python_unload(void)
pthread_mutex_destroy(&tick_mutex);
pthread_mutex_destroy(&timer_mutex);
dstr_free(&cur_py_log_chunk);
python_loaded_at_all = false;
}

View file

@ -213,6 +213,8 @@ void obs_scripting_unload(void)
pthread_mutex_destroy(&defer_call_mutex);
os_sem_destroy(defer_call_semaphore);
scripting_loaded = false;
}
const char **obs_scripting_supported_formats(void)

View file

@ -59,6 +59,7 @@ static inline void wrap_blog(int log_level, const char *message)
%ignore obs_add_main_render_callback;
%ignore obs_remove_main_render_callback;
%ignore obs_enum_sources;
%ignore obs_source_enum_filters;
%ignore obs_properties_add_button;
%ignore obs_property_set_modified_callback;
%ignore signal_handler_connect;