2981 Commits

Author SHA1 Message Date
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
jpark37
5fcffb066e obs-filters: Fix blend state for Scale filter
Was incorrectly using straight alpha blend instead of premultiplied.
2021-05-14 01:01:05 -07:00
jpark37
9e3dfa2409 obs-filters: Premultiply alpha for precision
For Apply LUT, and Luma Key, multiply alpha in shader instead of blend
unit for extra precision.
2021-05-14 01:01:05 -07:00
jp9000
6698638450 obs-transitions: Fix memory leak
Fixes a memory leak with stinger texrender objects. These functions must
be called while the graphics context is locked. Caught via warnings
generated by the destroy functions.
2021-05-13 15:13:07 -07:00
tt2468
ca88ba8bbc decklink: Fix crash during shutdown when output is on
The actual crash is caused because obs_module_unload() is called before
the decklink outputs are stopped. In obs_module_unload(), the deviceEnum
pointer is freed. During decklink_output_stop(), the removed code tries
to retrieve a reference of the decklink device from the deviceEnum and
crashes because it has already been freed. This code appears to serve no
purpose anyway, so we remove it.
2021-05-11 21:09:22 -07:00
Jim
055bc1d1ea
Merge pull request #4686 from jpark37/fast-image-source
Premultiply image sources on load
2021-05-11 20:27:53 -07:00
jpark37
9e092bf28e obs-filters: Fix color key distance
Was incorrectly computing distance between linear color and nonlinear
key. Make color nonlinear to match previous behavior.
2021-05-11 20:23:19 -07:00
jpark37
3ee57878a3 image-source: Premultiply images on load
This ensures correct texture filtering, simplifies the render callback,
and allows us to remove the custom draw flag, restoring the direct
rendering optimization for filters against image sources.
2021-05-11 03:44:06 -07:00
jp9000
fa3d87b770 obs-transitions: Use texrender with stacked track mattes
When using a stacked track matte stinger transition with a visibility
transition, the matte portion of video would also be visible on the
right side or below the source. This fixes it by first rendering the
video to a texrender object in order to filter out the unwanted portion.

(Jim note: So basically, track matte stingers now use two texrenders.  I
really don't like this. Texrender objects can already cause stalling as
it is.)
2021-05-11 00:58:16 -07:00
jp9000
c4e0a68641 obs-transitions: Fix track matte rendering improper sizes
When using track matte stingers as visibility transitions, it would
render the matte portion at the incorrect size. This was due to the fact
that texrender render code blocks do not set the projection matrix.
You're supposed to do that manually. Thus, it was using whatever the
current projection matrix was, which was usually the canvas projection
matrix.

(Jim note: There were reasons why I didn't make texrender objects do
this automatically, mostly scaling and performance reasons, but I
realize now I should have at least provided an option for it instead to
prevent this "gotcha" situation from happening. Bad design on my part. I
do not blame Palakis for falling for this.)
2021-05-11 00:58:16 -07:00
jp9000
d4780e061c obs-transitions: Fix annoying log message
This would cause a null pointer check log message because matte_source
only exists when using an explicit separate video for track matte
stingers. Instead, explicitly set matte_ph to null if matt_source is
null to avoid the null pointer check logging.
2021-05-11 00:58:16 -07:00
jp9000
9867b9513f obs-transitions: Only check matte duration if matte exists
The code within this block was being called even when there is no matte
source present. Caught by null pointer checks in the log.
2021-05-11 00:58:16 -07:00
jp9000
279ca988cd obs-transitions: Free matte texrender when not in use
This prevents the texrender object from lingering if the user changes
the transition properties.
2021-05-11 00:58:16 -07:00
jp9000
84b12afa5f obs-transitions: Remove unnecessary matrix push/pop
texrender objects already push/pop the matrix internally, so doing this
within a texrender rendering code block isn't necessary.
2021-05-11 00:58:16 -07:00
jp9000
4636413334 obs-transitions: Reset track matte texture in tick
This causes the track matte render target to only be reset once per
frame, rather than potentially multiple times per frame. Palakis most
likely did not know that you're supposed to reset only once per frame in
order to prevent the render target from being rendered more than once
per frame.

