Commit graph

13057 commits

Author SHA1 Message Date
Benjamin Schubert 2fbc0dabda UI: Don't call activateWindow() when hidden 2023-07-15 16:11:27 -07:00
Staacks 22ea121f7c win-dshow: Add support for grayscale MJPEG 2023-07-15 16:09:32 -07:00
Staacks 79d77ddf90 linux-v4l2: Add support for grayscale MJPEG 2023-07-15 16:09:32 -07:00
Clayton Groeneveld e121ac1587 UI, libobs: Add RAII wrappers for faders/volume meters
They can now be automatically deleted.
2023-07-15 16:06:36 -07:00
tytan652 ad243f2355 CI,build-aux: Add Libqrcodegencpp on Linux 2023-07-14 15:32:04 -04:00
tytan652 d76de77abb cmake: Add finder for Libqrcodengencpp 2023-07-14 15:32:04 -04:00
Kurt Kartaltepe 425be04014 UI: Disable QSV for simple mode on Linux
Linux QSV drivers have varying capabilities depending on if the
free/non-free Intel drivers are installed. This means we cannot safely
expose QSV in simple mode as users may be unable stream without changing
to advanced mode.
2023-07-14 12:19:33 -04:00
Kurt Kartaltepe b8ccaf5649 obs-qsv11: Add adapter checks for Linux
This moves the existing adapter checking into the platform layer and
moves the Windows implementation to its platform implementation and adds
a Linux implementation based on directly querying VA-API.

Unlike Windows, this check takes ~1ms so we have no need to spin out
another thread to perform the work. This also fixes up some of the CPP/C
mixing going on in common_utils."h" to allow us to call common functions
from C files.
2023-07-14 12:19:33 -04:00
Kurt Kartaltepe c6b470de9a obs-qsv11: Add a Linux implementation
This adds a CMake module for finding the QSV SDK (libmfx/onevpl) and an
the required platform components to initialize QSV with the VA-API
platform.
2023-07-14 12:19:33 -04:00
Ryan Foster 80864197fb libobs: Fix back-to-back GPU encoder sessions breaking
Reset frame_rate_divisor_counter to 0 on encoder shutdown.

After starting and stopping a GPU encoder session, obs_encoder_shutdown
would set frame_rate_divisor_counter to 1. When the next GPU encoder
session was started, in libobs/obs-video-gpu-encode.c, gpu_encode_thread
would set skip to this value (1), and increment
frame_rate_divisor_counter to 2. This causes the next check to fail, as
frame_rate_divisor is 1 by default (2 == 1 is false), so
frame_rate_divisor_counter retains its value. Since skip is non-zero,
the next check, if(skip), passes, and skip to the next loop iteration.

This will continue forever, because frame_rate_divisor_counter will
continue to increment, so it will never hold the same value as
frame_rate_divisor. This means that send_off_encoder_packet is never
called, so the muxer never receives encoded packets.

