Commit Graph

3033 Commits

Author SHA1 Message Date
PatTheMav
3311a7105e libobs: Mark data path modification functions as deprecated 2025-04-30 15:14:57 -04:00
gxalpha
281f8137f5 UI,libobs,obs-outputs: Remove HAVE_OBSCONFIG_H ifdefs
With the removal of all legacy code paths, obsconfig.h always exists and
the compile definition always gets set. As such, it's no longer
necessary to check for it.

As removing the definition itself could be seen as a breaking change,
this simply moves the definition to pc.in and cmake.in files for now to
preserve the value for plugins that might expect this to be set. We may
remove the definition entirely in a later release.
2025-04-30 13:05:35 -04:00
Penwywern
63260148df libobs: Use absolute path for install prefix module load 2025-04-28 15:04:27 -04:00
Norihiro Kamae
220b0ec649 libobs/callback: Catch fail cases with missing error data
In `parse_decl_string`, it jumps to `fail` label if an error occurs.
However, if the lexer encountered an error for example, `cfp.error_list`
may be empty.
2025-04-28 14:26:07 -04:00
Ilya Melamed
a19945b53a libobs: Fix setting non-0 order on only scene item 2025-04-28 13:50:01 -04:00
tytan652
1bf84a6901 cmake: Replace Xcb CMake finders with ECM 2025-04-28 13:30:26 -04:00
Norihiro Kamae
5c448452cf libobs/util: Prevent locking mutex in child process when checking Qt5
The frontend has set a log handler which locks the mutex in `LogString`.
If `os_dlopen` fails in the child process, it calls `blog` and attempted
to lock the mutex that may have already been locked by another thread
before `fork()`. This change prevents the child process from locking the
mutex, resolving the potential deadlock.
2025-04-25 19:10:34 -04:00
Lain
775ac56bc8 libobs/graphics: Add gs_draw_quadf()
Adds a function to draw a sprite or quad using floating point sizes
rather than integer sizes. Also named it more appropriately.
2025-04-23 15:23:29 -04:00
Lain
7b8b51b29f libobs/graphics: Improve sprite drawing perf
Sprites were unnecessarily updating a dynamic vertex buffer every single
draw call. This creates static vertex buffers for common vertex buffer
dimensions/uvs and only uses a dynamic vertex buffer when the texture
coordinates actually change.

Porbably not a significant perf change considering the very few number
of traingles we draw per frame but still nice to do.
2025-04-23 15:23:29 -04:00
Lain
d25e2c18e4 libobs/graphics: Optimize certain matrix4 functions
Optimizes certain 4x4 matrix functions by minimizing unnecessary math
operations. This ends up optimizing gs_matrix_transform() and
gs_matrix_rotate() functions and makes positional/rotational operations
a bit more optimal and requiring much less math than they would
otherwise.
2025-04-23 15:23:29 -04:00
Lain
9fa3b045a3 libobs/graphics: Remove some unnecessary checks
These checks are redundant because the base function they all lead to
does the same check.
2025-04-23 15:23:29 -04:00
Lain
40f0543488 libobs/graphics: Separate some sections via comments 2025-04-23 15:23:29 -04:00
PatTheMav
96e4d67242 clang-format: Update source code files with clang-format 19.1.1 2025-04-17 18:16:33 +02:00
Dennis Sädtler
dac0be2cbe libobs: Use UUIDs in scene undo/redo data
Since scenes now can have non-unique names by being part of different
canvases, use UUIDs instead.
2025-04-02 12:39:46 -04:00
Dennis Sädtler
ec9f4b0d20 libobs: Add Canvas object RAII wrappers 2025-04-02 12:39:46 -04:00
Dennis Sädtler
3d57b1fd63 libobs: Introduce Canvases
This adds a new obs_canvas object that acts as a shareable
(reference-counted) owner of views, mixes, and (optionally) scenes.

This is a step towards faciliatating multi-canvas and multi-output
features in OBS Studio.

