3030 Commits

Author SHA1 Message Date
Richard Stanway
5d54cc36a7 obs-filters: Minor NVAFX cleanup
Remove some unused variables, fix incorrect mutex initializer, fix
exporting NVAFX functions via dllexport.
2021-07-24 23:15:45 +02:00
Richard Stanway
320177926d win-capture: Use better defaults in thread_is_suspended
On my system with ~250 processes running, this loop has to run over 500
times before allocating enough memory. Use better initial and increment
values to avoid thrashing the heap.
2021-07-24 23:15:45 +02:00
Richard Stanway
b2e30c955d win-capture: Move NT functions to shared file
Having them declared statically in a header included by multiple
compilation units results in duplicate functions being created.
2021-07-24 23:15:45 +02:00
Richard Stanway
e7df070438 decklink: Add destructor for OBSVideoFrame, initialize flags
Fixes a memory leak and potential access to undefined variable.
Detected by Coverity Scan.
2021-07-24 22:34:44 +02:00
jpark37
31c488f0d0 decklink: Fix truncation warnings
Also simplify DeckLinkDeviceMode::IsEqualFrameRate using cross-multiply.
2021-07-23 21:37:43 -07:00
tt2468
0698eeda94 decklink: Don't show incompatible formats
Changes the formats dropdown for decklink output to only show formats
using the same framerate as OBS does. OBS cannot perform framerate
conversions, meaning that if OBS's framerate is set to 45fps, and
decklink output is set to 60fps, the output will either lag heavily
or simply not function.
2021-07-15 07:29:13 -07:00
jpark37
bf27941f5f libobs-winrt, win-capture: Linear SRGB support
Update window, display, and game capture to always bilinear filter in
linear space, even if the source texture is not SRGB typed. This helps
resolve confusion in situations where we were filtering in nonlinear
space vs. linear space, like when toggling an empty crop filter.
2021-07-11 08:26:30 -07:00
Bruce Zhang
7baf08e917 rtmp-services: add bilibili live 2021-07-08 09:44:28 -07:00
Georges Basile Stavracas Neto
ec3e8146b2 pipewire: Properly pass sizes to gs_draw_sprite_subregion
The gs_draw_sprite_subregion() function is used when a cropping
rectangle is received from PipeWire. It is usually used by
compositors to implement window screencast - where a large and
mostly empty frame is sent, the window contents are only a small
part of it, and the crop rectangle tells us that.

Recently the wlroots implementation of portals started to use it
to implement cropping, and it exposed a bug in the PipeWire code
in OBS Studio. The gs_draw_sprite_subregion() function takes a pair
of integers representing position (x, y) and a pair of integers
representing size (width, height). The PipeWire code, however,
passes a second pair of positions (x2, y2) instead of sizes, and
it causes overrendering the crop area.

This bug wasn't hit yet because both GNOME and KDE implementations
always send (0, 0) as position, which practically never trigger
this condition.

Pass only width and height to gs_draw_sprite_subregion(), instead
of adding x and y to them.

Fixes https://github.com/obsproject/obs-studio/issues/4982
2021-07-08 08:32:55 -07:00
jpark37
4d9d7b7070 obs-filters: Fix comparison type mismatch 2021-07-06 14:08:28 -07:00
jpark37
880eac5b24 obs-ffmpeg: Fix comparison type mismatch 2021-07-06 14:08:28 -07:00
Norihiro Kamae
ed76a3032b text-freetype2: Add alpha channel property
Use obs_properties_add_color_alpha to set alpha for text colors.
2021-07-04 12:16:09 -07:00
jpark37
49cfd2426f mac-syphon: Use DrawOpaque as necessary
Treat "Allow Transparency" to mean alpha should be 1.0. Skipping alpha
writes can cause alpha to stay 0.0, which is not desired.
2021-07-04 10:35:54 -07:00
jp9000
16a49eb10d rtmp-services: Fix implicit function declaration 2021-07-02 07:26:37 -07:00
jp9000
84e6ad2b6d rtmp-services: Update Facebook recommended settings
Adds support for 1080p streams, adds support for 60 FPS streams,
implements bitrate matrix to restrict bitrates depending on the user's
resolution and framerate combination, and removes 480x360, as it was the
incorrect resolution (the correct resolution was supposed to be
640x360).
2021-07-02 07:07:26 -07:00
jp9000
0c8d19147e rtmp-services: Implement bitrate matrix
The bitrate matrix allows specifying maximum bitrate values based upon
resolution and framerate values. This allows more fine-tuned enforcement
of bitrate to prevent users from setting a bitrate that is less ideal
for their particular framerate and resolution combination.
2021-07-02 07:04:24 -07:00
Developer-Ecosystem-Engineering
0fd153f9e1 mac-capture: Update display names
Display names for captured displays should render human readable
2021-06-30 01:52:04 -07:00
Georges Basile Stavracas Neto
fdce267a9a linux-capture: Use portal's D-Bus on PipeWire captures
Intead of creating one pair of GDBusConnection + GDBusProxy objects
for each PipeWire capture, be it window or desktop, use the global
ones managed by portal.c.

