Commit Graph

314 Commits (0a218e06b7601c0e561db518b1b5878557cd1ebc)

Author SHA1 Message Date
Jim 9025d92f7a
Merge pull request #6771 from tytan652/no_more_OBS_UNUSED
Remove OBS_UNUSED
2022-07-20 05:19:13 -07:00
tytan652 ba6f9f3f46 obs-scripting: Replace OBS_UNUSED with UNUSED_PARAMETER
OBS_UNUSED is not portable to MSVC.
2022-07-20 08:22:08 +02:00
Richard Stanway 009fc43bee
deps/opts-parser: Skip parsing of empty strings 2022-07-20 03:29:59 +02:00
mvji f0b3593349 deps/media-playback: Fix invalid seek at reset
When AVFormatContext->startime is set to AV_NO_PTS
mp_media_reset try to seek to INT64_MIN
use 0 instead.
Fix loop with aac file
2022-07-16 16:29:02 -07:00
PatTheMav e27f90fa5a obs-scripting: Fix crashes introduced by Swig update to 4.1.0
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.
2022-07-13 16:50:09 -04:00
jpark37 5e3c824801 obs-scripting: Suppress long volatile warning 2022-07-11 22:07:10 -07:00
PatTheMav 62ca01e181 libcaption: Disable compiler warnings about non-exhaustive switch cases 2022-07-10 09:59:55 +10:00
PatTheMav 64efcd155d obs-scripting: Fix swig runtime header generation for macOS
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.
2022-07-07 14:19:23 -04:00
gxalpha e1776d872a deps/obs-scripting: Log script load/unload 2022-07-02 16:35:20 -07:00
jpark37 22fde5cdcd deps/media-playback: Fix metadata for hw_accel
av_hwframe_transfer_data doesn't seem to transfer metadata, so do it
manually.
2022-06-18 16:03:34 -07:00
Jim 1705edf8f9
Merge pull request #6475 from GeorgesStavracas/gbsneto/drop-glx
Au revoir, GLX
2022-05-28 17:04:17 -07:00
PatTheMav 29759ef8fb obs-scripting: Fix missing frontend bindings for Python
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.
2022-05-28 16:23:14 -07:00
PatTheMav 893d3ce218 obs-scripting: Fix missing frontend bindings for Lua
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.
2022-05-28 16:23:14 -07:00
jpark37 54f09fe6a7 deps/media-playback: Use metadata for HDR EETF
Used in situations where source luminance is greater than HDR nominal
peak setting to avoid clipping by applying BT.2408 maxRGB EETF.
2022-05-27 14:56:47 -07:00
Georges Basile Stavracas Neto 55811c1cb9 deps/glad: Drop glad-glx
It is now unused
2022-05-24 14:31:51 -03:00
jpark37 226249e1c3 deps/media-playback: Fix video looping
Previous FFmpeg deprecation fix, and optimization attempt causes short
videos to loop badly. Keep deprecation fix, and fix the rest later.

Fixes d528f6cafa
2022-05-21 15:28:08 -07:00
jp9000 50c174df07 deps/opts-parser: Add missing c extern for cpp 2022-05-17 05:37:04 -07:00
stopforumspam 3215189c97 deps/media-playback: Add support for FFmpeg options for media playback 2022-05-16 15:17:13 -04:00
Kurt Kartaltepe f4a820a4ea deps/glad: update Glad for EGL with new extensions
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.
2022-05-15 09:08:53 -03:00
PatTheMav 8d0131c519 obs-scripting: Fix macro redefinition warning
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
2022-05-14 16:10:11 -07:00
PatTheMav a0923c9b6e obs-scripting: Fix loading of scripting libraries with runtime lookup
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.
2022-05-14 16:10:11 -07:00
PatTheMav 4c1687901e obs-scripting: Fix compiler warnings 2022-05-04 12:09:04 -04:00
Jim 952988d9ec
Merge pull request #6231 from mvji/prores_pix_fmt
Add support for GPU conversion of YUV422P10LE, YUV444P12LE, YUVA444P12LE
2022-05-04 02:01:27 -07:00
tytan652 c98617849a obs-scripting: Fix compiler warnings
* 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
2022-05-04 01:37:10 -07:00
tytan652 865a358a52 media-playback: Fix unused-parameter warning 2022-05-04 01:37:10 -07:00
mvji 93490da4c2 obs-ffmpeg: Use YVYU for FFmpeg pix fmt YVYU422
This commit also modifies deps/media-playback and libobs.
2022-04-19 19:39:22 +02:00
mvji 5f35e73d8b deps/media-playback: Use YUV422 for planar 422 pix fmt
Instead of UYVY422
2022-04-19 19:39:05 +02:00
mvji ae94c35152 obs-ffmpeg: Add support for YUV422P10LE, YUV444P12LE, YUVA444P12LE
This commit also modifies deps/media-playback
2022-04-19 19:38:28 +02:00
jpark37 05b673381f deps/media-playback: Add P010 to closest_format
Used by HDR media playback with hardware decode.
2022-04-18 05:23:13 -07:00
wangshaohui d2fb302e5c deps/media-playback: Use avcodec_free_context to free AVCodecContext 2022-04-16 16:23:58 -07:00
jpark37 59dbc3eb81 libobs: Rename Rec. 2020 to Rec. 2100
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.
2022-04-10 00:13:52 -07:00
jpark37 6ed2edde71 deps/media-playback: Fix AVColorSpace usages
More completeness and consistency.
2022-04-09 21:20:10 -07:00
jpark37 007ed2c355 deps/media-playback: Add more accurate TRC hints
Allows us to tell the difference between HDR and high-precision SDR.
2022-04-08 17:19:23 -07:00
jpark37 848e128435 libobs,plugins: Replace video matrix function
video_format_get_parameters_for_format provides a more accurate matrix
than video_format_get_parameters.
2022-04-07 19:28:51 -07:00
wangshaohui db8145e8a2 obs-ffmpeg, win-dshow, deps/media-playback: Use recommended API for AVCodecContext 2022-04-07 01:59:30 -07:00
jpark37 4ae3956010 deps/media-playback: Add I010/P010 support 2022-04-03 00:03:34 -07:00
mvji c62dc7ffee obs-ffmpeg : use I422 for YUV422P input format
Avoid conversion to UYVY422 for 422P video input files (like dnxhd or xdcam422)
2022-03-26 21:05:45 -07:00
PatTheMav aae3a6a466 cmake: Fix diverging prefix padding for OBS status outputs
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.
2022-03-26 09:44:23 -04:00
Matt Gajownik 70924da18d CI: Don't ignore deps directory when formatting
Also add a .clang-format ignore file to the libff dependency.
2022-03-25 19:41:03 +11:00
jp9000 5e2c757cd1 libobs/util: Remove deprecation visibility from swig 2022-03-24 22:32:19 -07:00
jp9000 601187d0f6 deps/obs-scripting: Fix code formatting
Somehow this was incorrectly formatted at some point.
2022-03-24 22:30:52 -07:00
Richard Stanway 85addc3dac UI, file-updater, rtmp-services: Enable curl ALPN support
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!
2022-03-24 17:10:01 -07:00
derrod 178ec005bd obs-scripting: Add Resources to python path on macOS
Also changes indentation of this block back to tabs to be consistent
with the rest of the file

