0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 04:42:18 +02:00
Commit Graph

13592 Commits

Author SHA1 Message Date
derrod
7c36257cc0 libobs: Fix obs_view_remove only resetting the first matching mix 2023-12-02 18:03:11 -06:00
CodeYan01
f5fe9999b4 docs: Add info on obs_frontend_source_list 2023-12-02 18:01:55 -06:00
PatTheMav
63a131ce22 mac-videotoolbox: Fix handling of unsuccessful encoder creation
When an encoder was not created in create_encoder, the appropriate
OSStatus value is returned but the calling code expects a boolean
return value.

The negative OSStatus code sent on error is thus interpreted as a
truthy value and the error is not detected. Changing the call signature
to correctly return an OSStatus (and change the caller to detect
error situations) fixes this.
2023-12-02 17:49:24 -06:00
derrod
859321b767 obs-ffmpeg: Add missing header to CMakeLists 2023-12-02 17:48:12 -06:00
derrod
49e796c6fc libobs: Fix GPU scaling always using the main mix 2023-12-02 17:47:33 -06:00
Stephen Seo
758b47d4ed obs-ffmpeg: Use new side-data FFmpeg 6.1 API
Fixes for using FFmpeg 6.1 due to deprecations. Uses `#if` macros to
allow builds for using older versions of FFmpeg.

This commit replaces usage of `av_stream_add_side_data(...)` with
`av_packet_side_data_add(...)`, as the former was deprecated in favor of
the latter.

The FFmpeg commit that deprecated `av_stream_add_side_data(...)` is [1].

The FFmpeg commit that introduced `av_packet_side_data_add(...)` is [2].

Note that the deprecation commit is after the new API function. The
commit in between [3] appears to be changes that migrates to the usage
of the new API function.

[1]: avformat/avformat: use the side data from AVStream.codecpar
5432d2aaca

[2]: avcodec/packet: add generic side data helpers
74279227dd

[3]: avcodec/codec_par: add side data to AVCodecParameters
21d7cc6fa9
2023-12-02 17:43:18 -06:00
Stephen Seo
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
21d7cc6fa9
2023-12-02 17:43:18 -06:00
Stephen Seo
6e080a6806 deps/media-playback: In check for key-frame, use new FFmpeg 6.1 API
Fixes for using FFmpeg 6.1 due to deprecations. Uses `#if` macros to
allow builds for using older versions of FFmpeg.

AVFrame.key_frame was replaced with a flag in AVFrame.flags. The commit
adding the flag is [1] in FFmpeg's repository, and the deprecation is in
commit [2].

In summary of the "key_frame" change, AVFrame.key_frame is deprecated,
and AVFrame.flags indicates with a bit flag if it is a key frame (with
the enum/defined AV_FRAME_FLAG_KEY).

[1]: avutil/frame: add a keyframe flag to AVFrame
cc11191fda

[2]: avutil/frame: deprecate key_frame
3e06f6f040
2023-12-02 17:43:18 -06:00
Stephen Seo
4b5be75c7e deps/media-playback: Use new (nb_)coded_side_data FFmpeg 6.1 API
Fixes for using FFmpeg 6.1 due to deprecations. Uses `#if` macros to
allow builds for using older versions of FFmpeg.

The change in deps/media-playback/media-playback/decode.c is due to
FFmpeg moving "side_data" into AVCodecParameters which is mentioned in
commit [1] in FFmpeg's repository.

In summary of the "side_data" change, AVStream.side_data is deprecated
and replaced with AVStream.codecpar->coded_side_data, and
AVStream.nb_side_data is replaced with
AVStream.codecpar->nb_coded_side_data.