Even if g_bus_get_sync() ends up reusing the same object under the
hood, it's still a net gain, since it has to perform some thread
synchronization routines that aren't necessary here. Creating the
proxy object was a worse offender, because despite being asynchronous,
it would still incur in a few socket messages + a cancellable fd +
thread synchronization.

Reuse these objects from portal.c. The biggest code change here is
that create_proxy() and on_proxy_created_cb() were merged into
init_obs_pipewire().
2021-06-30 01:51:02 -07:00
Georges Basile Stavracas Neto
e1c38a1f77 linux-capture: Add getters for portal's D-Bus connection and proxy
It'll be used by the next commit to reuse these objects instead of creating
one per capture.
2021-06-30 01:51:02 -07:00
Georges Basile Stavracas Neto
c18f1ea7ed linux-capture: Conditionally register PipeWire captures
Right now we just assume that every compositor and portal implementation
exposes both window and monitor captures, but that's not true, and in fact
the Desktop portal provides a simple mechanism to check which source types
are available: a D-Bus property called "AvailableSourceTypes".

Read this D-Bus property, and use it to conditionally register the desktop
and the window captures.

Related: https://github.com/obsproject/obs-studio/issues/4815
2021-06-30 01:51:02 -07:00
jpark37
998884a8e6 obs-qsv11: Update Intel Media SDK to 2021 R1
Verified my Rocket Lake CPU works now.
2021-06-30 01:49:06 -07:00
Ryan Foster
85ffdd57f4 win-capture: Return early in property callbacks if param is null
When obs_get_source_properties is called, it calls the property modified
callbacks without a source instantiation. The callbacks set in
.get_properties for display capture and window capture would then result
in exceptions when anything is dereferenced on the source, such as
wgc_supported or update_mutex, because the source itself is null. Let's
make the callbacks return early if the property param is null.
2021-06-30 01:45:42 -07:00
Ryan Foster
1da97fb0d0 win-capture: Check for WGC support on plugin load
We shouldn't have to check WGC support for every display capture or
window capture source. Either the system supports it or it doesn't.
Check when the plugin loads and use that result.
2021-06-30 01:45:42 -07:00
Ryan Foster
2f3c0911fa win-capture: Determine D3D11 usage once per run
The device type (OBS renderer) cannot change without restarting OBS, so
we should only have to check if we're using D3D11 once instead of
checking every time a new display capture or window capture source is
created.
2021-06-30 01:45:42 -07:00
Exeldro
62d0661f98 obs-ffmpeg: Don't purge packets when there are none 2021-06-29 08:40:13 -07:00
Georges Basile Stavracas Neto
6942bb814d pipewire: Properly account for cursor hotspot
The cursor bitmap is centered on the hotspot, so not accounting
for it means PipeWire captures were positioning the cursor sprite
slightly off.

Properly account for the hotspot by subtracting it from the cursor
position.

Related: https://github.com/obsproject/obs-studio/issues/4766
2021-06-22 19:36:15 -07:00
Translation
ef2b1eb1c6 Update translations from Crowdin 2021-06-11 07:18:15 -07:00
jpark37
ba3eb46bf9 obs-ffmpeg: Add missing return statement 2021-06-07 22:14:38 -07:00
jpark37
a8414a09cc obs-ffmpeg: NVENC usage fixes
Only use lossless encode if the capability is supported.