(Jim note: I probably should have made texrender objects automatically
detect new frames internally so it wouldn't require this. Not Palakis'
fault.)
2021-05-11 00:57:26 -07:00
jp9000
07783c1846 Revert transition scaling fix
This reverts commit 091bdb983251380, dc2b00a4dd6669, and
661256e6de080df.

These did not fix the problem with track matte scaling.
2021-05-11 00:25:04 -07:00
jp9000
8ecf634ba7 Revert "rtmp-services: Add Odysee.com"
This reverts commit e876ad6596d11099111d6c526b03a86f9fd8a45c.
2021-05-09 00:55:16 -07:00
jpark37
9d7330ca44 obs-transitions: Blend in linear space
Color mismatch is apparent when using source transitions, which lerps
against transparent black and blends into the canvas nonlinearly. When
the transition is done, the blend switches to linear, leading to a pop.

Fix the issue by blending into the canvas in linear space. The lerp is
still nonlinear by design.
2021-05-08 20:53:44 -07:00
iamflorencejay
e876ad6596 rtmp-services: Add Odysee.com 2021-05-08 15:31:43 -07:00
geekenmd
200c154238 rtmp-services: Add Brime Live service
rtmp-services: Add Brime Live service
2021-05-08 15:14:19 -07:00
jpark37
f40eede37a obs-filters: Fix unreferenced variable warning 2021-05-08 14:12:54 -07:00
jpark37
366b716f20 libobs-winrt,win-capture: Cursor toggle exceptions
A user has reported that toggling the cursor can cause exceptions.

Propagate that information upward, so we can reset the capture.

Display capture never needed to call the function in the first place.

Shuffle around window capture code to make a common reset function.

Builds on PR #4663.
2021-05-07 23:50:13 -07:00
jpark37
3514f4fea5 win-capture: Fix WGC disable index for display
Previously disabled DXGI because the index is wrong.
2021-05-06 13:58:14 -07:00
jpark37
54db450e43 image-source: Premultiply alpha in shader
Fixed-function alpha-blend kills precision of 16-bit alpha.
2021-05-05 09:43:34 -07:00
jpark37
67c2c45964 obs-filters: Fix shader for LUT on OpenGL 2021-05-05 09:42:11 -07:00
jpark37
da187ba73b image-source: Allow linear space alpha
Add support for applying alpha in linear space to match Photoshop
behavior in linear mode, and for just overall correctness. The default
setting is still nonlinear to match common user expectation though.
2021-05-03 22:58:17 -07:00
jp9000
7b4e4b99d2 obs-browser: Add SRGB flag 2021-05-03 19:13:41 -07:00
jpark37
01d065fa7d win-capture: Remove SRGB code
Not having OBS_SOURCE_SRGB is good enough now.
2021-05-03 01:19:56 -07:00
jpark37
128bd26a1f text-freetype2: Remove SRGB code
Not having OBS_SOURCE_SRGB is good enough now.
2021-05-03 01:19:56 -07:00
jpark37
78711fa648 win-capture: Add OBS_SOURCE_SRGB flag 2021-05-03 01:19:56 -07:00
jpark37
41a294311c obs-text: Add OBS_SOURCE_SRGB flag 2021-05-03 01:19:56 -07:00
jpark37
99eb509fe9 mac-capture: Add OBS_SOURCE_SRGB flag 2021-05-03 01:19:56 -07:00
jpark37
9eaf2fa766 linux-capture: Add OBS_SOURCE_SRGB flag 2021-05-03 01:19:56 -07:00
jpark37
819e634be4 image-source: Add OBS_SOURCE_SRGB flag 2021-05-03 01:19:56 -07:00
jpark37
ae7718a765 libobs, obs-filters: SRGB backwards compatibility
Add OBS_SOURCE_SRGB to indicate sources that support SRGB rendering. We
can use this flag to know which sources do not know how to handle SRGB,
and disable accordingly inside obs_source_main_render().