To the end-user, this manifests as their second encoder session being
impossible to stop. They then have to force quit OBS and the
obs-ffmpeg-mux process. This change prevents that from occurring and
allows multiple back-to-back GPU encoder sessions to be completed.
2023-07-14 11:56:28 -04:00
derrod 578dc46a79 obs-ffmpeg: Remove legacy FFmpeg compatibility 2023-07-12 15:57:43 -04:00
derrod 46aea3fc70 win-dshow: Remove legacy FFmpeg compatibility 2023-07-12 15:57:43 -04:00
derrod c939525f77 libobs: Remove legacy FFmpeg compatibility 2023-07-12 15:57:43 -04:00
derrod 7731f98d87 deps/media-playback: Remove legacy FFmpeg compatibility 2023-07-12 15:57:43 -04:00
derrod aeaf720247 deps/libff: Remove legacy FFmpeg compatibility 2023-07-12 15:57:43 -04:00
Norihiro Kamae 021826175b obs-ffmpeg: Remove outdated comment 2023-07-12 13:54:50 -04:00
Norihiro Kamae bc6cfab615 libobs/util: Remove outdated comment 2023-07-12 13:54:50 -04:00
gxalpha a4834efde9 UI: Remove Qt 5 ifdef guards and code 2023-07-12 13:22:13 -04:00
PatTheMav a44d1b2dce obs-qsv11: Fix missing ENABLE_HEVC definition for test executable 2023-07-12 12:56:51 -04:00
Ryan Foster a167d7f916 obs-filters: Fix legacy CMake obs_status for RNNoise
Setting ENABLE_RNNOISE to OFF would result in SpeexDSP being logged as
disabled. Correct the CMake logging.
2023-07-12 12:10:20 -04:00
Ryan Foster b2405e465a obs-webrtc: Fix CMake 3.0 module disabled path
The CMake 3.0 path used the old syntax for logging if the module was
disabled. Update this to use target_disable to match the syntax in other
CMake 3.0 paths.
2023-07-12 11:42:17 -04:00
Ryan Foster 7cf7fd0117 obs-webrtc: Fix legacy CMake obs_status call
An additional stray comma resulted in an incorrectly formatted status
message in the CMake log.
2023-07-12 11:42:17 -04:00
Norihiro Kamae 39d4b53f6b UI: Fix preprocessor directives for platform integrations
The macros `YOUTUBE_ENABLED`, `RESTREAM_ENABLED`, and `TWITCH_ENABLED`
are not defined when the associated features are not enabled.
When the code was originally implemented, there were definitions to set
`0` if the feature is disabled. However a later commit 349372b removes
the definition. Now, the use of `#ifdef` is better than just `#if`.
2023-07-12 11:09:36 -04:00
Penwywern 8789c43959 libobs: Fix flip not working with stretch to bounds 2023-07-08 16:42:15 -07:00
derrod ad5f04e53d UI: Soft-delete scene collections
Instead of actually removing the file, simply rename it to the .bak
version which OBS ignores in most cases. That allows users to recover
accidentally deleted collections more easily, while only taking up a
few kilobytes of disk space at most.
2023-07-08 16:39:03 -07:00
Service Checker 7166115cde rtmp-services: Remove defunct servers/services 2023-07-09 01:21:10 +02:00
David Rosca 5fdda179ed obs-ffmpeg: Increase initial buffer fullness for VAAPI
Default ffmpeg initial buffer fullness (75%) is too low
and results in significantly lower video quality on AMD cards.

Changing it to 100% fixes the quality and also matches what
AMF encoder is doing.
2023-07-08 16:19:43 -07:00
derrod 046719f65a win-capture: Enable compatibility data updates by default 2023-07-09 09:14:31 +10:00
CodeYan01 34a9ea09e8 docs: Fix macro definitions 2023-07-08 16:09:09 -07:00
Yoshimasa Niwa 9ab5271d69 UI: Fix crash radio list without items
Check items count before accessing first item,
or it will crash due to out-of-bound access.
2023-07-08 16:08:21 -07:00
Norihiro Kamae 65e35bec7d UI: Fix scenes only multiview label position 2023-07-07 16:38:52 -07:00
derrod 46525f5175 updater: Fix updating without patch files 2023-07-07 12:50:02 -04:00
Lain cececf4e55 UI: Wait for full vcam deactivation to destroy its view
A bug which was technically introduced in df446c3f6e: the author
assigned video mixes to the virtual camera and did not realize you have
to wait for full capture stop with the "deactivate" signal rather than
the "stop" signal. This situation is understandable because these
signals are likely confusing and need more documentation.

The way an output works when it stops is it has three stages:
- "stopping", which is the moment the user themselves stop the output
- "stop", when the output's implementation has stopped and returns
  success or an error code
- "deactivate", when the output inself (not the implementation) has
  fully stopped capturing encoded or raw frame data after the
  implementation has stopped. This is done in a separate thread,
  end_data_capture_thread(), for performance and data race reasons, and
  is when it's "actually fully stopped for real this time"

(Lain note: I sincerely apologize for this confusing signal design)

The author of df446c3f6e was likely confused as to why they could not
destroy the video mix in the "stop" signal without triggering a race
condition in end_data_capture_thread(), and instead decided to make a
workaround to clear the video mix set to the output before destroying
the video mix. Unsetting the video mix I'm guessing *seemed* to fix the
problem for them at the time, and destroying the video mix separately
after that automatically stops capture, so it *technically* worked
because the deactivate thread cannot be called until the
implementation's stop signal has executed. However, it was still the
incorrect way to handle the problem, because it circumvents the output's
mechanism for deactivating the frame data capture by destroying the view
instead.

