0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
Commit Graph

1759 Commits

Author SHA1 Message Date
VodBox
52235ba86d libobs: Add transition and showing counter functions
This commit adds a function to forcefully stop a transition, and to
increment/decrement the showing counter for a source with the MAIN_VIEW
type.

These functions are needed for the transition previews to work as
intended.
2019-05-12 21:13:21 -07:00
Jim
e4aca036ca
Merge pull request #1877 from jpark37/qt-on-graphics-thread
libobs: UI: Remove Qt usage from graphics thread
2019-05-10 01:15:09 -07:00
James Park
5471e74cbe libobs: UI: Remove Qt usage from graphics thread
This fixes Xcode warning about detecting UI usage from another thread.
2019-05-09 23:30:37 -07:00
James Park
f03b4dc965 libobs: Restore casts to fix Clang warnings
Clang doesn't like it if you convert T** to const T* const* without
casting even though it should be safe. Might be a C language thing.
2019-05-09 21:59:38 -07:00
Jim
4991113abc
Merge pull request #1852 from jpark37/blend-alpha-attempt-two
libobs: libobs-d3d11: Fix alpha blend
2019-05-08 23:37:10 -07:00
James Park
ba21fb947e libobs: Fix various alpha issues
There are cases where alpha is multiplied unnecessarily. This change
attempts to use premultiplied alpha blending for composition.

To keep this change simple, The filter chain will continue to use
straight alpha. Otherwise, every source would need to modified to output
premultiplied, and every filter modified for premultiplied input.

"DrawAlphaDivide" shader techniques have been added to convert from
premultiplied alpha to straight alpha for final output. "DrawMatrix"
techniques ignore alpha, so they do not appear to need changing.

One remaining issue is that scale effects are set up here to use the
same shader logic for both scale filters (straight alpha - incorrectly),
and output composition (premultiplied alpha - correctly). A fix could be
made to add additional shaders for straight alpha, but the "real" fix
may be to eliminate the straight alpha path at some point.

For graphics, SrcBlendAlpha and DestBlendAlpha were both ONE, and could
combine together to form alpha values greater than one. This is not as
noticeable of a problem for UNORM targets because the channels are
clamped, but it will likely become a problem in more situations if FLOAT
targets are used.

This change switches DestBlendAlpha to INVSRCALPHA. The blending
behavior of stacked transparents is preserved without overflowing the
alpha channel.

obs-transitions: Use premultiplied alpha blend, and simplify shaders
because both inputs and outputs use premultiplied alpha now.

Fixes https://obsproject.com/mantis/view.php?id=1108
2019-05-08 20:26:52 -07:00
Jim
c396a30de7
Merge pull request #1819 from Xaymar/patch-add-effect-debug-info
libobs: Add additional effect debugging information
2019-05-08 17:56:07 -07:00
Clayton Groeneveld
03c9d930da UI: Change volume to dB in adv audio properties 2019-05-08 16:41:17 -07:00
James Park
4afdf70fd5 libobs: Fix crashes from wrong types 2019-05-02 19:09:34 -07:00
Clayton Groeneveld
8789b3469b libobs: Add ability to set spinbox property suffix 2019-05-02 08:54:14 -07:00
mntone
a66ad7eb63 libobs: Use RTLD_FIRST when loading libraries on macOS
Ensures that functions loaded by `os_dlsym()` come only from the
specified library that was loaded with `os_dlopen()` rather than the set
of libraries loaded by the specified library.
2019-04-27 11:56:53 -07:00
jp9000
0e8fe8bbbc libobs/util: Add function to get executable path 2019-04-26 13:24:30 -07:00
James Park
a86710ec5b libobs: Support limited color range for RGB/Y800 sources
libobs: Add support for limited to full color range conversions when
using RGB or Y800 formats, and move RGB converison for Y800 formats to
the GPU.

decklink: Stop hiding color space/range properties for RGB formats, and
remove "YUV" from "YUV Color Space" and "YUV Color Range".

win-dshow: Remove "YUV" from "YUV Color Space" and "YUV Color Range".

UI: Remove "YUV" from "YUV Color Space" and "YUV Color Range".
2019-04-25 15:13:05 -07:00
jp9000
8d125dc01d libobs: Add better default source color range handling
Fixes handling of the `obs_source_frame::full_range` member variable,
which is often set to false by default by many plugins even when using
RGB, which would cause RGB to be marked as "partial range".  This change
is crucial for when partial range RBG support is implemented.

Adds `obs_source_frame2` structure that replaces the `full_range` member
variable with a `range` variable, which uses the `video_range_type` enum
to allow handling default range values.  This member variable treats
VIDEO_RANGE_DEFAULT as full range if the format is RGB, and partial
range if the format is YUV.

Also adds `obs_source_output_video2` and `obs_source_preload_video2`
functions which use the `obs_source_frame2` structure instead of the
`obs_source_frame` structure.

When using the original `obs_source_frame`, `obs_source_output_video`,
and `obs_source_preload_video` functions, RGB will always be full range
by default for backward compatibility purposes.
2019-04-25 15:12:08 -07:00
jp9000
f109d1c2bf Revert "libobs: libobs-d3d11: obs-filters: No excess alpha"
This reverts commit d91bd327d7, which
broke alpha with sources, scenes, and filter, causing them all to become
opaque unintentionally.
2019-04-25 08:36:41 -07:00
James Park
8bafa51d3b libobs: Fix GS_UNSIGNED_LONG definition
GS_UNSIGNED_LONG is defined as sizeof(long) in some places, making it 8
outside of Windows instead of 4 as it should be.

Fixes https://obsproject.com/mantis/view.php?id=1444
2019-04-21 21:25:35 -07:00
Jim
1856f40e2a
Merge pull request #1836 from jpark37/rotated-line-fix
libobs: UI: Fix rotated line scale
2019-04-20 02:34:45 -07:00
James Park
e01fcae133 libobs: UI: Fix rotated line scale
The line drawing functions previously assumed the upper-left 3x3 for
box_transform only held scale. The matrix can also hold rotation, so
pass in scale separately.

Fixes https://obsproject.com/mantis/view.php?id=1442
2019-04-19 06:35:42 -07:00
Richard Stanway
f52d8bddcc libobs: Allow Win32 pipes to pass STDERR for logging of errors 2019-04-19 05:45:38 -07:00
Michael Fabian 'Xaymar' Dirks
6b6ea575ff libobs: Add property groups
Property groups allow multiple properties to be combined into a single
visual group and thus can be used to reduce visual clutter and improve
user experience by giving additional context to a property. The name of
a child of a group is not affected by the group and thus all property
names must still be unique.

A new parent field has been added to obs_properties_t to ease the
tracking of existing properties. That way properties inside a group will
also be able to verify that they have a unique name.
2019-04-18 06:37:36 -07:00
Jim
49d178d593
Merge pull request #1830 from jpark37/bilinear-lowres-gl-fix
libobs: Fix shader for GLSL
2019-04-14 19:16:34 -07:00
James Park
f66625bf1e libobs: Fix shader for GLSL
vec4 to vec3 truncation fix.
2019-04-14 14:15:48 -07:00
Colin Edwards
7dacd58aab
Merge pull request #1795 from cg2121/f-keys-linux
libobs: Add support for F25-F35 hotkeys on Linux
2019-04-14 10:48:46 -07:00
Jim
88d439b587
Merge pull request #1754 from Xaymar/feature-remove-properties
libobs: Add function to remove properties
2019-04-14 05:15:10 -07:00
Jim
9480cc4fd2
Merge pull request #1675 from admshao/clear-linux-compiling-warnings
Clear linux compiling warnings
2019-04-14 04:21:21 -07:00
Jim
827f45acfd
Merge pull request #1672 from derrod/captions-no-throttling
libobs: Add minimum display duration to caption data
2019-04-14 04:19:07 -07:00
Jim
b2bc1e159b
Merge pull request #1589 from caffeinetv/minor-improvements
Minor improvements
2019-04-14 03:43:05 -07:00
Jim
f1399b6d18
Merge pull request #1765 from jpark37/blend-alpha
libobs: libobs-d3d11: Fix blend alpha overflow
2019-04-14 00:22:20 -07:00
James Park
69c215345a libobs: Simplify YUV conversion
Currently several shaders need "DrawMatrix" techniques to support the
possibility that the input texture is a "YUV" format. Also, "DrawMatrix"
is overloaded for translation in both directions when it is written for
RGB to "YUV" only.

A cleaner solution is to handle "YUV" to RGB up-front as part of format
conversion, and ensure only RGB inputs reach the other shaders. This is
necessary to someday perform correct scale filtering without the cost of
redundant "YUV" conversions per texture tap.

A necessary prerequisite for this is to add conversion support for
VIDEO_FORMAT_I444, and that is now in place. There was already a hack in
place to cover VIDEO_FORMAT_Y800. All other "YUV" formats already have
conversion functions.

"DrawMatrix" has been removed from shaders that only supported "YUV" to
RGB conversions. It still exists in shaders that perform RGB to "YUV"
conversions, and the implementations have been sanitized accordingly.
2019-04-11 23:00:03 -07:00
Michael Fabian 'Xaymar' Dirks
195b11341f libobs: Add additional effect debugging information
Adds more log information for effects, such as the reformatted effect code, parameters, techniques and passes. This is useful for tracking down issues and what actually ends up being compiled in the end, without having to guess where the error is actually at, as what is compiled and what was originally there usually differ by a lot.

This information is only logged if libobs is compiled in debug and _DEBUG_SHADERS is defined and not compiled if either of those are not the case.
2019-04-08 21:07:28 +02:00
James Park
21f4dd63d4 libobs: UI: Use graphics debug markers
Add D3D/GL debug markers to make RenderDoc captures easier to tranverse.

Also add obs_source_get_name_no_null() to avoid boilerplate for safe
string formatting.

Closes obsproject/obs-studio#1799
2019-04-08 02:05:37 -07:00
James Park
2996a6c06b libobs/graphics: Support debug markers
Add support for debug markers via D3DPERF API and KHR_debug. This makes
it easier to understand RenderDoc captures.

D3DPERF is preferred to ID3DUserDefinedAnnotation because it supports
colors. d3d9.lib is now linked in to support this.

This feature is disabled by default, and is controlled by
GS_USE_DEBUG_MARKERS.

From: obsproject/obs-studio#1799
2019-04-08 02:05:37 -07:00
James Park
a3e5344cce libobs: Fix move assignment operator for ComPtr
We can't compare addresses of ComPtr for self-reference directly because
the address-of operator is overloaded, causing a compiler error. This
fix more or less matches the WRL implementation.
2019-04-08 02:05:37 -07:00
James Park
d91bd327d7 libobs: libobs-d3d11: obs-filters: No excess alpha
Currently SrcBlendAlpha and DestBlendAlpha are both ONE, and can
combine together to form two. This is not a noticeable problem for
UNORM targets because the channels are clamped, but it will likely
become a problem if FLOAT targets are more widely used.

This change switches DestBlendAlpha to INVSRCALPHA, and starts
backgrounds as opaque black instead of transparent black. The blending
behavior of stacked transparents is preserved without overflowing the
alpha channel.
2019-04-07 18:16:56 -07:00
Jim
a0ead6f974
Merge pull request #1800 from cg2121/add-pragma-once
UI, libobs, text-freetype2: Add missing pragma once in header files
2019-04-06 23:40:43 -07:00
Michael Fabian 'Xaymar' Dirks
9bb276feab libobs: Add function to remove properties
Allows removing a property from a properties list in get_properties or
modified callback to enable dynamic property generation. The behavior
is undefined if the UI properties list is not refreshed by returning
true from the modified callback.
2019-04-06 15:33:46 +02:00
Jim
9eb01a1229
Merge pull request #1808 from jpark37/area-filter-gl-flip
libobs: Fix and simplify Area scale filter
2019-04-04 18:19:02 -07:00
James Park
c4819678c9 libobs: Fix and simplify Area scale filter
It appears there's a projection flip that is applied in some situations,
like the preview pane in studio mode, and the shader math fails when
it's active causing the output color to be zero. This fixes the math for
GLSL (with a tiny redundancy penalty to HLSL), and cleans up some
unnecessary code along the way.

Use abs() to avoid zero area in case the OpenGL projection flip is
active. Also simplify the math, and remove the unnecessary sampler
state.
2019-04-04 08:39:54 -07:00
jp9000
7ef4e10c89 libobs: Update version to 23.1.0 2019-04-04 06:46:51 -07:00
Clayton Groeneveld
d1be93ae69 UI, libobs, text-freetype2: Add missing pragma once in header files 2019-04-01 02:48:28 -05:00
Jim
2d442452b7
Merge pull request #1796 from cg2121/fix-hotkeys-not-showing
UI: Fix issue where space/esc hotkeys would be blank
2019-03-31 20:44:04 -07:00
Clayton Groeneveld
e321005b02 UI: Fix issue where space/esc hotkeys would be blank
This also modifies libobs.

This only happened on Linux.

Fixes https://obsproject.com/mantis/view.php?id=1018
2019-03-31 05:10:02 -05:00
Clayton Groeneveld
9930b294b9 libobs: Add support for F25-F35 hotkeys on Linux
Fixes https://obsproject.com/mantis/view.php?id=1257
2019-03-31 03:41:16 -05:00
Shaolin
721302bf00 libobs: Clear all compiler warnings 2019-03-29 06:29:04 -03:00
jp9000
d18c62b2b5 libobs, image-source: Fix ABI break in image_file_t structure
In commit a776a6cf07, the image_file_t structure (which is a public
structure) had a member variable added to it, which broke ABI.
2019-03-28 22:30:20 -07:00
jp9000
b1f04a47cf libobs: Change internal version to 23.0.3 (temporarily)
While performing a release candidate, it is important to use an actual
version before the actual release candidate version so that the
auto-updater will know to update to 23.1.0
2019-03-28 16:44:07 -07:00
jp9000
11c0d6e976 libobs: Update version to 23.1.0 2019-03-26 22:05:52 -07:00
Jim
7066055cf3
Merge pull request #1761 from jpark37/gl-fixes
libobs: Fix invalid max_anisotropy value
2019-03-26 14:14:06 -07:00
James Park
746820e35a libobs: Fix Area scale filter for GLSL
Remove const qualifiers because they are syntax errors for GLSL when
used like in C.
2019-03-23 13:16:50 -07:00
jp9000
70b8f0aa65 libobs: Fix ABI break
OBS_EFFECT_AREA from 7d811499e was inserted in the middle of the enum,
which breaks ABI for any binaries that use
OBS_EFFECT_PREMULTIPLIED_ALPHA or OBS_EFFECT_BILINEAR_LOWRES.
2019-03-22 03:46:42 -07:00