We can also use this flag to clean up the filter interface and remove
the SRGB-specific functions. We also need to disable direct rendering if
the filter source wants to render SRGB, but the parent source does not
support it.

Scenes and groups are marked as having SRGB support, and those are
internal sources that we control.
2021-05-03 01:19:56 -07:00
jpark37
091bdb9832 obs-transitions: Remove dead code 2021-05-01 23:57:49 -07:00
Matt Gajownik
2a7fd297e4 win-dshow: Add support for ASUS coupled audio 2021-05-01 13:53:37 +10:00
Matt Gajownik
19883b74cf obs-browser: Update version to 2.14.2
* Fix bitmask typo when creating OBS version string
* Fix memory corruption when translating Refresh text
2021-05-01 13:50:47 +10:00
jp9000
6e05e8b325 text-freetype2: Fix empty text not updating source
Fixes a bug where if you update the source with empty text, it would
still continue to use the previous text value.
2021-04-30 18:38:31 -07:00
jpark37
e55bfa8e20 obs-filters: Increase opacity precision
For v2 filters, switch Opacity settings from integer [0, 100] to
floating-point [0.0, 1.0] with four decimal places for granular blacks.

Also multiply alpha in shader to maintain precision.
2021-04-30 00:19:49 -07:00
jpark37
8c513ab84c obs-filters: Fix bad math in Color Key v1
Do not treat incoming color uniform as premultiplied.
2021-04-29 13:35:50 -07:00
jpark37
607ee098c5 obs-filters: Handle premultiplied alpha input
Mostly by converting to straight alpha in shader when necessary.
2021-04-28 18:09:52 -07:00
Ryan Foster
8946f02270 obs-filters: Use correct branding for NVIDIA Noise Removal
The feature name is "Noise Removal" with that exact capitalization.
"NVIDIA Noise Removal" or "Noise Removal, powered by NVIDIA Broadcast"
are the two valid options for displaying this feature name in the UI.
2021-04-27 15:29:08 -04:00
Jim
81e9ad818f
Merge pull request #4587 from jpark37/alpha-hack
Apply alpha in nonlinear space for images and async video
2021-04-25 11:26:21 -07:00
jpark37
1f972a066c text-freetype2: Render in nonlinear space
Colors not working properly. Don't want to alter gradients (yet).
2021-04-25 11:10:33 -07:00
Jim
9b38bac480
Merge pull request #4573 from jpark37/nonlinear-transitions
Switch transition interpolation back to nonlinear SRGB
2021-04-25 11:09:57 -07:00
Richard Stanway
61964d519c obs-filters: Check NVAFX is enabled before using mutexes
Fixes a crash on destroy if NVAFX wasn't actually available.
2021-04-25 19:51:20 +02:00
pkv
a5fab92d6f obs-filters: Better describe denoiser methods in menu
The description of the noise suppression methods was updated to
reflect cpu usage and quality in a more accurate manner.
2021-04-25 09:34:45 -07:00
pkv
535f4765ff obs-filters: RTX denoiser, initialize only output channels
This reduces the initialization from 8 to the actual number of output
channels.
2021-04-25 09:24:07 -07:00
Richard Stanway
64c353c019 obs-filters: Initialize NVIDIA AFX in a thread
Initializing NVAFX is slow as it has to load large models and can cause
significant impact to OBS' startup time. This moves NVAFX initialization
into a separate thread. NVAFX does not appear to be reentrant across
threads, hence a global mutex is also used to avoid reentrancy issues.

The downside of this change is that the first few seconds of audio after
adding the filter or starting OBS will not be filtered, but this is
unlikely to cause any real-world issues.
2021-04-25 09:24:07 -07:00