3147 Commits
Author SHA1 Message Date
Lain ae469d23e1 libobs/util: Fix function declaration
C functions that have no parameters should use (void) to signify that
they have no parameters, otherwise legacy C handling for parameters will
apply.
2024-01-07 15:59:09 -06:00
Lain 2fb7063e1a libobs: Defer media controls to video thread
To prevent sources from having to take too much extra consideration into
threading, defer the media control functions that directly affect
functionality to the video thread. Getters will still have to take
threading into account, but this should make things much more trivial
for media controls thread-wise.

(Lain note: Context: I noticed that things such as the slide show
require mutexes due to their media controls, and I felt that it was
largely unnecessary and that libobs should mitigate the threading issue
itself and keep it all in the video thread like it should be. Again, the
getters are still going to require *some* consideration into threading
but in terms of threading, for the type of stuff we're doing, querying
state is far more trivial to take into consideration.)
2024-01-07 15:59:09 -06:00
Lain 42bda5fb67 libobs/util: Add da_pop_front()
Doesn't really make sense that it was missing, so just add it.
2024-01-07 15:59:09 -06:00
Lain 9c9a50643a libobs: Do not allow controllable media without flag
The OBS_SOURCE_CONTROLLABLE_MEDIA flag is required for controllable
media callbacks to be usable. These checks are being added so we can
defer most controllable media callbacks to the video thread.
2024-01-07 15:59:09 -06:00
Lain 1151bc9dea libobs: Add a couple missing comments
(Lain note: This is mostly so more (yes more) can be added to this
god-forsaken structure without it getting too messy. In terms of actual
code, I need to be better about writing actual code comments. ...Meaning
that I actually need to start writing code comments.)
2024-01-07 15:59:09 -06:00
derrodandRodney 6fea91067f libobs: Pass parent pointer into signal_item_remove
With aaf8d8b38f changing the order
item->parent would be NULL thus resulting in a crash.
2024-01-07 02:28:53 +01:00
derrodandLain aaf8d8b38f libobs: Send item_remove signal after detaching item 2024-01-06 17:48:37 -06:00
jcmandRyan Foster 78b6cf16c3 libobs: Use aligned memory allocator in Cocoa logging 2024-01-05 15:38:06 -05:00
jcmandRyan Foster 2b38069709 libobs: Log Mac model identifier 2024-01-05 15:38:06 -05:00
derrodandRodney f6c8fe7b64 libobs: Fix crop to bounding box not being duplicated with item 2024-01-03 22:03:16 +01:00
Robert WittamsandRyan Foster 73e9561633 mac-capture: Allow selection of channels on core audio devices 2023-12-19 18:33:53 -05:00
PatTheMavandRyan Foster e065f2a839 libobs: Update CMake target source lists with alphabetic sorting 2023-12-19 17:59:44 -05:00
PatTheMavandRyan Foster 9ae47a7937 cmake: Update FFmpeg find package to use explicit version 2023-12-19 17:59:44 -05:00
PatTheMavandRyan Foster 8135085a23 cmake: Replace custom Qt discovery function with CMake default
find_qt was necessary during the transitional period between Qt5 and
Qt6. With Qt6 being the only supported Qt version (for open source) for
the time being, code complexity can be reduced for easier maintenance.
2023-12-19 17:59:44 -05:00
gxalphaandRodney 92ea7cb145 libobs: Remove obs-ui from public headers
This file got removed in 5177a593af and
as such should no longer be declared as a public header.
2023-12-17 22:13:47 +01:00
derrodandLain 7e456d9dea libobs: Add automatic cropping to bounds for scene items 2023-12-16 18:00:11 -06:00
PatTheMavandLain c83f76db11 libobs: Fix disk space reporting for attached network drives on macOS
While the NSURLVolumeAvailableCapacityForOpportunisticUsageKey resource
correctly reports available disk space for local volumes (regardless
of actual file system used), it does not report actual values for
attached network drives.

The NSURLVolumeAvailableCapacityKey resource will still report
available disk space as expected, so use this value for non-local
volumes instead.
2023-12-16 17:13:29 -06:00
Lain e958964bee libobs: Update version to 30.0.2 2023-12-10 14:04:03 -06:00
ExeldroandLain b05a401728 libobs: Render audio for all views 2023-12-10 03:35:11 -06:00
Norihiro KamaeandLain 0f9376f1cb libobs: Fix audio-only output did not receive raw_audio 2023-12-09 18:52:17 -06:00
Lain 646adafc73 libobs: Update version to 30.0.1 2023-12-09 14:21:57 -06:00
sora-blueandGitHub 8fc0489e4a libobs: Fix scene_enum_sources skipping some active sources
If an item's show/hide transition was active the underlying source
would not previously not be enumerated, resulting in reference leaks by
the UI or other components waiting for the source to be deactivated to
release it.
2023-12-08 14:10:12 +01:00
derrodandLain ca865f80cc libobs: Pair video encoder with all audio encoders 2023-12-05 15:36:37 -06:00
derrodandLain b680700bba libobs: Remove unused wait_for_video flag 2023-12-05 15:36:37 -06:00
derrodandLain 5177a593af libobs: Remove module UI functions 2023-12-02 18:09:20 -06:00
derrodandLain fc891295b6 libobs: Deprecate obs_view_get_video_info 2023-12-02 18:05:55 -06:00
derrodandLain 5ea9fcc951 libobs: Add obs_view_enum_video_info 2023-12-02 18:05:55 -06:00
derrodandLain 7c36257cc0 libobs: Fix obs_view_remove only resetting the first matching mix 2023-12-02 18:03:11 -06:00
derrodandLain 49e796c6fc libobs: Fix GPU scaling always using the main mix 2023-12-02 17:47:33 -06:00
Stephen SeoandLain cd784644f5 libobs: Fence off unnecessary code due to FFmpeg v6.1 changes
Fixes for using FFmpeg 6.1 due to deprecations. Uses `#if` macros to
allow builds for using older versions of FFmpeg.