[1]: avcodec/codec_par: add side data to AVCodecParameters
21d7cc6fa9
2023-12-02 17:43:18 -06:00
derrod
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
Nikola Jovic
21a906d7d9 UI: Fix checkbox misalignment on macOS in properties view 2023-12-02 21:18:36 +01:00
tt2468
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
gxalpha
e9ecb6c565 UI: Make replay buffer settings always visible in Simple Mode
Instead of a checkbox in the recording group that reveals the replay
buffer group when pressed, the replay buffer group now has its own
toggle that enables or disables the replay buffer.
2023-11-27 15:29:57 -06:00
gxalpha
7d55229bef UI: Add to lossless warning that replay buffer is unavailable 2023-11-27 15:29:57 -06: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
Ryan Foster
87c88ef983 obs-ffmpeg: Initialize stopping member variable to false
If an output has already stopped, but its StopRecording function was
called again, then ffmpeg_mux_stop would be called and set stopping to
true. On the next output start, OBS would output 1 frame, see that
stopping is true, and then stop the output.

This was most easily observed using an Output Timer to record prior to
93f5b45be8.

Initialize stopping to false with the other state flags to ensure that
the output has a clean starting state.
2023-11-25 21:07:56 -06:00
Exeldro
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
Susko3
f173650103 docs: Fix missing accessor in example
Tested this in code, and it makes sense from the way
`scenes.sources.array[i]` is accessed.
2023-11-25 17:29:21 -06:00
derrod
2385a3f0f8 libobs/util: Remove unused struct member from text-lookup 2023-11-25 17:09:47 -06:00
Norihiro Kamae
16fed06927 libobs/media-io: Fix link error including a header file from C++ 2023-11-25 17:04:47 -06:00
Norihiro Kamae
2c4d54dd1b libobs/util: Fix link error including header files from C++ 2023-11-25 17:04:47 -06:00
Matt
93f5b45be8 frontend-tools: Fix multiple signal-slot connections on Output Timer
When running an Output Timer multiple times, multiple signal-slot
connections would be made with the corresponding output stop event
functions. This would cause later Output Timers to terminate
unexpectedly early, due to the stop functions having been called
repeatedly on previous Output Timer runs while outputs were stopping.

There may still be an underlying bug with calling stop on outputs
repeatedly, but this change at least ensures that Output Timers only
call their stop functions once.
2023-11-20 17:02:14 -05:00
derrod
cfd8d4c993 updater: Clear shader cache after updating 2023-11-20 04:32:56 -06:00
Richard Stanway
1641812580 libobs-d3d11: Add checksum to shader cache
A few reports came in of cache files with the correct size but full of
null bytes, presumably from a system crash and an SSD lying about buffer
flushes. This commit adds a checksum at the end of the compiled bytecode
so we don't try to use invalid data.

Co-Authored-By: derrod <dennis@obsproject.com>
2023-11-20 04:32:56 -06:00
PatTheMav
9f66c23825 cmake: Align Product Name and Bundle Name on macOS 2023-11-19 15:04:28 +01:00
tt2468
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
jpark37
972e24df79 libobs-d3d11: Use OS D3DCompiler_47.dll
OBS needs Windows 10 minimum these days, so the DLL will be there.
2023-11-18 17:17:25 -06:00
PatTheMav
4a765d3bf0 libobs: Use macOS specific APIs to report free disk space 2023-11-18 17:16:16 -06:00
derrod
ba25bc65c9 UI: Disable safe mode when --multi is used 2023-11-17 15:31:36 -05:00
derrod
845a4a6f64 libobs: Remove superfluous NULL checks 2023-11-17 11:04:33 -05:00
derrod
40e4f789c8 cmake: Enable /GL and /LTCG for non-Debug configurations 2023-11-17 11:04:33 -05:00
PatTheMav
7ae1c35fcb obs-filters: Remove LTCG linker flag for SpeexDSP builds on Windows
Flag was added in CMake 2.0 update and is incompatible with incremental
linking enabled by default for Debug configuration (MSVC default).

The original error that necessitates adding LTCG is not present with
current obs-deps anymore, so remove it instead and disable the
hard-coded default library directive in Debug configuration.
2023-11-16 23:24:41 +01:00
Norihiro Kamae
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
Kurt Kartaltepe
ea1d022c20 linux-pipewire: Ensure number of dmabufs is zero initialized
We use a size_t that can be 64bit while EGL uses 32bit for the
underlying value. Writes from our graphics function can leave high bits
uninitialized and cause iteration of the format list to overlfow.