The reason this was the incorrect way to handle the problem became
exposed in 7cd7ca80f8, when tytan made it so it uses the main video mix
under certain circumstances. The main view is special and cannot be
destroyed, so the mechanism to stop frame data capture that the
virtualcam was using before failed, and raw frame data capture continued
perpetually until the end of the program erroneously.

This fix solves the bug by using the "deactivate" signal rather than the
"stop" signal, thus allowing the output to fully end its data capture
and *then* destroy the video mix.

Fixes obsproject/obs-studio#9153
2023-07-06 15:37:28 -07:00
PatTheMav 9712b33417 CI: Update macOS and Windows build scripts for OAuth configs via preset
Also sets GPU_PRIORITY_VAL via preset on Windows.
2023-07-06 20:20:05 +02:00
PatTheMav bda58bfb8e cmake: Add services preset with OAuth configurations
Allows the use of OAuth credentials set up via environment variables
(as used on CI) without the need for extra plumbing via build scripts.

Also sets GPU_PRIORITY_VAL via preset on Windows.
2023-07-06 20:20:05 +02:00
PatTheMav 5f7a8d8e70 test-input: Update CMakeLists for updated CMake path
Also adds the subdirectory to the project with the updated CMake path,
as it was missed originally.
2023-07-06 18:26:28 +02:00
Sergo e4a3f80f9f libobs: Add use of pause callbacks to CoreAudio monitoring 2023-07-06 15:24:12 +02:00
Sergo 9eea0d8921 libobs: Add pause callback support for sources 2023-07-06 15:24:12 +02:00
CodeYan01 a287313070 docs: Add example for DARRAY as function parameter 2023-07-06 01:47:24 -07:00
Kurt Kartaltepe dc2f2f157b obs-qsv11: Remove Windows references from common files
This cleans up the fairly arbitrary Windows includes and types and
unused functions from the common code and replaces them with platform
independent equivalents, or platform specific implementations in
common_utils.

This removes the Windows 8 support to avoid adding an additional
platform function to query this. OBS only supports Windows 10
officially, so it's about time we removed it.
2023-07-05 19:52:10 -04:00
Kurt Kartaltepe 6acb16840d obs-qsv11: Simplify tracking of which allocator is used
Replace the checks based on D3D11 and D3D9 to check a more informative
variable aptly named UseTexAlloc for which memory allocator should be
used within the encoder.
2023-07-05 19:52:10 -04:00
Kurt Kartaltepe f473f45e03 obs-qsv11: Avoid overwriting encoding parameters
The query being done will ovewrite ALL invalid parameters. This results
in invalid parameters that are not LowPower settings being overwritten
with 0 either introducing different errors or possibly different
behavior.
2023-07-05 19:52:10 -04:00
derrod 8d33da1fab cmake: Disable char8_t when using C++20 2023-07-05 09:39:41 -07:00
PatTheMav 914951a28d mac-virtualcam: Fix use of collection without explicit type
Swift 5.0 requires empty collections to carry explicit type definitions.
2023-07-04 15:41:12 +02:00
Ruwen Hahn 6cdfb0a8b9 libobs: Allow configuring frame rate divisor for encoders
This allows encoders/outputs to output at a frame rate that is lower
than the configured base frame rate
2023-07-03 09:35:06 -07:00
gxalpha 290570b819 mac-capture: Use error code constant instead of magic number 2023-07-03 16:52:50 +02:00
gxalpha e8602897d7 mac-capture: Add button to reactivate stopped capture 2023-07-03 15:35:04 +02:00
gxalpha 89124e223e mac-capture: Remove unneeded debug log
This log line was introduced in 239e9273d and looks like it was for
debugging purposes. It always prints an error message when an SCK audio
capture source was successfully created.
2023-07-02 23:57:48 +02:00
PatTheMav 61bed7a828 cmake: Fix copy to rundir in Release and MinSizeRel configurations
Generated post build action batch scripts retained an empty token to
the copy command with the used generator expression (as PDBs are only
generated for Debug and RelWithDebInfo configurations).

Moving their copy step into its own command (and using the `true`
CMake command, which is a no-op) ensures that builds in Release and
MinSizeRel correctly finish this step.
2023-07-02 14:48:25 +02:00
derrod 7773ea0180 UI: Fix utf-8 paths in shared updater components 2023-07-02 05:09:17 +02:00