This commit prevents obs from using the "fenced" code if using FFmpeg
6.1, since in FFmpeg commit [1] the "side_data" is added to
`AVCodecParameters`, and therefore the existing/following
`avcodec_parameters_copy(...)` will account for the metadata.

[1]: avcodec/codec_par: add side data to AVCodecParameters
https://github.com/FFmpeg/FFmpeg/commit/21d7cc6fa9a26e94965fa71b25655d07568450fe
2023-12-02 17:43:18 -06:00
derrodandLain f5b7c98d2d libobs: Reuse matching mix's render texture if possible
Avoids re-rendering a view if a previous mix with identical settings
has already rendered it
2023-12-02 17:36:48 -06:00
tt2468andRodney 05d52ee3a7 libobs: Fix PTS incrementation when FPS divisor is enabled
When using a PTS divisor, OBS would still increment the PTS by only the
original `fps_den` value, not considering that PTS values should be
multiplied by the divisor.

For example, `60/1` increases like `0,1,2,3`. `60000/1001` increases
like `0,1001,2002,3003`.

Without this fix, `60/1` main OBS framerate with a divisor of `2`
produces `0,1,2,3`, while the correct pattern would be `0,2,4,6`
2023-11-29 16:23:24 +01:00
Lain e358244521 libobs: Fix possible minor memory leak
If this array reserves memory, but doesn't end up pushing any sources
back to the array, then it'd result in a memory leak.
2023-11-26 20:06:51 -06:00
ExeldroandLain 1265950eaf libobs: Don't keep filter mutex in obs_save_source
While filters are saved using obs_save_source other mutex are used.
To prevent a deadlock, don't keep the filter mutex iterating the filters.
This fixes #9893
2023-11-25 20:49:50 -06:00
derrodandLain 2385a3f0f8 libobs/util: Remove unused struct member from text-lookup 2023-11-25 17:09:47 -06:00
Norihiro KamaeandLain 16fed06927 libobs/media-io: Fix link error including a header file from C++ 2023-11-25 17:04:47 -06:00
Norihiro KamaeandLain 2c4d54dd1b libobs/util: Fix link error including header files from C++ 2023-11-25 17:04:47 -06:00
tt2468andLain 76f332a379 libobs: Consolidate scene item remove code
Removes the internal helper `remove_without_release()` and branches
`obs_sceneitem_remove()` into public and internal versions.

The `obs_sceneitem_set_transition()` calls were missing from the
`remove_without_release()` function, so this resolves that issue
implicitly. Code cleanup mentioned above is done to hopefully avoid
these mistakes again.
2023-11-18 17:30:11 -06:00
PatTheMavandLain 4a765d3bf0 libobs: Use macOS specific APIs to report free disk space 2023-11-18 17:16:16 -06:00
derrodandRyan Foster 845a4a6f64 libobs: Remove superfluous NULL checks 2023-11-17 11:04:33 -05:00
Norihiro KamaeandRyan Foster 9391ab305e libobs: Fix memory leak when migrating from legacy scene item data
Before the commit 763dddbbaf, hotkeys to show and hide scene items are
distinguished by source name instead of ID. When migrating from the
legacy data structure, the pointer to the data was not released.
2023-11-16 16:27:23 -05:00
tt2468 3e6797ca5b libobs: Fix crash in obs_sceneitem_remove() when already removed
An already-removed item has a NULL `item->parent`, meaning that calling
`full_lock(scene)` results in undefined behavior. This makes the method
return earlier if the specified item is removed instead of attempting
to lock the scene.

No thread safety is changed, because it wasn't thread-safe to begin
with.
2023-11-13 22:37:42 -08:00
Norihiro KamaeandLain 40562ff47e libobs: Expose obs_data_set_autoselect_array 2023-11-10 02:10:43 -06:00
tt2468andLain 3b0ca4527a libobs: Add obs_reset_audio_monitoring()
Reloads all audio monitoring devices
2023-11-07 01:32:12 -06:00
Igor BochkariovandLain b081adf72e libobs: Fix crash when plugins delete properties in callback
If a plugin removes a property when processing 'modified'
property callback, OBS WILL CRASH.

Example of offending plugin: obs-source-record

This commit moves callback processing to after iterating over
properties, thus removing the chance to crash OBS.
2023-11-04 23:31:07 -05:00
jpark37andLain e79e28598b libobs,obs-filters: Use common straight alpha math
This pattern uses fewer instructions and also avoids using max, which
does not work on infinity.

Also remove unreferenced techniques from scale filters.
2023-11-04 18:12:22 -05:00
David RoscaandLain 722ca8447e libobs: Add AV1 parsing functions
One notable difference from the AVC/HEVC code is that it also inserts
the METADATA and SEQUENCE_HEADER OBUs into new_packet, otherwise the
resulting video file wouldn't play.
2023-11-04 01:16:25 -05:00
PatTheMavandRyan Foster 5127c22773 libobs: Add more files to list of public headers 2023-11-02 11:50:30 -04:00
PatTheMavandRyan Foster ff2a7063c2 libobs: Export SIMDe headers unconditionally for plugin development 2023-10-26 18:20:53 -04:00
gxalphaandRyan Foster 7aa18609a1 libobs: Replace kAudioObjectPropertyElementMaster with Main 2023-10-17 16:45:36 -04:00