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

2051 Commits

Author SHA1 Message Date
Ed Maste
97c243fdf9 libobs: add missing FreeBSD #include to fix build
sysctlbyname requires #include <sys/sysctl.h>.  Perhaps this previously
worked due to header pollution that has since been cleaned up in newer
FreeBSD.
2019-11-29 10:51:00 -05:00
Peter Geis
08b1b66439 libobs: fix building modules once installed
sse-intrin.h is a required header now, but the implicit path
breaks building addons once the headers are installed.

Fix this by making the path explicit.
2019-11-27 14:00:15 -05:00
Peter Geis
64d0b7fcb4 libobs: Enable compilation on aarch64
Add arch checks to enable aarch-compat layer on aarch64, retain normal
gcc intrinsics on x86 and ppc64.
2019-11-25 13:04:21 -05:00
Peter Geis
f96545acf3 libobs: Add aarch64 compatibility layer
Add a compatibility layer utilizing simde
(https://github.com/nemequ/simde) to allow compilation on aarch64
without modifying existing functions.
2019-11-25 13:04:01 -05:00
Clayton Groeneveld
82ffcdc827 UI: Add source icons 2019-11-24 20:50:42 -08:00
jpark37
66d78275e2 libobs: Robust COM initialization
Qt seems to force STA, so it's misleading to ask for MTA and ignore the
failure result, so just ask for STA. Also, don't uninitialize COM if
initialization failed.
2019-11-24 09:46:41 -08:00
jp9000
c2c049c606 libobs: Remove _WIN32 ifdef from enum
Ensures that hotkeys cannot become invalid if config data is moved over
to another operating system.
2019-11-17 20:30:42 -08:00
Igor Bochkariov
ba86eb3bcf libobs: fix new virtual key codes display
this is required as GetKeyNameText does not translate multimedia keys
and custom OEM keys returning nonsensical one char names
2019-11-17 18:07:18 -08:00
Igor Bochkariov
d822c07dc3 libobs: add missing virtual key codes for Windows
the missing codes are extracted from WinUser.h header

nameless reserved codes added as hex in case some OEM keyboards send them
2019-11-17 18:07:18 -08:00
Jim
def6fcb0ee
Merge pull request #2125 from DDRBoxman/appbundle
Fixes to make OBS work on Catalina
2019-11-13 12:21:13 -08:00
René Rebe
fcbe593134 libobs: Add more X.org / Unix hotkey defines 2019-11-09 07:29:16 -08:00
VodBox
e8c1ec4035 libobs: Send activate and show signals to filters 2019-11-07 06:19:34 -08:00
jp9000
0a3d2e127f libobs: Fix race condition
It is possible for a GPU encoder to be in a destruction state while
still in the GPU encoder list, although very rare.
2019-11-05 12:02:54 -08:00
Exeldro
478bf7c6af libobs: Add video info to filename formatting 2019-10-22 02:50:13 -07:00
Jim
3e01fdf3e5
Merge pull request #2116 from jpark37/begin-frame
libobs: Add gs_begin_frame for duplicators
2019-10-15 22:23:34 -07:00
Exeldro
e5ae662e7a libobs: Export obs_group_from_source
Export obs_group_from_source to allow it to be used externally
2019-10-15 09:21:21 -07:00
Matt Gajownik
51be039cf8 CMake: Build Windows modules with file descriptors 2019-10-15 21:34:12 +11:00
luz.paz
d124e6402c docs/sphinx: Fix various typos
(This modifies UI, libobs, deps/obs-scripting, various cmake files)

Found using:
`codespell -q 3 -S *.ini,./UI/data/locale,./deps/w32-pthreads -L aci,dur,iff,mut,numer,uint`
2019-10-14 17:19:38 -07:00
Colin Edwards
747ce9b77c libobs: Use proper resource paths when running from an OSX bundle 2019-10-13 21:53:43 -05:00
Jim
09c7ec487b
Merge pull request #2064 from jpark37/bgra-swap-chain
D3D swap chain enhancements
2019-10-12 20:54:33 -07:00
Colin Edwards
7e5ba1bde8
Merge pull request #2120 from jpark37/objc-msgsend
libobs: Strict objc_msgSend support
2019-10-12 12:16:17 -05:00
jp9000
d6f9ff0406 Revert "libobs/audio-monitoring: Don't init until used"
This reverts commit 22aa66a6eb.

Apparently, starting audio on the fly like this can introduce latency in
to the audio playback, so for now revert it.  It was a bit of a
precautionary thing rather than an actual fix anyway, so it probably
wasn't all that necessary to begin with.
2019-10-11 23:34:27 -07:00
jpark37
3130d38c9b libobs: Strict objc_msgSend support
Something changed that makes strict the default. Fixed up the code.
2019-10-11 22:17:23 -07:00
jp9000
236ac66121 libobs: Update version to 24.0.3 2019-10-11 17:33:13 -07:00
Jim
76fe77831d
Merge pull request #2037 from cg2121/compiler-warnings
UI, libobs: Fix compiler warnings
2019-10-11 16:38:48 -07:00
jpark37
ade65df2aa libobs: Add gs_begin_frame for duplicators
We really shouldn't be resetting duplicator state as part of gs_flush.
gs_begin_scene is not ideal because it is called twice per frame, and
only after duplicators have been ticked. Even though it makes no
user-facing difference, it makes more logical sense to reset at the top
of the frame than the bottom.
2019-10-10 21:06:01 -07:00
jp9000
c43b273f62 libobs: Update version to 24.0.2 2019-10-10 16:19:45 -07:00
jp9000
254947eaa0 libobs/audio-monitoring: Add error logging
Helps diagnose issues if the user is unable to initialize audio
monitoring for whatever reason.
2019-10-10 02:04:59 -07:00
jp9000
22aa66a6eb libobs/audio-monitoring: Don't init until used
This prevents audio monitoring from actually initializing unless audio
is actually played back through the source.  This prevents many browser
sources from initializing audio monitoring all at once needlessly if
audio is not being rerouted to OBS.
2019-10-10 02:04:58 -07:00
Clayton Groeneveld
a55f83a38f UI, libobs: Fix compiler warnings 2019-10-10 00:25:54 -05:00
jp9000
54f4b67843 libobs: Update version to 24.0.1 2019-09-20 00:23:36 -07:00
jp9000
65c7e2d19d libobs: Add API to get last OBS version of a source
Allows the ability to change the behavior of a source depending on the
previous OBS version.
2019-09-20 00:13:51 -07:00
jp9000
33c09d91c2 libobs: Add funcs to determine whether audio active
Adds functions to allow sources to inform the UI whether the audio is
currently active or not.  Allows the ability to turn on/off the items in
the mixer.
2019-09-19 23:37:29 -07:00
jp9000
0048b74ed9 libobs: Update version to 24.0.0 2019-09-17 13:51:40 -07:00
jp9000
abaed69627 libobs: Check to swap BGRX/BGRA in async filters
If for whatever reason the format is swapped between BGRA/BGRX in an
async filter, swap the texture to compensate for that.  This allows
plugins to change the format if necessary.
2019-09-17 13:51:40 -07:00
jpark37
4da73445c3 graphics: libobs-d3d11: Use DXGI_SWAP_EFFECT_FLIP_DISCARD on Windows 10
This is supposed to eliminate a copy by DWM with extra benefits for
borderless fullsceen, which should help the fullscreen projector.
2019-09-06 19:39:42 -07:00
Jim
9a5cb0ae36
Merge pull request #2057 from jpark37/area-downscale-rgb
libobs: Fix Area shaders missing for RGB output
2019-08-31 21:16:58 -07:00
Jim
1523acd726
Merge pull request #2055 from jpark37/video-warnings
Fix video format warnings
2019-08-31 21:16:23 -07:00
Jim
9ef993ad13
Merge pull request #2044 from Palakis/bugfix/output-aoi-access-violation
libobs: add pointer check in reset_raw_output
2019-08-31 21:14:36 -07:00
jp9000
23111c317f libobs: Remove redundant function param and for loop
Originally when the audio_submix function was created, it used all mixer
tracks, but at a certain point that was removed because it can only use
the first track, so some older code was unintentionally left over,
causing the same code to be executed 6 times mistakenly.  This cleans
that up by removing the unnecessary function parameter and for loop.
2019-08-31 01:15:19 -07:00
jp9000
1a72b04951 libobs: Make sure to offset unpause audio data
When an unpause occurs, it takes an audio segment and splits it at the
exact point corresponding to the pause timestamp, and then it's supposed
to only send the ending part of the split.  However, the audio pointers
were not being incremented, therefore it was sending the front of the
audio segment to instead of the back of the audio segment by mistake.
2019-08-31 01:15:19 -07:00
jp9000
03e008fd2e libobs: Fix pause cutting out video data prematurely
When pause has been activated, the video_pause_check() function is used
when receiving raw frames in order to filter out frames that are in the
pause window, that way they aren't sent to the encoder or output.

However, when pause was enabled, it was unintentionally filtering out
some frames before the specified starting timestamp as well, causing
extra video data to get cut out prematurely.  This fixes that issue.
2019-08-31 01:15:19 -07:00
jp9000
f6d1887675 libobs: Fail pause/unpause if still waiting for them
When a pause/unpause occurs, a timestamp is set and the actual
pause/unpause does not occur until the output/encoders reach the
specified timestamps.  Do not allow pausing/unpausing unless that point
has been reached with all encoders of an encoded output or the output
itself when using a raw output.

This fixes a bug where pause data could get corrupted if
pausing/unpausing too fast, because the audio/video encoders aren't
necessarily synchronized and although one encoder may have unpaused, the
other encoder(s) may not have yet.  Checking all encoders first before
allowing a pause/unpause ensures that doesn't occur.
2019-08-31 01:15:19 -07:00
jp9000
df5689d534 libobs: Give a little extra time for pause to start/stop
Audio latency can get really low, and if it's low enough, the timestamp
can be passed by the audio subsystem before it's had a chance to pause
with it.  So instead, make the pause have a little bit of extra delay to
ensure that doesn't occur.
2019-08-31 01:15:18 -07:00
jpark37
9bdb16aa78 libobs: Fix Area shaders missing for RGB output
Area downscale setting currently only works with YUV outputs. This adds
the missing DrawAlphaDivide technique.
2019-08-31 00:25:24 -07:00
jpark37
42bf026a49 libobs: Fix video warnings 2019-08-30 22:13:03 -07:00
jp9000
09fc41cc06 libobs: Use correct pointer
This is not supposed to pass the graphics context pointer -- it's
supposed to pass the device pointer held by the graphics context object.
2019-08-30 00:36:27 -07:00
jp9000
3ef5393d42 libobs: Call debug marker after null check, not before 2019-08-29 21:46:13 -07:00
jp9000
7e77294eed libobs: Don't render scene item texture if it's null 2019-08-29 21:44:34 -07:00
jp9000
bf41fd5a6b libobs: Add graphics API to get graphics object pointer 2019-08-29 12:43:10 -07:00
Jim
6943d9a973
Merge pull request #2047 from jpark37/scale-weights
Bicubic/Lanczos Shader Improvements
2019-08-28 08:47:28 -07:00
jp9000
83e237fec1 libobs: Fix default mixer values
There are 6 mixers, so we want 0x3F for 6 bits, not 0xF which is only 4
bits.
2019-08-26 08:24:02 -07:00
jp9000
0845844e5d libobs: Insert sources to linked lists after creation
This fixes a race condition where the audio/video backends/threads may
start using sources before their obs_source_info::create function has
been called.
2019-08-25 19:19:57 -07:00
jp9000
2557ffce7e libobs: Add missing static to function
This function is not used outside of the source file, so make it static.
2019-08-25 19:19:57 -07:00
jp9000
2c3ea4af55 libobs: Fix null potential pointer dereference
When a source type has been removed (i.e. its plugin has been removed)
info can be null, which is permitted.
2019-08-25 19:19:57 -07:00
jpark37
af01e044a2 libobs: Fix Lanczos calculations
- Fix: Ensure (1, 1) coordinate gets clamped.
- Fix: Increase weight precision by premultiplying UV in VS.
- Cleanup: Group coordinates 012/345 instead of 024/135.
- Cleanup: Remove unnecessary branches.

NVIDIA RTX 2080 Ti, Intel GPA, SetStablePowerState

256x224 -> 1323x1080: 123 us -> 123 us
2019-08-25 10:00:23 -07:00
jpark37
3485c4cdac libobs: Simplify bicubic weight calculations
Also increase weight precision by premultiplying UV in VS.

Intel HD Graphics 530, Intel GPA, SetStablePowerState

256x224 -> 1323x1080: 1221 us -> 1020 us
2019-08-25 10:00:10 -07:00
Stéphane Lepin
09e10a46ff libobs: add pointer check in reset_raw_output 2019-08-23 18:59:07 +02:00
jp9000
73704f20db libobs: Add audio lines
Adds the "audio_line" internal source type as a bare source type for the
sole purpose of outputting audio, and the obs_source_info::audio_mix
callback which allows mixing of those audio lines, which is then treated
as normal audio for the source.  Audio line objects should be added as
sub-sources when multiple audio lines from a single source are needed,
then mixed together with the audio_mix callback.

The difference between the new obs_source_info::audio_mix callback and
obs_source_info::audio_render is that obs_source_info::audio_mix (along
with the audio_line source) are only one track, and it outputs audio to
the source automatically via obs_source_output_audio() when the call
completes.  This allows the mixed audio to be treated like a normal
source's audio, in that you can filter it, change its volume, or monitor
it.

This change was necessary because the CEF (used with the browser source)
outputs multiple audio streams at once to a single browser source, so
it's the program's responsibility to mix those streams together itself.
2019-08-21 15:19:19 -07:00
jp9000
806ab5a022 libobs: Mark encoders that support dynamic bitrate
(This commit also modifies mac-vth264, obs-ffmpeg, obs-qsv11, and
obs-x264)
2019-08-18 03:14:38 -07:00
Jim
22ff0cbff3
Merge pull request #1989 from sorayuki/master
libobs: Merge obs_source_process_filter_(tech_)?end functions
2019-08-17 08:36:21 -07:00
Jim
ce51fa092c
Merge pull request #1992 from Xaymar/patch-tidy-up-1
Fix various clang-tidy and CppCheck warnings.
2019-08-17 08:16:46 -07:00
jp9000
74a3e7246e libobs: Fix browser source settings resetting pre-24
Fixes an issue where the browser source settings will continually reset
pre-24.  Note that this is not 23.2.2, but the version is being
temporarily updated in order to fix the issue for the release candidate
build.
2019-08-17 06:21:19 -07:00
Jim
d0c72334b2
Merge pull request #1961 from Xaymar/patch-fix_property_groups
libobs: Fix modified callback and remove by name for groups
2019-08-16 13:16:34 -07:00
jp9000
bc3ed7bbf7 libobs: Reset mixers for "monitoring only" sources
Resets mixer values for sources that are upgrading to "monitoring only"
(the browser source)
2019-08-15 21:23:45 -07:00
Jim
59a8bf2254
Merge pull request #2031 from jpark37/area-output
libobs: UI: Add Area for downscale output
2019-08-15 20:41:29 -07:00
jpark37
0ea820b277 libobs: UI: Add Area scaling for downscale output
Now that Lanczos downscale blurring has been removed, the Area shader
can attempt to fill the void.
2019-08-14 22:33:52 -07:00
jpark37
9f5d218e16 libobs: Remove unnecessary divides from Lanczos 2019-08-14 21:36:23 -07:00
jpark37
93f1ab789d libobs: Fix dark lines using Lanczos
When texel samples are not exactly on texel centers, weight calculations
will involve a divide by a number very close to zero, resulting in
precision issues. Restore normalization of weights to compensate.
2019-08-14 21:00:09 -07:00
SoraYuki
21135f1483 libobs: Merge obs_source_process_filter_(tech_)?end functions 2019-08-14 14:03:34 +08:00
Michael Fabian 'Xaymar' Dirks
a1cc453996 libobs: Fix apply_settings & remove_by_name for groups
'obs_properties_apply_settings' and 'obs_properties_remove_by_name'
would incorrectly ignore property groups and not call the callbacks
or remove the property, resulting in quite glitchy UI.

This fix works by splitting the internal logic of ...apply_settings
into an extra function to call, while keeping the API the same. The
change to ...remove_by_name is to simply recursively going into the
group content with the same function call.
2019-08-13 17:13:10 +02:00
Jim
444991ba21
Merge pull request #2021 from jpark37/yuva-format
Add support for YUV alpha formats
2019-08-11 20:38:17 -07:00
Kurt Kartaltepe
491b6ec035 Revert "libobs-opengl: Add GS_RGBX format"
This reverts commit d940b9e580.
2019-08-11 18:30:28 -07:00
jpark37
3d6f5c8ad6 libobs: Add YUV alpha formats
This will allow YUV alpha formats to be converted to RGBA on the GPU.
2019-08-11 11:26:22 -07:00
Jim
0546d18855
Merge pull request #1934 from kkartaltepe/alpha-linux
linux-capture: Correct XCompCap glxFBConfigs alpha check
2019-08-11 05:00:35 -07:00
Jim
a52c564e5d
Merge pull request #2003 from SCG82/video-io
libobs: Add missing format to format_is_yuv & get_video_format_name
2019-08-10 23:47:15 -07:00
Jim
31a902b3af
Merge pull request #2018 from jpark37/yuv-simplify2
libobs: Separate textures for YUV input
2019-08-10 22:41:28 -07:00
Jim
ecfcb64056
Merge pull request #1994 from jpark37/faster-lanczos
libobs: Optimize lanczos shader, remove scaling
2019-08-10 03:02:26 -07:00
jpark37
bdd8d64053 libobs: Separate textures for YUV input
The shaders to unpack YUV information from the same texture were rather
complicated. Breaking them up into separate textures makes the shaders
much simpler, and we can remove the PRECISION_OFFSET hack.

Performance also gets a nice boost on Intel for planar textures.

Intel GPA, SetStablePowerState, Intel HD Graphics 530, 1920x1080

UYVY: 473 us -> 457 us
YUY2: 492 us -> 422 us
YVYU: 491 us -> 441 us
I420: 1637 us -> 505 us
I422: 1644 us -> 482 us
I444: 1653 us -> 504 us
NV12: 1656 us -> 369 us
Y800 (limited): 270 us -> 277 us
Y800 (full): 263 us -> 289 us
RGB (limited): 341 us -> 411 us
BGR3 (limited): 512 us -> 509 us
BGR3 (full): 527 us -> 534 us
2019-08-09 21:14:29 -07:00
Jim
164f731320
Merge pull request #1995 from jpark37/yuv-simplify
libobs: Separate textures for YUV output, fix chroma
2019-08-09 21:11:45 -07:00
Jim
cd79855ddb
Merge pull request #1998 from jpark37/gpu-timing
libobs: Add GPU timestamp query support
2019-08-09 19:01:47 -07:00
jpark37
b0e7c5d0d3 libobs: Fix stale format in async frame cache
The video format is not updated if switching between cache-compatible
formats, e.g. YUY2 and YVYU, resulting in the wrong conversion technique
being used. This change ensures the format is always up-to-date.
2019-08-07 06:47:27 -07:00
SCG82
5bc1b3bc76 libobs: Add missing pixel format to format_is_yuv and get_video_format_name 2019-08-03 05:42:30 -07:00
jp9000
68a5a40df9 libobs, obs-ffmpeg, win-dshow: Fix FFmpeg 4.0 deprecation
Fixes FFmpeg 4.0 deprecation warnings.
2019-07-29 20:34:13 -07:00
jpark37
0e12d8189c libobs: Add GPU timestamp query support
This change only wraps the functionality. I have rough code to exercise
the the query functionality, but that part is not really clean enough to
submit.
2019-07-27 13:31:07 -07:00
jpark37
9aacc99b3e libobs: Separate textures for YUV output, fix chroma
The shaders to pack YUV information into the same texture were rather
complicated and suffering precision issues. Breaking them up into
separate textures makes the shaders much simpler and avoids having to
compute large integer offsets. Unfortunately, the code to handle
multiple textures is not as pleasant, but at least the NV12 rendering
path is no longer separate.

In addition, write chroma samples to "standard" offsets. For I444,
there's no difference, but I420/NV12 formats now have chroma shifted to
the left as 4:2:0 is shown in the H.264 specification.

Intel GPA, SetStablePowerState, Intel HD Graphics 530

Expect speed incrase:
I420: 844 us -> 493 us (254 us + 190 us + 274 us)
I444: 837 us -> 747 us (258 us + 276 us + 272 us)
NV12: 450 us -> 368 us (319 us + 168 us)

Expect no change:
NV12 (HW): 580 (481 us + 166 us) us -> 588 us (468 us + 247 us)
RGB: 359 us -> 387 us

Fixes https://obsproject.com/mantis/view.php?id=624
Fixes https://obsproject.com/mantis/view.php?id=1512
2019-07-26 23:21:41 -07:00
jpark37
f27ece50c9 libobs: Optimize lanczos shader, remove scaling
Use bilinear filtering to reduce 36 taps to 25 for the regular path.
This works because the middle weights are always between 0 and 1,
allowing texture coordinates to be placed strategically to sample
correct ratios. I'm not sure about the undistort path, so I've left that
alone.

Also remove scaling added in #526, after which weight normalization is
unnecessary. If we want to use or invent an algorithm with alternate
downscaling properties, that's fine, but I don't think we should change
Lanczos scaling to mean something it's not. The scale implementation was
also seen not working when applied directly to scene items because of
assumptions made about the projection matrix.

Intel GPA, SetStablePowerState, Intel HD Graphics 530, D3D11
644x478 -> 1323x1080: 3890 us -> 3401 us
1920x1080 -> 1280x720: 2555 us -> 2261 us
2019-07-26 20:45:33 -07:00
Jim
62c7e00d16
Merge pull request #1993 from jpark37/faster-bicubic
Optimize bicubic shader
2019-07-26 00:36:19 -07:00
jp9000
aee84cc743 libobs: Add "monitoring by default" source cap
(This also modifies the UI module)

Adds the ability for a source to monitor by default.  This is mainly
aimed at browser sources, so that they do not stop outputting audio by
default like they used to.
2019-07-26 00:05:14 -07:00
jpark37
2721ac4a85 libobs: Optimize bicubic shader
Use bilinear filtering to reduce 16 taps to 9 for the regular path. This
works because the middle weights are always between 0 and 1, allowing
texture coordinates to be placed strategically to sample correct ratios.
I'm not sure about the undistort path, so I've left that alone.

Also remove weight normalization. I'm not seeing that make even a small
difference.

Intel HD Graphics 530, D3D11
644x478 -> 1323x1080: 1790 us -> 1279 us
1920x1080 -> 1280x720: 1301 us -> 918 us

References:
https://entropymine.com/imageworsener/bicubic/
http://vec3.ca/bicubic-filtering-in-fewer-taps/
http://developer.download.nvidia.com/books/HTML/gpugems/gpugems_ch24.html
2019-07-25 22:21:11 -07:00
jpark37
2f286b81d9 libobs: Default sampler sometimes unset for GL
When mixing sampling with raw loads in a shader, ending a shader with a
load would case the default sampler to become unset for OpenGL. Instead,
initialize with no sampler, and only set if there is a sampler.
2019-07-25 21:54:23 -07:00
jpark37
2c6aac32c8 libobs: Fix benign typo 2019-07-25 21:54:23 -07:00
James Park
37f663a789 libobs: obs-ffmpeg: win-dshow: Planar 4:2:2 video
This format has been seen when using FFmpeg MJPEG decompression.
2019-07-25 20:11:37 -07:00
Jim
173eec0d6e
Merge pull request #1978 from jpark37/defer-yuv-multiply
libobs: Rework RGB to YUV conversion
2019-07-25 16:20:48 -07:00
Michael Fabian 'Xaymar' Dirks
4159477e43 libobs: Don't leak dynamic library references 2019-07-24 18:26:44 +02:00
Michael Fabian 'Xaymar' Dirks
005921c67d libobs: Return NULL if there is no get_properties callback
If there's no get_properties function, return NULL instead of uninitialized memory.
2019-07-24 18:26:44 +02:00
Michael Fabian 'Xaymar' Dirks
b31e93d59e libobs: Supress clang-tidy warning clang-tidy-cert-flp30-c 2019-07-24 18:26:43 +02:00
Jim
37072e6c97
Merge pull request #1932 from Chiitoo/libdir
cmake: Install 'libobs.pc' under the correct 'libdir'
2019-07-22 02:45:22 -07:00
jpark37
2656bf0a90 libobs: Rework RGB to YUV conversion
RGB to YUV converison was previously baked into every scale shader, but
this work has been moved to the YUV packing shaders. The scale shaders
now write RGBA instead. In the case where base and output resolutions
are identical, the render texture is forwarded directly to the YUV pack
step, skipping an entire fullscreen pass.

Intel GPA, SetStablePowerState, Intel HD Graphics 530, NV12

1920x1080, Before:
RGBA -> UYVX: ~321 us
UYVX -> Y: ~480 us
UYVX -> UV: ~127 us

1920x1080, After:
[forward render texture]
RGBA -> Y: ~487 us
RGBA -> UV: ~131 us

1920x1080 -> 1280x720, Before:
RGBA -> UYVX: ~268 us
UYVX -> Y: ~209 us
UYVX -> UV: ~57 us

1920x1080 -> 1280x720, After:
RGBA -> RGBA (rescale): ~268 us
RGBA -> Y: ~210 us
RGBA -> UV: ~58 us
2019-07-22 01:12:35 -07:00
jpark37
e5b004fd48 libobs: Remove YUV transformation on CPU
This code path does not appear to be used. Breakpoint-inspected all four
output formats I420/I444/NV12/RGB, and they are all behaving as they
should.
2019-07-22 01:12:01 -07:00
jpark37
3ea98b8b0d libobs: Improve timing of unbuffered deinterlacing
There are devices like the GV-USB2 that produce frames with smmoth
timestamps at an uneven pace, which causes OBS to stutter because the
unbuffered path is designed to aggressively operate on the latest frame.

We can make the unbuffered path work by making two adjustments:

- Don't discard the current frame until it has elapsed.
- Don't skip frames in the queue until they have elapsed.

The buffered path still has problems with deinterlacing GV-USB2 output,
but the unbuffered path is better anyway.

Testing:

GV-USB2, Unbuffered: Stuttering is gone!
GV-USB2, Buffered: No regression (still broken).
SC-512N1-L/DVI, Unbuffered: No regression (still works).
SC-512N1-L/DVI, Buffered: No regression (still works).
2019-07-20 21:00:59 -07:00
Jim
262a8c62bc
Merge pull request #1981 from jpark37/optimize-backdrop
libobs: UI: Remove DrawBackdrop() to save fullscreen pass
2019-07-20 17:09:08 -07:00
Jim
3f7d4fe1f5
Merge pull request #1975 from jpark37/area-upscale-shader
libobs: obs-filters: Area upscale shader
2019-07-20 17:06:41 -07:00
Jim
ffcfe4c9d9
Merge pull request #1951 from jpark37/audio-buffering
Fix audio buffering for devices like GV-USB2
2019-07-20 17:05:27 -07:00
jpark37
3456ed0644 libobs: UI: Remove DrawBackdrop() to save fullscreen pass
It's a waste of GPU time to do two fullscreen passes to render final mix
previews. Use blend states to simulate the black background of
DrawBackdrop() for the following situations:

- Main preview window (Studio Mode off)
- Studio Mode: Program

This does not effect:

- Studio Mode: Preview (still uses DrawBackdrop)
- Fullscreen Projector (uses GPU clear to black)
- Windowed Projector (uses GPU clear to black)

intel GPA, SetStablePowerState, Intel HD Graphics 530, 1920x1080

Before:
DrawBackdrop: ~529 us
main texture: ~367 us (Cheaper than drawing a black quad?)

After:
[DrawBackdrop optimized away]
main texture: ~383 us
2019-07-18 19:58:29 -07:00
jpark37
85cc7c84bc libobs: obs-filters: Area upscale shader
Add a separate shader for area upscaling to take advantage of bilinear
filtering. Iterating over texels is unnecessary in the upscale case
because a target pixel can only overlap 1 or 2 texels in X and Y
directions. When only overlapping one texel, adjust UVs to sample texel
center to avoid filtering.

Also add "base_dimension" uniform to avoid unnecessary division.

Intel HD Graphics 530, 644x478 -> 1323x1080: ~836 us -> ~232 us
2019-07-17 21:11:18 -07:00
jp9000
d4e236dd03 libobs: Fix formatting 2019-07-13 19:01:48 -07:00
Colin Edwards
c64d82530d
Merge pull request #1960 from Xaymar/patch-get_defaults2
libobs: Call both get_defaults and get_defaults2
2019-07-13 20:40:20 -05:00
Colin Edwards
4ec072075d
Merge pull request #1958 from DDRBoxman/format
Apply clang-format to objective c code
2019-07-12 21:43:55 -05:00
Michael Fabian 'Xaymar' Dirks
3f6bbe2d49 libobs: Call both get_defaults and get_defaults2
Unlike get_properties, there is not reason to not call get_defaults if it is
given in addition to get_defaults2. Additonally this fixes the bug with
'init_encoder' which would only ever call get_defaults, resulting in broken
encoders if those used get_defaults2.
2019-07-13 00:49:18 +02:00
jp9000
bda28b242c libobs: Fix formatting 2019-07-12 11:48:41 -07:00
Jim
36c8090492
Merge pull request #1952 from obsproject/pause
Add the ability to pause and unpause recordings
2019-07-11 19:56:41 -07:00
Colin Edwards
ad85a9fa25 Apply clang-format to objective c code 2019-07-09 13:39:13 -05:00
wang-bin
5b6ee6e66b libobs: Clear module variable in case module reloaded
Closes obsproject/obs-studio#1957
2019-07-09 08:37:43 -07:00
Kurt Kartaltepe
d940b9e580 libobs-opengl: Add GS_RGBX format 2019-07-08 20:27:13 -07:00
jp9000
153fa6337f libobs: Implement pausing of outputs
This implements pausing of outputs.  To accomplish this, raw audio/video
data is halted to the encoders or raw output.  Pausing is as precisely
timed as possible according to the timing of the obs_output_pause call,
and audio data will be spliced down to the exact audio sample in
accordance to that timing at the start/end marks.

Outputs that support this (outputs used for recording) can set the
OBS_OUTPUT_CAN_PAUSE capability flag.
2019-07-07 16:38:22 -07:00
jp9000
85ca1b6918 libobs: Correct raw output starting audio data
If the audio subsystem was buffered to any extent, the audio of a raw
output would start off at a negative offset, requiring each raw output
to implement a "prepare_audio" function (as seen in the FFmpeg output)
in order to ensure proper synchronization with video.  This did not
apply to encoded outputs because it was already being performed by the
obs-encoder code.
2019-07-07 16:38:21 -07:00
jp9000
70ecbcd5d4 libobs: Add obs_get_frame_interval_ns
Returns the current video frame interval between frames, in nanoseconds.
2019-07-07 16:38:21 -07:00
James Park
da87f08da4 libobs: Buffer-smoothing enhancements
If an audio source does not provide enough data at a steady pace, the
timestamp update does not happen, and buffering increases until it
maxes out. To counteract this, update the timestamp anyway.

Another issue for decoupled audio sources is that timing is not
adjusted for divergence from system time. Making this adjustment is
better for timing stability.

5+ hours of stable audio without any buffering on my GV-USB2 where it
used to add 21ms every 5 mintues or so.

Fixes https://obsproject.com/mantis/view.php?id=1269
2019-07-05 09:13:18 -07:00
jpark37
2ef25ceb85 libobs: Fix format selection
Fix ternary test to use BGRX render targets for YUV to RGB
conversions. The previous behavior may have been fine though since
the shaders fill the alpha channel with 1.0 anyway.
2019-06-27 08:57:41 -05:00
jp9000
f53df7da64 clang-format: Apply formatting
Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed.  Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
2019-06-23 23:49:10 -07:00
jp9000
53615ee10f clang-format: Add clang-format files 2019-06-23 01:53:56 -07:00
Jimi Huotari
ab67b39257
cmake: Install 'libobs.pc' under the correct 'libdir'
In 'libobs/CMakeLists.txt', use '${CMAKE_INSTALL_LIBDIR}' instead of
'${CMAKE_INSTALL_PREFIX}/lib', as the latter results into 'libobs.pc'
being installed under '/lib' when '/lib64' would be more appropriate.

In 'libobs/libobs.pc.in', use '@CMAKE_INSTALL_FULL_LIBDIR@' for
'libdir', '@CMAKE_INSTALL_FULL_INCLUDEDIR@' for 'includedir',
and '@CMAKE_INSTALL_PREFIX@' for 'prefix'.

Gentoo-Bug: https://bugs.gentoo.org/644538
2019-06-21 21:27:53 +03:00
James Park
aa22b61e3e libobs: Full-screen triangle format conversions
The cache coherency of rasterization for full-screen passes is better
using an oversized triangle that is clipped rather than two triangles.
Traversal order of rasterization is GPU-specific, but will almost
certainly be better using an undivided primitive.

A smaller benefit is that quads along the diagonal are not evaluated
multiple times, but that's minor in comparison.

Redo format shaders to bypass vertex buffer, and input layout. Add
global shader bool "obs_glsl_compile" to make API-specific decisions,
i.e. handle upside-down UVs. gl_ortho is not needed for format
conversion because the vertex shader does not use ViewProj anymore.

This can be applied to more situations, but start small first.

Testbed full screen passes, Intel HD Graphics 530:
RGBA -> UYVX: 467 -> 439 us, ~6% savings
UYVX -> uv: 295 -> 239 us, ~19% savings
2019-06-18 22:29:07 -07:00
Jim
6a795d52ea
Merge pull request #1894 from Rosuav/lock-unlock-event
libobs/UI: Implement an item_locked event
2019-06-18 20:31:26 -07:00
Jim
ab70bff4b3
Merge pull request #1913 from jpark37/area-shader-optimization
libobs: Area-resampling shader optimizations
2019-06-17 20:40:25 -07:00
Jim
fafda14963
Merge pull request #1906 from jpark37/bgr-three
libobs: linux-v412: obs-ffmpeg: Add packed BGR3 video support
2019-06-15 16:40:44 -07:00
Jim
914fffe137
Merge pull request #1889 from jpark37/warm-render-targets
libobs: Remove unnecessary frame pipelining
2019-06-15 16:13:03 -07:00
Chris Angelico
2fe641b8a4 libobs, UI: Implement item_locked event
Similar to item_visible, this event fires whenever a scene item is
locked or unlocked. This allows the UI and libobs to remain in sync
regarding scene elements' statuses.
2019-06-15 16:09:10 -07:00
Jim
dd607b422f
Merge pull request #1881 from jpark37/lowres-fair-sampling
libobs: Improve low-resolution bilinear sampling
2019-06-15 16:03:02 -07:00
jp9000
02e523c125 libobs: Update version to 23.2.1 2019-06-13 22:28:10 -07:00
James Park
e72eb39e47 libobs: Disable blending when converting sources
This fixes the issue where limited-range RGB sources were being
composited with dirty render targets.
2019-06-12 22:23:51 -07:00
jp9000
d5708d656e libobs: Fix null pointer dereference 2019-06-11 16:26:09 -07:00
jp9000
0d4d7f617c libobs: Update version to 23.2.0 2019-06-10 22:10:21 -07:00
James Park
9f66b90d99 libobs: Area-resampling shader optimizations
Switch for loop to do/while because we know the condition is always
true for the first loop.

Replace int math with float math to play nicely with more GPUs.

Add variables imagesize/targetsize to avoid redundant reciprocals.

Intel GPA results: 1166 -> 836 us
2019-06-03 23:11:23 -07:00
James Park
614025742b libobs: linux-v412: obs-ffmpeg: Add packed BGR3 video support
Someone mentioned this format preserves the most quality for a
particular capture card using V4L2.
2019-05-30 06:05:53 -07:00
James Park
8d6ed988e6 libobs: Remove unnecessary frame pipelining
Remove three instances of unnecessary double-buffering. They are not
needed to avoid stalls, and cause increased memory traffic when
measured on Intel HD 530, presumably because texture data will remain
in cache if sampled immediately after write.

(Note: GPU timings from Intel GPA are volatile.)

NV12, 3 Draws:
RGBA -> UYVX: 628 us -> 543 us
UYVX -> Y: 522 us -> 507 us
UYVX -> UV: 315 us -> 187 us
Total, Duration: 1594 us -> 1153 us
Total, GTI Read Throughput: 25.2 MB -> 15.9 MB
2019-05-24 01:03:21 -07:00
jp9000
3699209ce4 libobs: Pair encoders only when output actually starts
Normally, paired encoders are unpaired when they stop.  However, if the
pairing occurs before the encoders actually start, and the encoders
never actually end up starting, they are never unpaired, and that
pairing stays with them until the next time an output is started up
again.  That in turn can cause an output that uses one of the encoders
but not the other to not function correctly, and neither properly
"start" nor stop because the data is queued continually in the
interleaved packet array.

For example, let's say there are two outputs, two video encoders, and
one audio encoder.  This can be reproduced by using advanced output mode
and making the two outputs use separate video encoders while sharing
track 1's audio encoder.  If you start up the stream output first and it
fails to fully connect for whatever reason (bad server, bad stream key,
etc), then you start up the recording output, the recording output will
appear to be running, but will not stop when you hit "stop recording".
It will stay perpetually on "stopping recording" and will get stuck that
way.  This is because when the streaming output started, the streaming
output would initially pair video encoder A with audio encoder A before
the encoders actually fully started up (as the encoders do not fully
start up until a connection is successfully made), and when the
recording output starts up after that disconnection, audio encoder A
will wait for video encoder A rather than video encoder B because that
pairing was never actually cleared.

So, instead of pairing encoders when the output starts, wait until the
encoders themselves are being started and then pair the encoders at that
point in time.  This ensures that the encoders start up and will clear
their pairing when no longer in use.
2019-05-22 00:37:12 -07:00
James Park
ab8e895b12 libobs: Remove unreachable YUV decode paths
A previous refactoring to make DrawMatrix unnecessary has left behind
unreachable YUV conversions. Even if this code was somehow reachable,
DrawMatrix for YUV -> RGB doesn't exist anymore, so they would render
incorrectly anyway.
2019-05-19 21:27:18 -07:00
James Park
0c5cb83bf4 libobs: Remove saturate from RGB -> YUV conversion
Incoming texture is UNORM, so the value must already be saturated.
2019-05-18 22:10:42 -07:00
jp9000
973d31b8c2 libobs: Fix lockup when an encode call fails
(This commit also modifies the UI, obs-ffmpeg, and obs-output modules)

Fixes a long-time regression where the program would lock up if an
encode call fails.  Shuts down all outputs associated with the failing
encoder and displays an error message to the user.

Ideally, it would be best if a more detailed error could be displayed to
the user about the nature of the error, though the primary problem is
the encoder errors are typically not something the user would be able to
understand.  The current message is a bit of a generic error message;
improvement is welcome.

Another suggestion is to try to have the encoder restart seamlessly,
though it would take a significant amount of work to be able to make it
do something like that properly, and it sort of assumes that encoder
failures are sporadic, which may not necessarily be the case with some
hardware encoders on some systems.  It may be better just to use another
encoder in that case.  For now, seamless restart is ruled out.
2019-05-17 01:51:12 -07:00
James Park
fede4fb784 libobs: Improve low-resolution bilinear sampling
The issue with the current bilinear_lowres_scale effect is that it
samples adjacent texels, disregarding the texel-to-pixel ratio. If the
ratio is large, this can lead to aliasing. This change provides a fair
set of texture samples across the entire pixel.

The 8-sample pattern used here comes from Direct3D.
2019-05-13 23:54:14 -07:00
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
Jim
5b4a965fd7
Merge pull request #1762 from Dmitry-Me/fixOutputSpecifiers
libobs: Fix output type specifiers
2019-03-20 02:43:36 -07:00
Dmitry-Me
eea71e5e7f libobs: Fix output type specifiers 2019-03-19 18:29:09 +03:00
James Park
cb67192077 libobs: Fix invalid max_anisotropy value
max_anisotropy is initialized to zero, but the minimum value is 1.
2019-03-19 01:26:28 -07:00
Michael Fabian 'Xaymar' Dirks
3cac828a3e libobs: Fix obs_property_float_set_limits
This function incorrectly checked for an Integer type instead of a
Float type, causing it to do nothing.
2019-03-16 04:30:33 +01:00
Dmitry-Me
b835d7ec05 libobs: Fix effect parsing log specifiers
Closes #1649
2019-03-14 00:04:15 -05:00
Colin Edwards
5c16a96770
Merge pull request #1715 from jpark37/area-filter
Add "Area" scale filter
2019-03-13 23:30:25 -05:00
jp9000
a776a6cf07 libobs/graphics: Add memory usage member to image file
Allows estimating the required memory usage of an image.
2019-03-13 01:11:18 -07:00
jp9000
a2829643f4 libobs: Add function to get libobs object data 2019-03-13 00:50:19 -07:00