Commit graph

2593 commits

Author SHA1 Message Date
jpark37 792f8473ee libobs: Fix SDR async video on non-SDR targets
Bug was seen when projecting SDR video capture on WCG displays.
2023-01-24 19:39:42 -08:00
Jan Beich c082c4a74d libobs/graphics: Enable DMABUF on FreeBSD and DragonFly
Required under Wayland (wlrobs) on FreeBSD and DragonFly. DMABUF was
already partially exposed after c50c625555.
2023-01-24 11:50:13 -05:00
tt2468 018ce16703 libobs: Fix loading of custom_size for empty scenes
Previously, `custom_size` was checked at the end of the `scene_load`
function. If the scene contained no "items" array, the `custom_scene`
loading code would never be run.

This moves the `custom_size` code above the return statement.
2023-01-22 10:26:47 +11:00
tytan652 678b0287e6 libobs: Calm stringop-overflow warning on GCC
Those warnings appeared with GCC 12 with -O2, those are potentially
created by regression from GCC.
2023-01-19 13:08:46 -05:00
tytan652 c648222332 libobs,libobs-opengl,obs-ffmpeg-mux: Calm deprecation warnings on *nix
Calm libobs-opengl deprecation warnings on macOS.

Calm FFmpeg deprecation warning with LIBAVFORMAT_VERSION_MAJOR < 59.
2023-01-19 13:08:46 -05:00
tytan652 ca896dbce7 media-io: Fix FF_API_BUFFER_SIZE_T not being defined on Ubuntu 20.04 2023-01-19 13:08:46 -05:00
tytan652 b0c1c9c86c libobs,plugins: Remove individual -Wno-switch 2023-01-19 13:08:46 -05:00
John Bradley 61284cf9ba libobs: Refactor obs-output encoded use of mixes
There was quite a bit of conflated usage of mixes (which refers
to raw audio) and encoder counts. This fully separates the two
and makes a distinct separation when iterating over mixes vs
encoders.
2023-01-18 11:54:20 -08:00
John Bradley d70171daa6 libobs: Make internal version of remove encoder 2023-01-18 11:54:20 -08:00
tt2468 25df3e183e libobs: Fix logging of remaining views
OBS has been logging `1 views remain at shutdown` when in reality there
are not technically any views remaining. When views are removed, the
view itself is destroyed immediately, but the mix remains, to be
garbage collected by the graphics thread.

In this case, the view has already been removed, but the graphics
thread has not run an interation and cleaned up the mix, so this
log message appears.

Fixes the issue by checking if a mix actually has an assigned view,
instead of blindly logging existing mixes.
2023-01-18 12:17:35 -06:00
tt2468 c69e40734d libobs: Prevent encoders from initializing/starting if no media is set
This fixes a case of undefined behavior, where encoders can try to init
or start without actually having any video_t or audio_t object
assigned.
2023-01-18 12:17:35 -06:00
tt2468 7e30d3f8a2 libobs: Remove unused internal encoder util function
Was previously introduced in a0f679bc40,
but has since been made unused.
2023-01-18 12:17:35 -06:00
tt2468 eb0d9dc5d2 libobs: Allow sending NULL to obs_encoder_set_video/audio()
There is currently no way to clear a video_t or audio_t object from an
encoder once applied. `audio_t`/`video_t` objects can be destructed at
any time, and it is dangerous to prevent these object references from
even being cleared.

This does not fix the issue where destroying an audio/video object does
not clear the reference from all subscribed encoders.
2023-01-18 12:17:35 -06:00
tt2468 dfc20bbb31 libobs: Protect some encoder functions from being used while active
Protect `obs_encoder_set_video()` and `obs_encoder_set_audio()` from
being used if the encoder is active. Changing these values while active
is undefined behavior.
2023-01-18 12:17:35 -06:00
tt2468 f6d0c63b1e
Merge pull request #6960 from tytan652/fix_switches
Switch clean up (remove one-case switch and switch warning workaround)
2023-01-16 03:55:48 -08:00
tytan652 cf5c68b773 UI,libobs,libobs-opengl,obs-ffmpeg: Remove unneeded cast in switches
Those casts were usually used to workaround switch warnings.