Co-authored-by: PatTheMav <patthemav+github@gmail.com>
2022-03-23 14:56:55 +01:00
PatTheMav dbdf5c7f7a
obs-scripting: Update CMakeLists.txt for scripting modules 2022-03-16 23:11:08 +01:00
PatTheMav dba1041034
deps: Update CMakeLists.txt for dependencies 2022-03-16 23:11:07 +01:00
jpark37 d528f6cafa deps/media-playback: New AVPacket pattern
FFmpeg has deprecated stack-allocated AVPacket objects, so make a pool
and use the new pattern instead.
2022-03-08 12:39:04 -08:00
jp9000 6d3b1998ef obs-scripting: Make callback "removed" variable atomic
Makes the callback variable "removed" atomic, and on script unload,
first sets all callbacks to removed before actually unloading the script
out of a safety precaution. (See note at the bottom for further details)

This minimizes the possibility of a race condition where the script
callback could be called while those callbacks were being removed.

Big note for this change, this change should eventually be replaced with
a reference counting ownership method where script callbacks can hold a
reference and share ownership of the script if it's still alive while
the script callback is being called. That way the script callbacks can
safely execute. May require a fair amount of reworking of the script
object.
2022-03-01 03:04:37 -08:00
Jim 03d9bda387 libobs: Deprecate obs object addref functions
Deprecates:
obs_source_addref()
obs_output_addref()
obs_encoder_addref()
obs_service_addref()
obs_scene_addref()

These functions should be considered unsafe and not used. Instead, use:
obs_source_get_ref()
obs_output_get_ref()
obs_encoder_get_ref()
obs_service_get_ref()
obs_scene_get_ref()

These functions return a pointer to the incremented object only if the
object is still valid, otherwise they will return null, indicating that
the object is no longer valid or is unsafe to use.

The reason why this is being done is because certain third party plugins
seem to be using addref, and are somehow managing to call addref on
sources that have already been fully released. For the sake of safety,
almost all usage of these functions within OBS have also been replaced
as well.
2022-01-25 05:20:03 -08:00
pkv 50aec9c2a0 media-playback: Fix rist demuxing
We currently pass a 'buffer_size' option to avformat in bytes.
Unfortunately, avformat/librist.c admits an option with the same name but in milliseconds.
The default values set in the UI (2 MB) go beyond the range admitted in ms (0-30 000)
so avformat issues errors.
This fix disables the option when rist protocol is detected.

Signed-off-by: pkv <pkv@obsproject.com>
2022-01-14 20:50:14 -08:00
Ryan Foster ce734366bc obs-ffmpeg: Respect AVFormatContext and AVOutputFormat constness
AVFormatContext::oformat was made const on April 27, 2021 [1]. If we
respect the constness of AVOutputFormat and do not cast results from
FFmpeg functions to non-const, we cannot modify the results after the
fact. Our choices are either to cast them to non-const (and presumably
have them implicitly casted back to const on later function calls), or
only try to modify the results in versions of FFmpeg where these are not
expected to be const.

Instead of relying on casts, we can set the encoder values in the
ffmpeg_cfg struct, which are later passed to new_stream.

Also modifies deps/media-playback. Removes compiler warnings.
Some avformat functions return const AV(In/Out)putFormat per [1], so
ifdef as needed.

[1]: 56450a0ee4
     lavf 59.0.100 avformat.h
     avformat: Constify the API wrt AV(In|Out)putFormat

     Also constify AVProbeData.
2021-11-23 12:10:25 -05:00