This changes the way obs-scripting looks for and loads an available
Python 3 library. It tries to find a best possible version (starting
with Python 3.10) down to and including Python 3.6 by existing file
naming conventions and loads the most recent variant it can find.
User specified search path is either a Python installation directory
(Windows), or a Framework directory containing `Python.framework`
(macOS). The dll or dylib names are composed automatically.
The Python home path is also composed automatically on macOS (where
it has to point inside the Framework directory).
Fixes issues introduced by https://github.com/swig/swig/pull/2238. As
obs-scripting is not compatible with the SWIGPYTHON_BUILTIN, obspython
needs to disable this feature.
Due to swig using a hardcoded swig library path in self-compiled
variants, we need to pass our custom swig library path with every
invocation of swig on macOS.
CMake's `add_custom_command` function does _not_ inherit the environment
variables used during configuration, hence why it needs to be passed
explicitly on invocation.
Usage of CMake's "-E env" command module should allow for cross-platform
compatible invocation.
The obspython.i file requires `ENABLE_UI` to be defined for the swig
compiler to pull in the actual obs-frontend-api header. If this is not
the case, swig will not discover the required methods and ENUMs and
in turn will not make those available in the scripting environment.
The obslua.i file requires `ENABLE_UI` to be defined for the swig
compiler to pull in the actual obs-frontend-api header. If this is not
the case, swig will not discover the required methods and ENUMs and
in turn will not make those available in the scripting environment.
Previous FFmpeg deprecation fix, and optimization attempt causes short
videos to loop badly. Keep deprecation fix, and fix the rest later.
Fixes d528f6cafa
This updates glad for EGL and adds in several extensions.
EGL_EXT_platform_base
EGL_EXT_platform_xcb
EGL_KHR_image_base
EGL_KHR_image_pixmap
The xcb platform extension is unused but good to include if we want to
try removing more Xlib dependencies. platform_base is included for good
measure as other platform extensions technically build on it. image_base
and image_pixmap are for upcoming xcomposite over EGL support.
It also drops the unused create_context_no_error extensions.
In Python 3.9+, `PyCFunction_New` and `PyCFunction_NewEx` are themselves
macros around `PyMethod_New`. To fix the warning, both macros need to
be untouched for those Python versions, instead the actual function
`PyMethod_New` needs to be imported and aliased.
This commit:
- Adds the import of the `PyCMethod_New` symbol
- Adds the function definition for `Import_PyCMethod_New`
- Adds the `PyCMethod_New` function alias
macOS uses runtime lookup for symbols in obs-scripting. While this guard
fixes a compiler warning, it also leads to the `_PyCMethod_New` symbol
being undefined.
In turn any library linking with obs-scripting will then fail to load
because of that undefined symbol. Removing this guard fixes that issue.
* obs-scripting: Fix unused 'varargs' warning
* obs-scripting: Fix PyEval deprecation warnings
Remove PyEval_InitThreads() and PyEval_ThreadsInitialized() call for
Python 3.7 and later as Python calls it automatically now.
This removes deprecation warnings when using Python 3.9 or later.
https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads
Rec. 2020 is really an SDR spec, but I think HDR10 made it okay to slap
PQ on it, call it an HDR spec. Rec. 2100 came along after and formally
allowed the use of PQ/HLG, so we should use 2100 instead.
Status output related to OBS configuration is prefixed with the string
"OBS" and added padding for enabled and disabled features. This padding
was not aligned between platforms.
By moving the padding and prefix decoration into its own function,
both elements are controlled in a single place. CMake scripts were
changed to use this new function `obs_status` instead of using CMake's
`message` function directly.
In the years since this code was added, ALPN is now widely supported,
and NPN is being removed entirely in the latest version of nginx. It's
time to start using ALPN!