fixes #9844
2023-11-12 13:32:24 -03:00
jpark37
35f8481498 obs-filters: Add maxRGB tonemapper for SDR
Preserves saturation better than our Reinhard.
2023-11-11 17:50:34 -06:00
PatTheMav
95cab7178e obs-scripting: Add Python 3.11 support for Windows and macOS 2023-11-11 17:45:55 -06:00
tt2468
54d692ada0 rtmp-services: Update IRLToolkit service
- Adds Dallas and Miami ingests
- Rotterdam PoP was moved to Amsterdam
- Use RTMPS for all servers
2023-11-12 00:36:00 +01:00
PatTheMav
e075e7057c cmake: Force PDB generation on Windows for MSVC builds in all configs
CMake 3.25 changed the way PDB generation is handled by only enabling
it for Debug and RelWithDebInfo builds, which prohibits generation of
fully optimized builds with associated symbols (which is MSVC's
default).

If configuring with CMake 3.25 or above, enable this globally for builds
using MSVC and fall back to embedded debug information for anything else
(which would probably be clang-cl).
2023-11-11 17:17:20 -06:00
jcm
a89719a2d2 mac-capture: Add handling for nil target window 2023-11-11 17:06:25 -06:00
Norihiro Kamae
40562ff47e libobs: Expose obs_data_set_autoselect_array 2023-11-10 02:10:43 -06:00
tytan652
14eb93df88 CI: Validate Flatpak repository in push workflow
Avoid to encounter some errors only while publishing.
2023-11-09 18:50:17 -03:00
tytan652
fc79e813ea CI: Allow to silence errors related to publish
This option allows to validate the Flatpak repo on pushes workflow.
2023-11-09 18:50:17 -03:00
tytan652
9f8655921f CI: Validate Flatpak with flatpak-builder-lint
Validate the Flatpak manifest before building it; then, validate
the build directory; and when publishing, validate the repository
as well.

Using flatpak-builder-lint in the org.flatpak.Builder Flatpak in a
docker container seems to not work.

So the linter repo is cloned and Poetry is used to run it inside an
custom action.

"--exceptions" is required to allow the manifest to pass since
OBS Studio has one for "--talk-name=org.freedesktop.Flatpak".

Co-authored-by: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
2023-11-09 18:50:17 -03:00
Georges Basile Stavracas Neto
e03915ee94 CI: Set build-log-url when publishing
This is about to become a Flathub rule, let's pass that.
2023-11-09 18:50:17 -03:00
Georges Basile Stavracas Neto
5f264272e5 CI: Bump flatpak-github-actions commit hash
Use more recent commits. Use a specific commit hash instead of v6.3
to include a fix for the order of arguments in some cases.
2023-11-09 18:50:17 -03:00
Lain
6b5404899a win-capture: Update graphics hook version
Ensures that the newer hook version is copied when installed
2023-11-09 00:13:25 -06:00
tytan652
e14b0e99bb build-aux: Remove StatusNotifierItem Flatpak permission
Since Qt 6.2, "org.kde.StatusNotifierItem-2-2" is no longer needed to
make the tray feature work
2023-11-08 11:35:15 +02:00
田七不甜
5f512d5f25 UI: Fix UseStreamKeyAdv not display stream key and not hide button 2023-11-08 00:13:20 -06:00
Seth Williams
aa1f2dea84 win-capture: Fix Vulkan race condition
This race condition is caused when one thread creates a swap chain,
which calls OBS_CreateSwapchainKHR, at the same time another thread
calls OBS_CreateImageView.

OBS_CreateSwapchainKHR allocates swap data, publishes this into the
data->swaps linked list, then initializes it. Meanwhile,
OBS_CreateImageView is iterating the swaps linked list, to see if the
image matches any swap chain images. Due to the order in
OBS_CreateSwapchainKHR, there's no guarantee this data is initialized
so it often ends up running out of bounds on the swap_images array.

The fix is simply to defer the swap data publish to after init.
2023-11-07 23:48:34 -06:00