2808 Commits
Author SHA1 Message Date
Lain b45a73296f libobs: Update version to 30.0.2 2023-12-10 14:03:25 -06:00
Lain fc59b60e17 libobs: Update version to 30.0.1 2023-12-09 14:21:20 -06:00
tt2468andRyan Foster 51fe2ec920 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`

(cherry picked from commit 05d52ee3a7)
2023-12-04 15:17:54 -05:00
PatTheMavandRyan Foster f0c343ec24 libobs: Use macOS specific APIs to report free disk space
(cherry picked from commit 4a765d3bf0)
2023-12-04 15:17:54 -05:00
Norihiro KamaeandRyan Foster 929520afde 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.

(cherry picked from commit 9391ab305e)
2023-12-04 15:17:54 -05:00
tt2468andRyan Foster dcda5b1022 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.

(cherry picked from commit 3e6797ca5b)
2023-12-04 15:17:54 -05:00
Igor BochkariovandLain 8805e31d25 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.

(cherry picked from commit b081adf72e)
2023-11-08 22:35:58 -06:00
jpark37andLain d5a0a7450d 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.

(cherry picked from commit e79e28598b)
2023-11-08 22:35:58 -06:00
PatTheMavandLain 424cd1701e libobs: Add more files to list of public headers
(cherry picked from commit 5127c22773)
2023-11-08 22:35:58 -06:00
PatTheMavandRyan Foster e14b29e875 libobs: Export SIMDe headers unconditionally for plugin development
(cherry picked from commit ff2a7063c2)
2023-10-28 16:14:25 -04:00
gxalphaandRyan Foster 865112a239 libobs: Replace kAudioObjectPropertyElementMaster with Main
(cherry picked from commit 7aa18609a1)
2023-10-26 16:24:51 -04:00
RodneyandRyan Foster 9e1e4981de libobs: Fix rendering stats not being logged on output stop
(cherry picked from commit 3869cb83bc)
2023-10-26 16:24:51 -04:00
derrodandRodney 731da1be6b libobs: Fix hotkeys when reordering sceneitems into/out of groups 2023-10-08 02:00:46 +02:00
derrodandRodney 763dddbbaf libobs: Distinguish sceneitem hotkeys by id 2023-10-08 02:00:46 +02:00
derrodandRodney 4bb2365a62 libobs: Specify scene item IDs on creation 2023-10-08 02:00:46 +02:00
Lain 64e26b2969 libobs: Use same ver. in obs-config.h for betas/RCs 2023-10-06 18:23:49 -06:00
derrodandLain e11ffeccb0 cmake/libobs: Only set beta/rc increment 2023-10-06 17:21:51 -06:00
ExeldroandLain 82864559f2 libobs: Fix errors for gs_effect_create 2023-10-06 10:51:15 -06:00
jpark37andRyan Foster e11e2133e2 libobs,obs-filters: Fix NAN when tonemapping
Can happen when colors are wider than Rec. 2020.
2023-10-04 19:33:54 -04:00
PatTheMavandLain aaca2b6e73 libobs: Fix duplicate symbol resolution for obs plugins
By default duplicate non-static symbols loaded by dynamic libraries are
de-duplicated by the dynamic library loader. This can lead to issues
with statically linked libraries inside obs plugins if the symbols
share their signature: Whichever plugin is loaded first gets to "set"
the symbol (which can become problematic especially for C++ template
functions).

Using RTLD_LOCAL ensures that all symbols are hidden and can only be
explicitly loaded using dlsym() which avoids this issue.

Unfortunately due to the way scripting works in obs-studio, Python
still needs to be loaded with RTLD_GLOBAL, hence the branch in the fix.
2023-09-23 16:31:14 -07:00
Neal GompaandRyan Foster 491d7c0e98 libobs: Add license declaration files 2023-09-19 13:35:49 -04:00
derrodandLain 62500b5129 libobs: Do not skip async frames unless one has been selected 2023-09-16 22:19:07 -07:00
Norihiro KamaeandLain 2036de8ec3 libobs: Fix obs_output_video and obs_output_audio for encoded output
The API `obs_output_video` and `obs_output_audio` returned valid
pointers until the commit fb57eff21 and 645e31fa1.
The API `obs_output_video` is used by some plugins such as obs-websocket
and obs-midi to calculate the duration of streaming and recording.
To have a similar behavior, return the media (video and audio,
respectively) from the encoder.
2023-09-06 23:36:06 -07:00
PatTheMavandRyan Foster 87dd366448 libobs: Remove old macOS guards for NSProcessInfo
With the lowest deployment target being macOS 11.0, there is no need
to check for the availability of the selectors on the NSProcessInfo
class anymore.
2023-09-05 14:39:00 -04:00
PatTheMavandRyan Foster 7f8a55d0bb libobs: Fix warnings about implicit integer downcasts in macOS code 2023-08-31 17:52:08 -04:00
PatTheMavandRyan Foster 6ebff6a204 libobs: Suppress warnings about implicit integer downcasts
Returned values are usually 64-bit in length but commonly stored in
16-bit integers anyway.
2023-08-31 17:52:08 -04:00
Richard StanwayandLain fef92a8a43 libobs: Log if CreateProcessW fails on Windows
This is used by the test programs as well as ffmpeg-mux. If a process
fails to start it's quite bad so we would like to know why.
2023-08-26 16:44:53 -07:00
Lain 867938cd9d libobs: Do not hide OBS_NIX_PLATFORM_WAYLAND behind ifdef
Really no reason to make it so this value can't be used.

Fixes obsproject/obs-studio#9454
2023-08-24 13:32:33 -07:00
Lain 45e7334206 libobs: Fix shader fix not working on D3D11
In c8d95005c1, it was incorrect assumed that just because the fix
worked on OpenGL, that the fix would also work on D3D11. Automated tests
would be ideal here, although if there were automated tests, ironically,
it wouldn't have picked this up, because we (read: I) made D3D11 fall
back to OpenGL of D3D11 failed. Basically there is no one to blame but
myself again.

This time, we've removed the OpenGL fallback in a06d6893b9 (thank you
Rodney), and additionally I properly tested on both rendering backends.

(Lain note: I'm just going to go sit in the corner for a bit and
ruminate after this)
2023-08-16 11:19:08 -07:00
Lain 2edb9f3151 libobs: Fix default.effect not working with OpenGL
Due to my jank transpiler, default.effect worked with Direct3D 11 but
not with OpengGL. Fixing this particular bug with the transpiler is a
bit non-trivial so instead just modify the shader to work with both.
2023-08-15 17:11:23 -07:00
Norihiro KamaeandLain fa9b7b042f libobs: Remove starting_frame_count from obs_output_t
The member variable `starting_frame_count` was set but never read.
2023-08-15 16:00:21 -07:00
Norihiro KamaeandLain fb57eff212 libobs: Fix holding possibly released pointer in obs_output_t
When `obs_output_t` is an encoded output, `obs_output_set_media` will
ignore the video and audio so that `obs_output_t` will keep holding the
`video_t` and `audio_t` pointer when the output was created.
By this commit, `video` and `audio` member variables in `obs_output_t`
will never set if it is an encoded output.
In the auto-configuration wizard, `video_t` is released and created to
have a different video size while `obs_output_t` is not released. This
resulted in accessing the released `video_t` pointer.
2023-08-15 16:00:21 -07:00
jpark37andLain 40edda536d libobs/media-io: Relax color space comparison
Allow VIDEO_CS_DEFAULT to avoid slow conversions.
2023-08-15 13:15:45 -07:00
jpark37andLain 3e80fff18e libobs: Add DrawAlphaDivide variant shaders
Useful for future 10-bit HDR DeckLink playback support.
2023-08-15 13:15:45 -07:00
PatTheMavandRyan Foster 7628265099 Update .clang-format rules for ObjC files for version 16 2023-08-10 17:12:30 -04:00
Ryan Foster 64139a6bbd CI: Update to clang-format 16
This commit also modifies UI, libobs, and plugins.
2023-08-10 16:07:25 -04:00
Ryan Foster 39b4df12c8 libobs/util: Define PRAGMA_WARN_DEPRECATION for MSVC
Define PRAGMA_WARN_DEPRECATION for MSVC to enable using that define for
cross-platform code, which allows us to write slightly less code when we
need to suppress this warning.
2023-08-09 13:47:05 -04:00
LainandGitHub 796e2d5815 Merge pull request #9339 from tytan652/prevent_simde_contamination
Contain simde diagnostic pragmas and replace variable-length arrays
2023-08-05 17:10:33 -07:00
PatTheMavandLain 1b194c8ebd libobs: Add local event monitor for hotkey thread
To avoid a mismatch between the state of pressed keys as held by the
hotkey thread and keys pressed while the application is in focus, local
key events need to be monitored as well (even though they are already
handled by Cocoa's main event loop).
2023-08-05 16:48:53 -07:00
Ryan FosterandLain fc693f9c3d libobs: Update CMake minimum to 3.22
Since Ubuntu 22.04 is now our minimum supported Ubuntu version, and it
has CMake 3.22, let's make CMake 3.22 the minimum CMake version.
2023-08-05 16:45:46 -07:00
tytan652 852dcf6f15 libobs/util: Contain simde diagnostic pragmas 2023-08-06 01:31:02 +02:00
tytan652 54bacd4f10 libobs: Remove variable-length array 2023-08-06 01:31:02 +02:00
cg2121andPatrick Heyer 620eff0768 libobs: Make video frame header public
This fixes compilation of third party plugins that need this
header.
2023-08-03 16:02:56 +02:00
derrodandLain 117534368b libobs: Profile graphics initialisation and shader compilation 2023-08-02 04:48:43 -07:00
jpark37andLain 7669da1ea8 libobs: Add VIDEO_FORMAT_R10L
Support 10-bit packed format that DeckLink uses.
2023-07-29 16:41:31 -07:00
tytan652andLain c6ce50c9a3 deps,libobs,plugins: Remove in-tree Jansson
Jansson is provided by other means on any supported platform.
2023-07-29 16:37:14 -07:00
Ryan FosterandLain f7d3ba7b1b libobs: Check if adapter can safely fast clear 2023-07-29 16:34:47 -07:00
Ryan FosterandLain e5d5df879c libobs: Add function to check fast clear capability 2023-07-29 16:34:47 -07:00
CodeYan01andLain a494cf5ce4 libobs: Add obs_source_info.filter_add
If there is filter_remove, it is reasonable to expect that there is also
filter_add. filter_add also enables filters to attach signal handlers
on the parent, and disconnect them in filter_remove.
2023-07-29 16:15:21 -07:00
Ruwen HahnandLain ac8ccf4027 libobs: Fix GPU scaled video encoder media not being cleared
During encoder shutdown `maybe_clear_encoder_core_video_mix` is
called to clear created mixes that are no longer needed; at that
time `obs_encoder_set_video` rejects changes to `media` since
the encoder is still active, so we bypass those checks

This is an issue e.g. when a rtmp stream disconnects (and thus
all encoders are cleared) and subsequently reconnects
2023-07-26 05:03:12 -07:00