Commit graph

698 commits

Author SHA1 Message Date
Michael Fabian 'Xaymar' Dirks
86e09b6f72 obs-source: Explicitly clear events and copy events 2019-04-03 06:44:04 +02:00
Michael Fabian 'Xaymar' Dirks
fa60be1593 source-mirror: Fix incorrect source alignment
This bug was introduced in 0.6.0 and had sources render half offscreen to the left, as the alignment 4 meant "center left" instead of just "center".
2019-04-03 06:13:23 +02:00
Michael Fabian 'Xaymar' Dirks
af023f9132 project: Version 0.6.0 2019-04-03 02:59:48 +02:00
Michael Fabian 'Xaymar' Dirks
2a53e84bdb filter-blur: Fix more compiler warnings 2019-04-03 02:59:48 +02:00
Michael Fabian 'Xaymar' Dirks
bdf6b893ab source-mirror: Fix a dead lock issue and use a queue system
This fixes a dead lock due to attempting to lock the same filter mutex twice, causing libOBS to completely lock up on every mutex. This extends the fix for 4fc25cfd8d.

Additionally this switches to a proper queue system for audio, so we no longer cause audio stuttering or audio skipping.
2019-04-03 02:58:54 +02:00
Michael Fabian 'Xaymar' Dirks
721bdaf642 project: Reapply clang-format globally 2019-04-03 00:19:01 +02:00
Michael Fabian 'Xaymar' Dirks
b1d7814c64 gs-helper: Add managed obs graphics context
To further distance the code from having to do too much manually, the graphics context is now available as a managed class. All places that previously used obs_enter_graphics and obs_leave_graphics are now using the new gs::context class instead.
2019-04-03 00:16:13 +02:00
Michael Fabian 'Xaymar' Dirks
8ebdde5d36 obs-source: Fix additional compiler warnings 2019-04-02 22:58:50 +02:00
Michael Fabian 'Xaymar' Dirks
ad22341ab0 source-mirror: Fix a few compiler warnings 2019-04-02 22:46:11 +02:00
Michael Fabian Dirks
74f9bc0dbf
locale: Update translations from CrowdIn (#53) 2019-04-02 22:43:37 +02:00
Michael Fabian 'Xaymar' Dirks
4fc25cfd8d source-mirror: Don't render scene items with 0 size
libOBS will simply forget to unlock a mutex if you set the boundary size to zero, resulting in the filters dialog for that source simply getting stuck. Why video rendering can affect the audio filter dialogs is a question for another time, but it's best to just accept it and move on.
2019-04-02 22:10:23 +02:00
Michael Fabian 'Xaymar' Dirks
5738e51e73 obs-source: Also move events in move constructor and operator 2019-04-02 22:08:20 +02:00
Michael Fabian 'Xaymar' Dirks
381aa3ecd4 source-mirror: Correctly check for Audio and Video source
Previously this would not do anything correctly, as the call to obs_source_get_flags does not return anything for most sources. Instead obs_source_get_output_flags should be used to verify that we actually have a video or audio capable source to work with.
2019-04-02 20:19:40 +02:00
Michael Fabian 'Xaymar' Dirks
4d66938832 source-mirror: Replace obs_enum_* with obs::source_tracker
obs::source_tracker allows us to do more over more versions of OBS Studio, so we are able to enumerate any and all Sources, Scenes and Transitions that weren't created private. If we were to rely on libOBS for this, we would need to limit ourselves to version 23 or higher, but with this we can go very far back - as far back as the global event system was fully supported.
2019-04-02 20:19:10 +02:00
Michael Fabian 'Xaymar' Dirks
ee97321319 filter-blur: Add empty entry to the Mask Source input 2019-04-02 19:58:14 +02:00
Michael Fabian 'Xaymar' Dirks
ddf75d3e9f obs-audio-capture: Remove unused code 2019-04-02 19:45:10 +02:00
Michael Fabian 'Xaymar' Dirks
bcf5b56c44 source-mirror: Switch to obs::source audio capture 2019-04-02 19:44:48 +02:00
Michael Fabian 'Xaymar' Dirks
8fb7d193f5 obs-source: Add audio capture and selectively listen to events
Audio capture previously needed an additional class, however there is no need for this if this can be done together with the actual obs::source object. So obs::source now has a new audio_data event that can be listened to, which handles capturing audio data if requested.

Additionally all other events are now selectively listened to, instead of permanently listening to them. This should drastically reduce the overhead of using obs::source.
2019-04-02 19:30:25 +02:00
Michael Fabian 'Xaymar' Dirks
1b7de8b6b1 util-event: Automatically clear event listeners when destructed 2019-04-02 19:11:26 +02:00
Michael Fabian 'Xaymar' Dirks
8e9e39a88e project: Remove unused content 2019-04-02 04:37:37 +02:00
Michael Fabian 'Xaymar' Dirks
21eef998ec filter-blur: Refactor to use new Blur code
This removes the ridiculous amount of hardcoded values and functions and moves everything to the more modular blur approach.

Fixes #45
Fixes #6
2019-04-02 03:50:01 +02:00
Michael Fabian 'Xaymar' Dirks
8a1579f702 cmake: Add refactored and new blur code 2019-04-02 03:50:01 +02:00
Michael Fabian 'Xaymar' Dirks
7c4d46c1fe gfx/blur/dual-filtering: Implement Dual Filtering Blur
Dual Filtering (or Dual Kawase) is an approximation of Gaussian Blur that can reach much higher Blur sizes at a much lower cost. However it is locked to a 2^n size, which means that currently it isn't possible to use it for blur sizes like 19, 24 and 31.

The Blur works by using the linear sampling of a GPU, combined with down- and upsampling and carefully placed sampling points. This means that there is no need for a linear optimized version of this Blur.

Related: #45, #6
2019-04-02 03:50:01 +02:00
Michael Fabian 'Xaymar' Dirks
b6d45ce73c gfx/blur/gaussian-linear: Refactor Linear Gaussian Blur
While Gaussian Blur is not a Blur type that really benefits much from linear sampling, it can be used for a slight quality and gpu usage reduction. However for Area and Directional Blur there is a better alternative: Dual Filtering Blur. And as with all other currently implement Linear versions of Blur, only Area and Directional Blur are supported.

This type of Gaussian Blur also has the loading hitch that exists in normal Gaussian Blur.

Related: #45, #6
2019-04-02 03:50:01 +02:00
Michael Fabian 'Xaymar' Dirks
fedc8e075c gfx/blur/gaussian: Refactor Gaussian Blur
Gaussian Blur is another Blur that now supports the new system, increasing the maxium Blur size to 128 and adding support for Rotational and Zoom blur. Various optimizations were done to the actual shader code which further reduced the GPU usage.

Currently the Gaussian curve is recalculated when the blur is first created, which can lead to a short hitch due to it having to search for the correct kernels. This is currently unavoidable and expected behavior until a better solution is found.

Related: #45, #6
2019-04-02 03:50:01 +02:00
Michael Fabian 'Xaymar' Dirks
68a8fb9224 gfx/blur/box-linear: Refactor Linear Box Blur
Box Blur is a prime candidate for Linear optimizations, and as such reducing the total necessary samples by about half. However due to the reduction in samples, only Area and Directional Blur are supported.

Related: #45, #6
2019-04-02 03:50:01 +02:00
Michael Fabian 'Xaymar' Dirks
8c5dc3c630 gfx/blur/box: Refactor Box Blur
Box Blur is the first to be on the new system and has received all the new features and optimizations available. The maximum Blur size has been increased to 128, Rotational and Zoom Blur are supported and a small optimization has been done to the shader.

Related: #45, #6
2019-04-02 03:50:01 +02:00
Michael Fabian 'Xaymar' Dirks
395e284a37 gfx/blur/base: Newly refactored blur code base
This is the new code base for blur effects, which is much more effective at being re-usable than the old code base. It allows for much better extendable behavior and uses an interface and factory pattern, instead of hardcoding supported features.
2019-04-02 03:50:01 +02:00
Michael Fabian 'Xaymar' Dirks
3f92e1cc89 utility: Move helper macros
As not everything in the plugin needs to use these, they have no place in the plugin header, and thus are now in utility.hpp
2019-04-02 03:50:01 +02:00
Michael Fabian Dirks
1bcca6cb33
locale: Update translations from CrowdIn (#50) 2019-04-02 03:49:42 +02:00
Michael Fabian Dirks
e5cfc2c70d
locale: New Crowdin translations (#49)
Updated translations for german and french.
2019-03-06 03:09:22 +01:00
Michael Fabian 'Xaymar' Dirks
850318dc6e project: Version 0.5.0 2019-03-01 20:46:13 +01:00
Michael Fabian 'Xaymar' Dirks
18b8cc2b5c obs-source-tracker: Use the output flags instead of flags
This fixes being able to filter by the source type (audio, video).
2019-03-01 20:38:49 +01:00
Michael Fabian 'Xaymar' Dirks
f902f8f0f5 filter-blur: Actually call load in the load signal 2019-03-01 20:38:06 +01:00
Michael Fabian 'Xaymar' Dirks
6f1fdb41e7 ci: Don't limit Git history cloning for AppVeyor
The git history is required to determine the version number correctly, and without it the generated archives unfortunately lack that information making them look identical to earlier versions in log files.
2019-03-01 19:58:55 +01:00
Michael Fabian 'Xaymar' Dirks
ba00fbb97e project: Fix even more warnings 2019-03-01 12:00:30 +01:00
Michael Fabian 'Xaymar' Dirks
da6feda981 source-mirror: Remove double mutex lock 2019-03-01 11:37:24 +01:00
Michael Fabian 'Xaymar' Dirks
c0f951d855 project: Fix various warnings 2019-03-01 11:33:19 +01:00
Michael Fabian 'Xaymar' Dirks
133978bbca util-math: Remove alignment from vec2a 2019-03-01 11:14:06 +01:00
Michael Fabian 'Xaymar' Dirks
c1b7f8aa88 ci: Configure and build 32/64-bit in parallel and reduce noise
By configuring and building 32-bit and 64-bit builds in parallel we can save massive amounts of time usually spent just waiting on other resources while the CPU is idle. On AppVeyor, this results in a roughly 50% lower build time, ensuring that builds can complete faster than before.

Artifacts have been reduced to only be created for tagged releases, which also reduces total build time. Additionally the notifications have been reduced to only happen when the build status changes, as there is no reason to notify about things that did not change the status.
2019-03-01 10:59:11 +01:00
Michael Fabian 'Xaymar' Dirks
fa502734ce filter-blur: Allow direct rendering
Small performance optimization as this removes the extra texture render that would be done by libobs which we don't actually need as we already have a texture to render to for it.
2019-03-01 10:59:11 +01:00
Michael Fabian Dirks
516d324187
locale: Update translations from CrowdIn (#43) 2019-02-22 20:38:15 +01:00
Michael Fabian 'Xaymar' Dirks
1c072d67cb filter-transform: Validate source size each tick
Rendering happens with cached Geometry that is only updated when necessary, such as when the user changes settings. This optimization was necessary to reduce CPU and GPU usage as we can simply re-use the same geomtry instead of recalculating it.

However, the actual source size was never checked. That meant that when a source changed size through any means, the filter would not update the geomtry accordingly, and the result was a squished or stretched image.

With this, the source size is now checked each tick.

Fixes #48
2019-02-15 13:52:44 +01:00
Michael Fabian 'Xaymar' Dirks
cbe3555223 cmake: Add template files to project 2019-02-11 06:27:36 +01:00
Michael Fabian 'Xaymar' Dirks
da5d30c43b cmake: Fix OBS Studio typo 2019-02-11 04:03:57 +01:00
Michael Fabian 'Xaymar' Dirks
3bf1333c84 project: Restructure of the file system
The number of files in the source directory was a little bit much and just made file naming more complex than it had to be. Therefore all files were moved into subdirectories where it matters.

Filters now reside in source/filters/, Sources in source/sources/, OBS Wrappers in obs/, OBS GS Wrappers in obs/gs/, Transitions will reside in source/transitions, Graphics Helpers will be in gfx/.
2019-02-11 04:03:57 +01:00
Michael Fabian 'Xaymar' Dirks
3e4930e6e0 filter-transform: Fix incorrect names for properties and options
MipGenerator.Strength was renamed to MipGenerator.Intensity, which better fits the actual intention of the property. Additionally all the mipmap generator options are now correctly named.
2019-02-11 04:03:56 +01:00
Michael Fabian 'Xaymar' Dirks
a49e8c6f9d cmake: Don't generate InnoSetup files for non-Windows platforms 2019-02-02 06:33:49 +01:00
Michael Fabian 'Xaymar' Dirks
9f28144b0b filter-blur: Properly set Image(s) filter for path property 2019-02-01 19:58:05 +01:00
Michael Fabian 'Xaymar' Dirks
43136b00c4 filter-blur: Precalculate correct filter width for Gaussian
Gaussian blur used to have a hard edge which was caused by the filter width being wider than the actual sampling range, which is what is determined by the size option. In order to fix this, we have to figure out the proper filter width for a sampling range, so that we avoid any and all hard edges.

Additionally removes the old texture method entirely.

Fixes #44
2019-02-01 08:35:58 +01:00