Commit Graph

13077 Commits

Author SHA1 Message Date
Georges Basile Stavracas Neto
37fd856e91 linux-pipewire: Factor out format data in a struct
And use it instead of exhaustively open coding each field of
the anonymous struct into the arguments of the lookup function.
2023-07-15 20:46:51 -03:00
Georges Basile Stavracas Neto
d40f5808f4 linux-pipewire: Move format info to streams
So far we've been treating format info on a per-connection basis,
but now that a single connection is capable of hosting multiple
streams, and each stream might negotiate a different format, it
is necessary to move format info to each stream individually.
2023-07-15 20:46:51 -03:00
Georges Basile Stavracas Neto
2f5c40b05b linux-pipewire: Track streams
Make obs_pipewire hold a list of streams created by itself, and
destroy these streams when closing the connection.
2023-07-15 20:46:51 -03:00
Georges Basile Stavracas Neto
330d54fada linux-pipewire: Separate PipeWire core and streams
Sorry, this is a painful commit to review :(

Until now, the only consumer of the PipeWire code is the screen
cast portal code. This portal code only ever has one PipeWire
connection, and one PipeWire stream, every time a monitor or a
window is selected. This is reflected on obs_pipewire, which only
handles a single stream for any given connection.

For cameras and audio, however, a single PipeWire connection can
and most likely always will provide multiple streams. For example,
computers with multiple webcams will have one PipeWire connection
reporting multiple PipeWire nodes, one node for each camera.

This commit breaks this one-stream-per-connection assumption, and
makes obs_pipewire_connect_stream() return an independent object
(obs_pipewire_stream) that represents a single stream.

The screencast portal code continues to only ever have one connection
and one stream.
2023-07-15 20:46:51 -03:00
deadmeu
17f2b9aadb cmake: Fix missing space between sentences
This whitespace character between two sentences in a cmake error message
was accidentally removed in 349372b3b3
2023-07-15 16:44:30 -07:00
Ryan Foster
9967322834 libobs-d3d11: Left-pad device PCI ID to 4 characters with zeroes 2023-07-15 16:41:45 -07:00
Chensiyy
41e2791f27 libobs: Fix PROPVARIANT variable has not be freed
The PropVariantClear function frees all elements that can be freed in a given PROPVARIANT structure.
2023-07-15 16:38:24 -07:00
Chensiyy
54568cb3bd win-wasapi: Fix PROPVARIANT variable has not be freed 2023-07-15 16:38:24 -07:00
gxalpha
32713eb95e docs: Add obs_properties_add_button2 2023-07-15 16:37:14 -07:00
gxalpha
84f1e962a1 UI: Don't set fragmentation movflags in lossless mode 2023-07-15 16:36:35 -07:00
Richard Stanway
4118fa7ac1 libobs: Don't defer encoder updates if not necessary
When #5169 implemented deferred encoder updates, it did not account for
the case when the encoder hadn't started yet. This means the encoder would
start and then immediately call update with the same settings it was
started with, which in the case of some hardware encoders would trigger
a reconfiguration request to the driver.
2023-07-15 16:31:19 -07:00
Chris (Flaeri)
e0293add61 obs-ffmpeg: Fix NVENC VBR maxBitRate set to avgBitrate
MaxBitrate gets correctly set during encoder init, and then promptly
overwritten by nvenc_update, which set max = (avg)bitrate
2023-07-15 16:31:19 -07:00
gxalpha
f7d5d80b04 UI: Localize font picker window title 2023-07-15 16:20:04 -07:00
gxalpha
8fa84e874b mac-capture: Remove internal display settings from SCK Audio Capture 2023-07-15 16:19:02 -07:00
gxalpha
55237ab2ef libobs: Export more libobs/util headers 2023-07-15 16:17:42 -07:00
derrod
076b14ec70 CI: Remove syphon-framework exclude from format script 2023-07-15 16:14:55 -07:00
derrod
593664dcdb clang-format: Set AllowShortLambdasOnASingleLine to Inline 2023-07-15 16:14:55 -07:00
derrod
dcc07cfe4e clang-format: Set AllowAllConstructorInitializersOnNextLine to false 2023-07-15 16:14:55 -07:00
derrod
1739272c44 clang-format: Set AllowAllArgumentsOnNextLine to false 2023-07-15 16:14:55 -07:00
derrod
b1cbdec87b .clang-format: Update and cleanup configuration file
- Set standard to c++17 (Cpp11 is an alias for "Latest")
- Update comments to clang-format 13
- Uncomment options that have previously been commented out due to not
  being available at the time the file was written.
2023-07-15 16:14:55 -07:00
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