Also adds default to OBS frontend event switches that had this
workaround.
2023-01-16 11:52:26 +01:00
tytan652 9cde3c302c libobs: Fix all-except-one switches 2023-01-16 11:52:17 +01:00
tytan652 7de0bd350f libobs,plugins: Remove one-case switches 2023-01-16 11:43:47 +01:00
tt2468 78d31322b2 libobs: Remove extra space in output reconnect log message
It has been bothering me to no end.
2023-01-15 22:59:59 -08:00
Exeldro eb35b07f44 libobs: Fix stopping transitions that are not active 2023-01-14 15:54:48 -08:00
Norihiro Kamae 1805712f46 libobs/util: Fix text-lookup not always case-insensitive
Convert `lookup` to upper-case before creating the tree so that later
code does not need to consider the case-insensitivity.
When converting to upper-case, use `toupper` instead of adding 0x20 so
that the behavior is consistent with `astrcmpi_n`.
2023-01-14 15:09:25 -08:00
jp9000 301fb48449 libobs: Update version to 29.0.0 2023-01-06 09:42:38 -08:00
Ryan Foster 19abcbcd3c Revert "libobs-d3d11: Make sure libobs knows the new adapter index"
This reverts commit e62759a3fa.
2022-12-30 21:14:15 -08:00
Ryan Foster 8dde4bab1e Revert "libobs: Fix adapter index not getting applied to resets"
This reverts commit 02d20e9f36.
2022-12-30 21:14:15 -08:00
jp9000 78f3389d17 libobs: Add funcs to get windows video adapter LUIDs
Useful for providing adapter order to encoder test subprocesses
2022-12-19 11:59:44 -08:00
Sergo Pogosyan 5582503d4f libobs: Duplicate URL string for OBS_BUTTON_URL
WidgetInfo::ButtonClicked() is aborting because URL string is not
allocated and eventually free-d by Python. This fix is allocating
a new string to store the URL passed to the Python function
obs_property_button_set_url().

Free button URL

Repace spaces with tabs

Typo
2022-12-10 15:31:13 -08:00
Antti Tapaninen 44fe366fb0 libobs: Override fps ovi for aux views 2022-12-03 15:15:50 -08:00
Ryan Foster 9f31a9d7a5 libobs: Suppress LNK4098
Suppress LNK4098 to allow building against pre-built Jansson for now.
2022-11-22 00:14:16 -05:00
Jim 02d20e9f36 libobs: Fix adapter index not getting applied to resets 2022-11-21 17:56:45 -08:00
derrod cdc9313829 cmake/libobs: Set OBS_COMMIT based on git describe 2022-11-22 02:54:07 +01:00
Jim e62759a3fa libobs-d3d11: Make sure libobs knows the new adapter index
Because Intel has wonderful code which forces it to run on the iGPU if
there are both an Intel iGPU and an Intel dGPU on the same system, the
adapter index OBS is set to internally will no longer be valid, thus if
anyone calls `obs_get_video_info()` to try to find out what adapter
index OBS is running on, it will be invalid on those computers.
Wonderful.

So, basically, this code here just fixe it so if you want to call
`obs_get_video_info()`, it'll actually have a valid adapter index now,
that way we can reference the adapter index when determining what GPU
we're actually running on without having to like, do anything super
complicated and silly like comparing adapter GUIDs just to figure out
what adapter OBS is actually runing on. I don't want the code to be a
mess anymore.

(I like how in any other situation on the face of the planet, there's no
need to force OBS to run on an integrated adapter. *Normally* OBS
*should* run on the dedicated adapter, that way it can actually capture
games properly. You can probably guess as to why they're forcing it to
run on the integrated adapter rather than the dedicated adapter. But you
know what? Whatever. I don't really care anymore I guess. Just...
whatever. Here we are I guess. Also I was in a bad mood while writing
this just as a disclaimer.)

