New upstream version 25.0.3+dfsg1
This commit is contained in:
parent
04fe0efc67
commit
8b2e5f2130
569 changed files with 62491 additions and 5875 deletions
7
deps/obs-scripting/CMakeLists.txt
vendored
7
deps/obs-scripting/CMakeLists.txt
vendored
|
|
@ -7,6 +7,11 @@ endif()
|
|||
|
||||
project(obs-scripting)
|
||||
|
||||
if(POLICY CMP0068)
|
||||
# RPATH settings on macOS do not affect install_name.
|
||||
cmake_policy(SET CMP0068 NEW)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
set(obs-scripting_PLATFORM_DEPS
|
||||
w32-pthreads)
|
||||
|
|
@ -75,7 +80,7 @@ if(NOT PYTHONLIBS_FOUND AND NOT LUAJIT_FOUND)
|
|||
return()
|
||||
endif()
|
||||
|
||||
set(SCRIPTING_ENABLED ON CACHE BOOL "Interal global cmake variable" FORCE)
|
||||
set(SCRIPTING_ENABLED ON CACHE BOOL "Internal global cmake variable" FORCE)
|
||||
|
||||
if(UI_ENABLED)
|
||||
set(EXTRA_LIBS obs-frontend-api)
|
||||
|
|
|
|||
|
|
@ -331,6 +331,76 @@ static PyObject *add_save_callback(PyObject *self, PyObject *args)
|
|||
return python_none();
|
||||
}
|
||||
|
||||
static void frontend_event_callback(enum obs_frontend_event event, void *priv)
|
||||
{
|
||||
struct python_obs_callback *cb = priv;
|
||||
|
||||
if (cb->base.removed) {
|
||||
obs_frontend_remove_event_callback(frontend_event_callback, cb);
|
||||
return;
|
||||
}
|
||||
|
||||
lock_python();
|
||||
|
||||
PyObject *args = Py_BuildValue("(i)", event);
|
||||
|
||||
struct python_obs_callback *last_cb = cur_python_cb;
|
||||
cur_python_cb = cb;
|
||||
cur_python_script = (struct obs_python_script *)cb->base.script;
|
||||
|
||||
PyObject *py_ret = PyObject_CallObject(cb->func, args);
|
||||
Py_XDECREF(py_ret);
|
||||
py_error();
|
||||
|
||||
cur_python_script = NULL;
|
||||
cur_python_cb = last_cb;
|
||||
|
||||
Py_XDECREF(args);
|
||||
|
||||
unlock_python();
|
||||
}
|
||||
|
||||
static PyObject *remove_event_callback(PyObject *self, PyObject *args)
|
||||
{
|
||||
struct obs_python_script *script = cur_python_script;
|
||||
PyObject *py_cb = NULL;
|
||||
|
||||
UNUSED_PARAMETER(self);
|
||||
|
||||
if (!parse_args(args, "O", &py_cb))
|
||||
return python_none();
|
||||
if (!py_cb || !PyFunction_Check(py_cb))
|
||||
return python_none();
|
||||
|
||||
struct python_obs_callback *cb =
|
||||
find_python_obs_callback(script, py_cb);
|
||||
if (cb)
|
||||
remove_python_obs_callback(cb);
|
||||
return python_none();
|
||||
}
|
||||
|
||||
static void add_event_callback_defer(void *cb)
|
||||
{
|
||||
obs_frontend_add_event_callback(frontend_event_callback, cb);
|
||||
}
|
||||
|
||||
static PyObject *add_event_callback(PyObject *self, PyObject *args)
|
||||
{
|
||||
struct obs_python_script *script = cur_python_script;
|
||||
PyObject *py_cb = NULL;
|
||||
|
||||
UNUSED_PARAMETER(self);
|
||||
|
||||
if (!parse_args(args, "O", &py_cb))
|
||||
return python_none();
|
||||
if (!py_cb || !PyFunction_Check(py_cb))
|
||||
return python_none();
|
||||
|
||||
struct python_obs_callback *cb = add_python_obs_callback(script, py_cb);
|
||||
defer_call_post(add_event_callback_defer, cb);
|
||||
return python_none();
|
||||
}
|
||||
|
||||
/* ----------------------------------- */
|
||||
|
||||
void add_python_frontend_funcs(PyObject *module)
|
||||
|
|
@ -353,6 +423,8 @@ void add_python_frontend_funcs(PyObject *module)
|
|||
DEF_FUNC(set_current_profile),
|
||||
DEF_FUNC(remove_save_callback),
|
||||
DEF_FUNC(add_save_callback),
|
||||
DEF_FUNC(remove_event_callback),
|
||||
DEF_FUNC(add_event_callback),
|
||||
|
||||
#undef DEF_FUNC
|
||||
{0}};
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ bool import_python(const char *python_path)
|
|||
IMPORT_FUNC(PyExc_RuntimeError);
|
||||
IMPORT_FUNC(PyObject_GetAttr);
|
||||
IMPORT_FUNC(PyUnicode_FromString);
|
||||
IMPORT_FUNC(PyDict_New);
|
||||
IMPORT_FUNC(PyDict_GetItemString);
|
||||
IMPORT_FUNC(PyDict_SetItemString);
|
||||
IMPORT_FUNC(PyCFunction_NewEx);
|
||||
|
|
@ -140,6 +141,7 @@ bool import_python(const char *python_path)
|
|||
IMPORT_FUNC(PyLong_FromUnsignedLongLong);
|
||||
IMPORT_FUNC(PyArg_VaParse);
|
||||
IMPORT_FUNC(_Py_NoneStruct);
|
||||
IMPORT_FUNC(PyTuple_New);
|
||||
|
||||
#undef IMPORT_FUNC
|
||||
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ PY_EXTERN PyObject *(*Import_PyExc_TypeError);
|
|||
PY_EXTERN PyObject *(*Import_PyExc_RuntimeError);
|
||||
PY_EXTERN PyObject *(*Import_PyObject_GetAttr)(PyObject *, PyObject *);
|
||||
PY_EXTERN PyObject *(*Import_PyUnicode_FromString)(const char *u);
|
||||
PY_EXTERN PyObject *(*Import_PyDict_New)(void);
|
||||
PY_EXTERN PyObject *(*Import_PyDict_GetItemString)(PyObject *dp,
|
||||
const char *key);
|
||||
PY_EXTERN int (*Import_PyDict_SetItemString)(PyObject *dp, const char *key,
|
||||
|
|
@ -133,6 +134,7 @@ PY_EXTERN PyObject *(*Import_PyUnicode_AsUTF8String)(PyObject *unicode);
|
|||
PY_EXTERN PyObject *(*Import_PyLong_FromUnsignedLongLong)(unsigned long long);
|
||||
PY_EXTERN int (*Import_PyArg_VaParse)(PyObject *, const char *, va_list);
|
||||
PY_EXTERN PyObject(*Import__Py_NoneStruct);
|
||||
PY_EXTERN PyObject *(*Import_PyTuple_New)(Py_ssize_t size);
|
||||
|
||||
extern bool import_python(const char *python_path);
|
||||
|
||||
|
|
@ -174,6 +176,7 @@ extern bool import_python(const char *python_path);
|
|||
#define PyExc_RuntimeError (*Import_PyExc_RuntimeError)
|
||||
#define PyObject_GetAttr Import_PyObject_GetAttr
|
||||
#define PyUnicode_FromString Import_PyUnicode_FromString
|
||||
#define PyDict_New Import_PyDict_New
|
||||
#define PyDict_GetItemString Import_PyDict_GetItemString
|
||||
#define PyDict_SetItemString Import_PyDict_SetItemString
|
||||
#define PyCFunction_NewEx Import_PyCFunction_NewEx
|
||||
|
|
@ -206,6 +209,7 @@ extern bool import_python(const char *python_path);
|
|||
#define PyLong_FromUnsignedLongLong Import_PyLong_FromUnsignedLongLong
|
||||
#define PyArg_VaParse Import_PyArg_VaParse
|
||||
#define _Py_NoneStruct (*Import__Py_NoneStruct)
|
||||
#define PyTuple_New Import_PyTuple_New
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
5
deps/obs-scripting/obslua/CMakeLists.txt
vendored
5
deps/obs-scripting/obslua/CMakeLists.txt
vendored
|
|
@ -2,8 +2,13 @@ cmake_minimum_required(VERSION 2.8)
|
|||
project(obslua)
|
||||
|
||||
if(POLICY CMP0078)
|
||||
# UseSWIG generates standard target names.
|
||||
cmake_policy(SET CMP0078 OLD)
|
||||
endif()
|
||||
if(POLICY CMP0086)
|
||||
# UseSWIG honors SWIG_MODULE_NAME via -module flag.
|
||||
cmake_policy(SET CMP0086 OLD)
|
||||
endif()
|
||||
|
||||
find_package(SWIG 2 REQUIRED)
|
||||
include(${SWIG_USE_FILE})
|
||||
|
|
|
|||
4
deps/obs-scripting/obslua/obslua.i
vendored
4
deps/obs-scripting/obslua/obslua.i
vendored
|
|
@ -7,6 +7,8 @@
|
|||
#include <graphics/vec4.h>
|
||||
#include <graphics/vec3.h>
|
||||
#include <graphics/vec2.h>
|
||||
#include <graphics/matrix4.h>
|
||||
#include <graphics/matrix3.h>
|
||||
#include <graphics/quat.h>
|
||||
#include <graphics/image-file.h>
|
||||
#include <obs.h>
|
||||
|
|
@ -82,6 +84,8 @@ static inline void wrap_blog(int log_level, const char *message)
|
|||
%include "graphics/vec4.h"
|
||||
%include "graphics/vec3.h"
|
||||
%include "graphics/vec2.h"
|
||||
%include "graphics/matrix4.h"
|
||||
%include "graphics/matrix3.h"
|
||||
%include "graphics/quat.h"
|
||||
%include "graphics/image-file.h"
|
||||
%include "obs-scripting-config.h"
|
||||
|
|
|
|||
5
deps/obs-scripting/obspython/CMakeLists.txt
vendored
5
deps/obs-scripting/obspython/CMakeLists.txt
vendored
|
|
@ -2,8 +2,13 @@ cmake_minimum_required(VERSION 2.8)
|
|||
project(obspython)
|
||||
|
||||
if(POLICY CMP0078)
|
||||
# UseSWIG generates standard target names.
|
||||
cmake_policy(SET CMP0078 OLD)
|
||||
endif()
|
||||
if(POLICY CMP0086)
|
||||
# UseSWIG honors SWIG_MODULE_NAME via -module flag.
|
||||
cmake_policy(SET CMP0086 OLD)
|
||||
endif()
|
||||
|
||||
find_package(SWIG 2 REQUIRED)
|
||||
include(${SWIG_USE_FILE})
|
||||
|
|
|
|||
4
deps/obs-scripting/obspython/obspython.i
vendored
4
deps/obs-scripting/obspython/obspython.i
vendored
|
|
@ -8,6 +8,8 @@
|
|||
#include <graphics/vec4.h>
|
||||
#include <graphics/vec3.h>
|
||||
#include <graphics/vec2.h>
|
||||
#include <graphics/matrix4.h>
|
||||
#include <graphics/matrix3.h>
|
||||
#include <graphics/quat.h>
|
||||
#include <obs.h>
|
||||
#include <obs-hotkey.h>
|
||||
|
|
@ -81,6 +83,8 @@ static inline void wrap_blog(int log_level, const char *message)
|
|||
%include "graphics/vec4.h"
|
||||
%include "graphics/vec3.h"
|
||||
%include "graphics/vec2.h"
|
||||
%include "graphics/matrix4.h"
|
||||
%include "graphics/matrix3.h"
|
||||
%include "graphics/quat.h"
|
||||
%include "obs-scripting-config.h"
|
||||
%include "obs-data.h"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue