Commit Graph

3123 Commits

Author SHA1 Message Date
Exeldro
6f5d00ca71 libobs/graphics: Add support for param assign with type constructor 2026-05-07 12:03:01 -04:00
cg2121
750c016161 frontend, libobs: Add OBSProperties OBSPtr type
We no longer have to manually destroy obs_properties_t.
2026-05-06 17:27:36 -04:00
Exeldro
eea945b64c libobs/util: Add support for #if and #elif to CF parser 2026-05-06 16:54:48 -04:00
Sebastian Beckmann
dba426630a libobs: Deprecate v1 of obs_properties_add_button
With v1 of this function, it's unclear where exactly the data pointer
comes from or what it is. In fact, this is not determined by libobs, but
the consumer. libobs assumes that the caller of
obs_property_button_clicked passes an obs_context_data pointer, and then
passes the data pointer of that obs_context_data as the data pointer to
the callback.
In OBS Studio, this is always the private data of the associated object.
However, this assumes that there even is such an object (source/encoder/
etc), even though properties are meant to be free-standing. This is not
just philosophical, because with obs_get_source_properties you can
actually get an obs_properties_t that isn't associated with any specific
source, at which point you have no idea what the data pointer will be.

For this reason, obs_properties_add_button v1 needs to go.
obs_properties_add_button2 can be used as a drop-in replacement.
With v2, it's well-defined that the pointer you're passing as priv is
the pointer you get back in the callback as data. If you don't care
about it, simply pass NULL/nullptr.

Once v1 is removed in the future, obs_property_button_clicked should be
replaced with a variant that doesn't take a second argument, as that
argument will no longer be used anywhere.
2026-05-05 15:45:04 -04:00
Ryan Foster
fb4d98bf88 libobs: Update version to 32.1.2 2026-04-21 15:00:34 -04:00
Ryan Foster
7272af1375 libobs: Update version to 32.1.1 2026-04-02 14:21:16 -04:00
pkv
68f5470d15 libobs: Monitoring deduplication fix for 'Desktop Audio' on monitor_only
When an Audio Output Capture source (AOC) like 'Desktop Audio' has
monitoring_type == OBS_MONITORING_TYPE_MONITOR_ONLY, deduplication
should not be triggered. this is an edge case which may not cover a
reasonable use case, but for the sake of completeness, we deal with it.

Signed-off-by: pkv <pkv@obsproject.com>
2026-04-01 14:29:25 -04:00
Hoshino Lina
49708181b5 libobs/util: Fix fd management in os_process_pipe_create
The sequence should be the same for every fd:

- Close the parent end of the pipe
- If the child end of the pipe is not the intended fd already,
  - Dup it over
  - And close the old fd

This fixes a double-close() in the read path (which is fairly harmless
since it happens in the child, but sticks out in strace), some fd
leakage, and the stderr-already-is-2 case.
2026-03-08 12:12:44 -04:00
Penwywern
a4f3c16065 libobs: Properly handle NULL data in json 2026-02-11 19:27:22 -05:00
Warchamp7
0df94d5cae image-source: Fix interrupted transitions 2026-02-04 18:53:59 -05:00
Warchamp7
e6b52f2e9b libobs, frontend: Signal transition_stop for cancelled transitions 2026-01-16 15:57:36 -05:00
Warchamp7
b8f0990d50 libobs: Add obs_transition_is_active 2026-01-16 15:57:36 -05:00
Exeldro
9a62529f02 libobs: Restore only canvases that have video info 2026-01-16 10:54:48 -05:00
Ryan Foster
1d6f1859ea libobs: Update version to 32.1.0 2026-01-14 16:52:36 -05:00
Anton Kesy
380ff3fd58 libobs: Fix typos 2026-01-14 13:47:30 -05:00
derrod
5cbf0c5e6e libobs: Add API for getting priming samples from audio encoders 2026-01-14 10:48:04 -05:00
PatTheMav
4625dda66d cmake: Apply gersemi 0.25 formatting 2026-01-09 15:47:12 -05:00
Dennis Sädtler
4d7776fc3b libobs: Restore original video_t for encoders when GPU scaling is used 2026-01-08 22:37:24 -05:00
Dennis Sädtler
659163e0e8 libobs: Fix NAL type for HEVC caption SEIs 2025-12-17 18:02:19 -05:00
Ryan Foster
dcdbd2e904 libobs: Update version to 32.0.4 2025-12-12 16:33:05 -05:00
pkv
ad4315b15a libobs: Fix default macOS monitoring device
The default device retrieved was the one used for system sounds.
This fixes it by retrieving the one used to output audio.

It seems the bug has been there since the initial writing of this bit of
code (so 2017).
2025-12-12 15:21:42 -05:00
pkv
91917f8120 libobs: Improve monitoring deduplication
The monitoring deduplication was previously checking at each audio tick
the whole audio tree for Audio Output Capture (AOC) devices used for
monitoring. The profiling did not show any big impact on the audio
callback. But due to reports of a significant slowdown for scenes with
numerous audio sources, we have moved the check on AOC from the audio
thread to the UI thread.

So we implemented obs_source_audio_output_capture_device_changed which
is triggered whenever:
- a monitoring device is changed in Settings > Audio,
- an Audio Output Capture source changes its device or on startup.

This function compares the AOC device with the monitoring device in UI
thread. If they are identical, a signal is sent to the audio thread to
add an audio task updating the AOC duplicating source pointer at the end
of an audio tick.

This triggers monitoring deduplication if the ptr is not NULL.
The calls in the AOC are implemented in next commits.
The rest of the logic in obs-audio.c is the same except on one count,
which is that we check against the muted state of the AOC rather than
its user_muted; with the new logic, muted works better.

Signed-off-by: pkv <pkv@obsproject.com>
2025-12-12 15:21:42 -05:00
Exeldro
ea9e4ca06e libobs: Do not wait for audio of removed sources 2025-12-10 13:24:22 -05:00
Ryan Foster
9a8470355f libobs: Update version to 32.0.3 2025-12-05 16:38:14 -05:00
pkv
4ea2074eed libobs: Add devices_match to null monitor
This adds the devices_match function to null monitor to fix linking
issues on linux when pulse audio is disabled.
Fixes #12810

Signed-off-by: pkv <pkv@obsproject.com>
2025-11-26 14:16:53 -05:00
pkv
eb4161e72e libobs: Monitoring deduplication for default devices
This adds comparison to default devices to the monitoring deduplication.
When a user picks a default device, the device_id setting is 'default',
which prevents any comparison.
The comparison is done by leveraging the libobs/audio-monitoring
devices_match function.
For macOS, some special care is taken because the devices list differ
for 'Desktop Audio' and 'monitoring' since coreaudio sdk has no pure
audio capture; so 'default' in the two lists do not match in general.
One then retrieves the device_id for the default desktop audio for macOS
through get_desktop_default_id function.

Signed-off-by: pkv <pkv@obsproject.com>
2025-11-11 13:55:34 -05:00
pkv
2f2c66a597 libobs: Enable retrieval of macOS default audio output capture device
This allows retrieval of the default audio output capture device.

Signed-off-by: pkv <pkv@obsproject.com>
2025-11-11 13:55:34 -05:00
Exeldro
d84ff0eb6f libobs: Don't use removed sources 2025-11-07 17:07:14 -05:00
pkv
189ed7c386 libobs: Trigger monitoring deduplication when fader is at minimum
When the 'Audio Output Capture' source (usually Desktop Audio) has its
fader at minimum, we should disable the deduplication logic.
This is done by checking against the obs_source volume member.

Signed-off-by: pkv <pkv@obsproject.com>
2025-10-30 13:27:54 -04:00
pkv
af17e71dd1 libobs: Additional monitoring deduplication check with pulse
Pulse audio may append .monitor to device id; this commit adds this case
to the deduplication trigger.

Signed-off-by: pkv <pkv@obsproject.com>
2025-10-30 13:27:54 -04:00
pkv
967e19b3fa libobs: Check tracks for monitoring deduplication
Monitoring deduplication must be applied only to tracks for which the
monitored source and the 'Audio Output Capture' source are both enabled.
This adds such checks.

Signed-off-by: pkv <pkv@obsproject.com>
2025-10-30 13:27:54 -04:00
Ryan Foster
c025f210d3 libobs: Update version to 32.0.2 2025-10-23 08:42:31 -04:00
Ryan Foster
0b12296320 libobs: Update version to 32.0.1 2025-09-26 16:36:36 -04:00
pkv
9696f54937 libobs: Log monitoring audio deduplication
The commit adds a log line to inform the user that deduplication is
being applied. The info is displayed whenever deduplication first
occurs.

Signed-off-by: pkv <pkv@obsproject.com>
2025-09-26 12:12:08 -04:00
pkv
40dd9f6c5e libobs: Fix for monitoring deduplication edge case
When an 'Audio Capture Source' device is also used for monitoring, the
deduplication logic is applied: all monitored sources are silenced.
But this should not silence the 'Audio Capture Source' if for some
reason, it is being monitored (the user will get echoes, but hey, it's
their choice). So we exclude the 'Audio Capture Source' from the
silenced sources.

Signed-off-by: pkv <pkv@obsproject.com>
2025-09-26 12:12:08 -04:00
Ryan Foster
1e281538a4 libobs: Raise out of memory exception manually when out of memory
The previous attempt to clarify an out of memory exception/crash
resulted in the compiler optimizing os_breakpoint() and os_oom() into
the same result, which meant that crash stacks in the wild were still
not specific enough to be helpful. Forcefully differentiating the
functions in Release configuration by having os_breakpoint() only call
__debugbreak() and having os_oom() call RaiseException() should give us
clearer crash stacks.

Amends 94a736f179.
2025-09-17 16:29:06 -04:00
Sebastian Beckmann
b6555a4baa libobs: Treat os_dlopen failure as module load failure
Communicate that a module has failed to load via obs_module_failure_info
2025-09-12 15:16:06 -04:00
Sebastian Beckmann
a4b62d26be libobs: Differentiate between plugin load failures
It's important to differentiate whether a plugin fails to open (dl_open
returning NULL, being compiled for a newer libobs, etc) or whether it
opened correctly, but failed to initialize (returned NULL during
obs_module_load()).
With that, we can also create disabled modules for modules that fail to
open, which in the future should enable better user communication in the
UI (besides the module_load_failure_info).
2025-09-12 15:16:06 -04:00
Sebastian Beckmann
fd214a9c6e libobs: Rename MODULE_FILE_NOT_FOUND code to MODULE_FAILED_TO_OPEN
This code is returned if os_dlopen returns NULL. This can happen for
multiple reasons, not just because the file can't be found. Since [1]
other causes are getting more common, but this could also happen before.

[1]: 62429135ba
2025-09-12 15:16:06 -04:00
Norihiro Kamae
139fd801ee libobs/util: Fix memory leak at failure condition 2025-09-12 13:46:58 -04:00
PatTheMav
cb634b9875 libobs: Update default draw effect to also provide D65P3 conversion 2025-09-04 17:58:27 -04:00
PatTheMav
4dab2c51b8 libobs: Add prerequisites for Metal and Swift support 2025-09-04 17:58:27 -04:00
Ryan Foster
3afc2577d3 libobs: Remove Qt5 module check
Partial revert of a0eae6f33c.
Partial revert of 23c3ad4d02.
Partial revert of 97b34ebb76.

Keep all of the get_plugin_info stuff, remove the Qt5 checks.
2025-09-04 16:57:07 -04:00
Ryan Foster
2004ea6b16 Revert "libobs/util: Reject plugins linking Qt5 library for Linux"
This reverts commit 615728fa3b.

Includes partial revert of 62429135ba.
2025-09-04 16:57:07 -04:00
Ryan Foster
f31485939c Revert "libobs: Assume Qt 6, always warn about Qt 5 plugins"
This reverts commit 5ed0b8a0b8.
2025-09-04 16:57:07 -04:00
Ryan Foster
a7b5aef36a Revert "libobs/util: Prevent locking mutex in child process when checking Qt5"
This reverts commit 5c448452cf.
2025-09-04 16:57:07 -04:00
Sebastian Beckmann
11b9f1aa83 libobs: Re-include groups in obs_enum_scenes
[1] changes this condition to obs_source_is_scene as a drive-by, however
they aren't equivalent. obs_source_is_scene checks whether the source's
is is "scene", which doesn't include groups, while OBS_SOURCE_TYPE_SCENE
does. Suddenly not including groups is quite the API break.
This now means obs_canvas_enum_scenes does also include groups, however
that is much less of an egregious API change.

[1]: 8c5858ae05
2025-09-04 16:11:19 -04:00
Sebastian Beckmann
62429135ba libobs: Use RTLD_NOW to load modules
RTLD_LAZY means that symbols will only be resolved when first used,
while RTLD_NOW tries to resolve them immediately. This means that if
there are missing symbols (e.g, because a function got removed from
libobs), dlopen with RTLD_LAZY will happily open that module but we get
a runtime crash when the module tries to use that symbol, while with
RTLD_NOW we instead get a (nicer) error on dlopen.
2025-09-03 16:01:57 -04:00
Sebastian Beckmann
ac913b3854 libobs: Fix comment typo
verison -> version
As a drive-by, also changes null to NULL.
2025-09-03 15:34:26 -04:00
Sebastian Beckmann
4cd1444c9a libobs: Set module for outputs 2025-09-03 15:34:26 -04:00