(I hate that this commit exist. I hate that the commit c83eaaa51c exists
even more.)
2022-11-21 08:47:36 -08:00
gxalpha 34e6a5b73f libobs: Deprecate obs_get/set_master_volume
These methods were never implemented to do anything.
2022-11-19 20:37:22 -05:00
Antti Tapaninen c7f4c78a69 libobs: Allow overriding video resolution per view 2022-11-19 15:34:54 -08:00
jpark37 3d36ba5579 libobs: Fix SRGB to SCRGB async video rendering
SDR source projectors are no longer blown out on HDR displays.
2022-11-17 02:16:48 -08:00
PatTheMav c6cb1eb7d1
libobs: Replace invocations of sprintf with snprintf
Fixes deprecation warnings in Xcode 14/clang on macOS and reduces
chance of buffer overflows.
2022-11-11 19:51:27 +01:00
pkv2 252e352a51 libobs: Change audio resampler to new channel API
The channel_layout API was overhauled by FFmpeg [1-5]. The previous
bitmask channel_layout is replaced by a struct ch_layout which combines
the number of channels, a bitmask and other infos.
The resampler needs to be updated whenever using swresample > 4.5.100.
This commit makes the necessary changes.

[1] Bump minor versions after the channel layout changes
FFmpeg/FFmpeg@cdba98b
[2] lavc: switch to the new channel layout API
FFmpeg/FFmpeg@548aeb9
[3] avutil/channel_layout: Add a new channel layout API
FFmpeg/FFmpeg@086a804
[4] avframe: switch to the new channel layout API db6efa18
FFmpeg/FFmpeg@db6efa1
[5] swresample: convert to new channel layout API
FFmpeg/FFmpeg@8a5896e

Signed-off-by: pkv <pkv@obsproject.com>
2022-11-10 19:37:07 -05:00
jpark37 e709797d80 libobs: Add P3 shaders for Mac 2022-11-09 22:34:50 -08:00
Tommy Vercetti 1adb984bd9 libobs: Log Windows emulation status 2022-11-09 03:03:26 -08:00
Tommy Vercetti eb93011463 libobs: Log macOS Rosetta status 2022-11-09 03:03:26 -08:00
Tommy Vercetti 41efdc498c libobs/util: Add function to get Windows x64 emulation status 2022-11-09 03:03:26 -08:00
Richard Stanway da3a81a637 libobs: Remove Aero logging 2022-11-08 20:44:47 -08:00
derrod 567505b2ed libobs: Fix reading Windows release name 2022-11-08 08:47:23 -05:00
derrod 1b6e1ce655 libobs: Add utility function to get total RAM 2022-11-08 05:38:37 -08:00
jpark37 6306c8de74 libobs: Move async filtering from render to tick
Fixes frame/texture size mismatch crash that can happen at render time.
2022-11-08 05:37:47 -08:00
gxalpha 5658bf6732 libobs: Add "source_update" signal
Adds a source signal that gets triggered when a source's settings are
updated.
2022-11-05 18:06:53 -07:00
Jim 6bd4b854f7 libobs: Update to 28.1.2 2022-11-05 06:33:04 -07:00
PatTheMav bbb3dc0059 libobs: Force hvc1 codec tag for HEVC video and respect input tags 2022-11-02 22:44:20 +01:00
jp9000 808c8105cc libobs: Update version to 28.1.1 2022-11-01 00:51:42 -07:00
jp9000 da6bf3ffba libobs: Update version to 28.1.0 2022-10-31 14:28:33 -07:00
jpark37 080095786f libobs: Force SRGB conversion for tonemapped video
Fixes case where video capture is darkened when both luma wipe and scale
filtering are set.
2022-10-31 14:05:04 -07:00