Set qpPrimeYZeroTransformBypassFlag to 1 for lossless.

Do not set profileGUID for lossless.

For both NVENC implementations, retry with a heavier reset because both
are unable to recover from failure lightly.
2021-06-07 21:43:58 -07:00
jpark37
07084de805 obs-ffmpeg: Support lack of Psycho Visual Tuning
For new NVENC, warn if PVT is requested, but unsupported by the GPU.
Also retry without PVT on failure to try to catch bad cominbations.

For old NVENC, if PVT is enabled when FFmpeg failure occurs, retry
without PVT.
2021-06-06 11:05:04 -07:00
jpark37
15e37f96d1 obs-ffmpeg: Add linear alpha setting
Allow proper linear treatment of alpha for authoring sanity.
2021-06-04 19:04:08 -07:00
jpark37
08c5f02010 obs-filters: Fix swapped chroma distance values 2021-06-02 03:37:46 -07:00
Gol-D-Ace
90df8d44df Update translations from Crowdin 2021-05-30 20:33:35 +02:00
Richard Stanway
c5bb1278f4 obs-filters: Test if NVAFX is supported on load
Prevents situations where the redistributable is installed and OBS
enables the RTX denoiser but it is non-functional. Changes were tested
on systems with both supported / unsupported GPUs and it adds around
10-20ms to the load time in both cases.
2021-05-28 23:14:37 -07:00
jp9000
6792e9c1c6 obs-transitions: Disable separate track matte file for now
Because it's not currently possible to guarantee synchronization between
two separate media files (yet), disable separated track matte media
files for now. It'll just result in support requests that can't be
solved.
2021-05-23 04:00:18 -07:00
jpark37
0ffcb66526 graphics-hook: Add Detours include dir 2021-05-19 19:52:49 -07:00
jpark37
924d9a7d9c win-capture: Remove D3D12 fix toggle
The new D3D12 path seems stable enough. Remove the old path.
2021-05-18 12:47:25 -07:00
jpark37
a05b6f7280 win-capture: Bump graphics hook version to 1.5.0 2021-05-17 02:28:11 -07:00
jpark37
c6cee82c92 graphics-hook: Try multiple D3D12 queues
Keep trying queues until one of them passes D3D11On12CreateDevice.
2021-05-17 02:28:11 -07:00
jpark37
5290326b77 graphics-hook: Do not persist device unnecessarily 2021-05-17 02:28:11 -07:00
jpark37
7439e1c4b8 graphics-hook: More logging to help debugging 2021-05-17 02:28:11 -07:00
jpark37
d9d87e6502 graphics-hook: Kill early return 2021-05-17 02:28:11 -07:00
jpark37
c160a6ff3e graphics-hook: Give up on DXGI swap chain
If a swap chain hasn't been seen in a while, assume it no longer exists,
and reset the capture.
2021-05-17 02:28:11 -07:00
jpark37
3412f6fece graphics-hook: Reduce variable scopes 2021-05-17 02:28:11 -07:00
jpark37
32f9fc120a graphics-hook: Prevent recursive free
Make sure to set data.swap to null before calling data.free().
Otherwise, we may call data.free() again in the Release() hook.
2021-05-17 02:28:11 -07:00
jpark37
b899f06877 graphics-hook: Fix potential D3D12 device leak 2021-05-17 02:28:11 -07:00
jpark37
2e7b0e3340 graphics-hook: Use Detours for D3D12 hook
Will attempt to fully use Detours after 27 ships.
2021-05-17 02:28:11 -07:00
jpark37
4de5863d07 graphics-hook: Link Detours library 2021-05-17 02:28:11 -07:00
jp9000
740ff34b65 obs-vst: Remove unused code 2021-05-16 19:24:38 -07:00
Clayton Groeneveld
e1580d12fb obs-transitions: Make sure gs calls are in graphics context
This would cause a memory leak when toggling the track matte
transition.
2021-05-14 07:43:27 -07:00