It solves a number of complications that exist with the manual approach
of using views, such as audio mixing, source active-state tracking, and
scenes not havinga  reliable way of identifying the actual available
canvas size.
2025-04-02 12:39:46 -04:00
Dennis Sädtler
66da1e42c7 libobs: Add video_reset signal
Signals when a video reset has completed. This is mainly useful when
canvases or views are used, whose mixes will have been freed or
recreated during the reset.
2025-04-02 12:39:46 -04:00
Dennis Sädtler
4459041e7e libobs: Add view type to view object
Allos creating additional views that act like a MAIN_VIEW instead of AUX_VIEW.
2025-04-02 12:39:46 -04:00
Alex Luccisano
935613816f libobs/util: Update os_get_free_size()
`os_get_free_size()` was simply returning 0. For Linux,
implement the free size calculation based on the `sysinfo()`
system call.
2025-04-01 23:18:15 -04:00
Alex Luccisano
abb8cdf0da libobs, libobs-opengl: Add memory and identification APIs
Add graphics APIs to obtain the GPU driver version and renderer
strings, as well as GDDR memory sizes. The GDDR memory sizes
include the dmem (dedicated memory on the GPU) and smem
(shared CPU memory used by the GPU but resides in the CPU DDR).

The version and renderer strings are needed for identification
purposes, for example enhanced broadcasting used by Twitch, to
associate the GPU used by OBS with the PCIe-based identification
values such as device_id and vendor_id.
2025-04-01 23:18:15 -04:00
gxalpha
62ef7e0fee libobs: Deprecate obs_get_transition_by_[name|uuid]
obs_get_transition_by_name is very problematic because transitions are
always private and their names aren't unique. This means that the method
iterates over all private sources and then takes the first that both is
a transition and matches the name we're looking for. However, this could
be from anywhere - it could be a frontend transition, but also a source
transition, quick transition, or even one from third-party plugins. This
is always never what is intended.

As such, this method (which should never have been added in the first
place) needs to go. In its place, obs_frontend_get_transitions returns a
list of all frontend transitions (which is usually what people are
looking for), and alternatively obs_get_source_by_uuid also provides
access to private sources.

While we're at it, obs_get_transition_by_uuid is basically a wrapper for
obs_get_source_by_uuid and not really necessary. UUID's are unique and
a source doesn't suddenly change its type, so if you have a transition's
UUID you can be pretty sure that when you do obs_get_source_by_uuid, it
will still be a transition.
2025-04-01 17:07:24 -04:00
Ryan Foster
3e84469cc1 libobs: Update version to 31.0.3 2025-03-26 16:05:26 -04:00
Exeldro
5ca6e1effa libobs: Fix duplicating scene with custom size 2025-03-26 15:17:13 -04:00
Dennis Sädtler
12baa1c817 libobs: Reset reconnecting state when can_reconnect is false 2025-03-17 14:22:56 -04:00
Dennis Sädtler
187eef7b38 libobs: Add optional reconnect callback to outputs 2025-03-17 13:30:58 -04:00
Dennis Sädtler
2950daa29d Revert "libobs: Do not allow reconnect if stop code is OBS_OUTPUT_INVALID_STREAM"
This reverts commit a0edc5e8bc.
2025-03-17 13:30:58 -04:00
Ryan Foster
ef2fe6fdd3 libobs: Update version to 31.0.2 2025-03-07 16:44:15 -05:00
Mirza Özokyay
90570e7a70 libobs,win-capture,win-wasapi: Fix typo in macro WIN32_LEAN_AND_MEAN
Fix the macro to prevent unnecessary headers from being included by
<windows.h>. This reduces compilation time and may prevent future bugs
due to unexpected includes.
2025-03-03 16:13:36 -05:00
thirumalai-qcom
147d332de3 libobs: Add ARM64 support to Windows crash handler
Adjust obs-win-crash-handler.c to handle instruction pointers and
stack traces, improving crash reporting on ARM64 systems.
2025-02-28 16:29:57 -05:00
Lain
70dc224a2e libobs: Do not lock sources mutex unnecessarily
In obs_load_sources(), the master sources mutex was being locked
seemingly unnecessarily. This could cause race conditions if used
incorrectly.
2025-02-22 16:06:00 -08:00
jpark37
b28bb425bc libobs: Use limited range for R10l output
DeckLink hardware seems to want the values in video range.
2025-02-20 13:44:08 -08:00
Ryan Foster
ba9ac1a9a8 cmake: Replace COMPILE_FLAGS with COMPILE_OPTIONS
COMPILE_OPTIONS was added and superseded COMPILE_FLAGS in CMake 3.11.

https://cmake.org/cmake/help/v3.30/prop_sf/COMPILE_FLAGS.html
https://cmake.org/cmake/help/v3.30/prop_sf/COMPILE_OPTIONS.html
2025-02-10 12:57:38 -05:00
Doğukan Korkmaztürk
68ca91b21d libobs,libobs-opengl: Add gs_sync_t
This change adds a new type named gs_sync_t and related functions to X11
and Wayland EGL backends to abstract DRM syncobjs and their various
uses.

Signed-off-by: Doğukan Korkmaztürk <dkorkmazturk@nvidia.com>
2025-02-05 16:20:15 -05:00
gxalpha
ba84bea46d libobs: Rewrite macOS Hotkeys to use CGEventTap
Using CGEventTapCreate instead of addGlobalMonitorForEventsMatchingMask
to listen to global hotkeys has the advantage of tighter control over
what permissions we need. Since we only listen to and do not modify the
event, it is enough to have "Input Monitoring" instead of the full
"Accessibility" (which would allow modifying the event after catching
it).
2025-02-05 14:33:06 -05:00
Dennis Sädtler
2de0037e40 libobs: Support format/space/range conversion in encoder GPU scaling 2025-01-29 15:01:19 -05:00
Dennis Sädtler
0d6cf088ef libobs: Deprecate obs_(nv12|p010)_tex_active() 2025-01-29 15:01:19 -05:00
Dennis Sädtler
3b1a66f632 libobs: Add obs_encoder_video_tex_active() 2025-01-29 15:01:19 -05:00
Alex Luccisano
c67ea47406 libos: Add obs_get_audio_info2()
The `obs_audio_info2` struct is used in libobs
for resetting audio, however there is a need for
obtaining the additional fields present in the struct
beyond `obs_audio_info`.
2025-01-29 14:37:19 -05:00
jpark37
689c0094b8 libobs: plugins: Use MAD for sRGB functions
Also fix stray comment about pow behavior.
2025-01-29 14:11:34 -05:00
derrod
6b449c3a0b libobs: Only modify raw_active counter if (dis-)connection succeeded 2025-01-28 17:36:51 -05:00
derrod
eda882dd0a libobs: Add video_output_disconnect2() 2025-01-28 17:36:51 -05:00
Norihiro Kamae
099bc26bd6 libobs/util: Fix tv_nsec becoming 1000000000 in os_event_timedwait 2025-01-24 15:28:57 -05:00
Ryan Foster
0014f9fa18 libobs: Update version to 31.0.1 2025-01-17 18:40:47 -05:00
Kurt Kartaltepe
22f222600a libobs: Fix underlinking by adding libx11
We directly depend on libx11 for various operations in obs-nix-x11.c,
not just xcb. So be sure to link it in too.

fixes #11667
2025-01-16 15:43:48 -05:00
izwb003
48dad45ed5 libobs: Fix deadlock on macOS input method change 2025-01-04 12:23:21 +01:00
tytan652
e845729dfd libobs/util: Improve inhibit portal detection on Linux
Check for a property of the inhibit portal rather than just the portal
D-Bus name that does not indicate if the specific portal is available.
2024-12-09 18:05:17 -05:00
derrod
10dc43b3cd libobs: Remove relative positioning functions
Revert "docs: Add new relative positioning scene functions"

This partially reverts commit 366cfdb963.

The addition of obs_sceneitem_(get/set)_info2 was not removed as that is
still valid.
2024-12-04 14:41:03 -05:00
derrod
e9c6105f99 libobs: Fix scale calculation when applying new group transform 2024-12-03 15:33:36 -05:00
Ed Maste
c928fac339 libobs: Remove non-USE_XDG code
That is, leave only the code that was under USE_XDG.  Previously the
Linux CMake build defined USE_XDG unconditionally, while it was not set
by the FreeBSD build.

The non-USE_XDG code was broken, and FreeBSD should follow the XDG
convention anyway (in particular, storing config files typically under
$HOME/.config/obs-studio).  Defining USE_XDG in the os-freebsd.cmake
files would leave the non-USE_XDG code unused anywhere, so instead just
remove it.
2024-10-18 18:19:19 -04:00
derrod
e97d7c10c2 libobs: Fix items in groups using wrong scale reference 2024-10-16 12:24:18 -04:00