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

52 Commits

Author SHA1 Message Date
Christoph Hohmann
92b216b468 obs-filters: Fix step size for noise suppression filter 2016-08-11 20:56:38 +02:00
Gol-D-Ace
cb036b2713 Update translations from Crowdin 2016-08-08 16:21:48 +02:00
jp9000
7e8ad0a08e obs-filters: Actually define TRUE/FALSE
Doing something like '#if TRUE' when 'TRUE' isn't defined is the
equivalent to '#if 0' because the preprocessor evaluates an undefined
macro as 0/false.
2016-07-27 10:18:53 -07:00
jp9000
498051b8f0 obs-filters: Fix macro check
This should be checking true or false -- not whether it's defined or
not.
2016-07-27 10:02:12 -07:00
jp9000
71dc8d6407 obs-filters: Add comments to noise suppression filter
These comments have been added to clean up the code and make it more
clear of what the code is doing.  The code felt a bit messy, and this
should help prevent the original author of the noise suppression filter
from being lost in case he decides to modify/improve the filter.
2016-07-26 05:06:26 -07:00
jp9000
6fcb5372e9 obs-filters: Remove redundant code
This variable was always being set to that value regardless a few lines
below.
2016-07-26 04:53:46 -07:00
jp9000
155ddf8996 obs-filters: Handle timestamp jumps for noise sup. filter
When buffering audio data, we don't want to buffer audio data that may
be old.  If the audio timing jumps significant and old audio data is
buffered, clear that old data.
2016-07-26 04:50:18 -07:00
jp9000
55a5664363 obs-filters: Buffer noise suppression audio data
The noise suppression filter mistakenly operated on the assumption that
input audio data would always be in 10ms segments, and would crash if
audio data was larger than that size.

Because speexdsp operates on fixed audio frame sizes only, we must
buffer audio data to fit that frame processing size.  This creates a
troublesome situation where you must buffer around that specified frame
size.

The new steps for processing are:
1. Push audio data to input circular buffer.
2. Push number of audio frames and timestamp for that audio packet to an
   'info' circular buffer.
3. Check size of input circular buffer, and while it's equal to or above
   the speexdsp frame size (10ms for minimum latency), pop from the
   input buffer to a temporary buffer (10ms frames) and process it, then
   push that temporary buffer to the output circular buffer.
4. Peek at the front of the 'info' circular buffer.
5. If the output circular buffer frame size is equal or larger than next
   expected number of frames, pop both the info and output buffer, and
   return the audio data with the expected audio frames/timestamp.
2016-07-26 04:29:50 -07:00
Simon
f3d0272f57 obs-filters: Add speexdsp-based noise suppression filter 2016-07-25 20:17:13 -07:00
jp9000
6ac832fbb2 obs-filters: Fix scroll filter sampler state
When the crop filter was changed to a crop/pad filter, the sampler state
was changed to use a transparent border for the U/V addressing mode.
However, what was not realized at the time was that the scroll filter
also shared the crop effect file, and the scroll filter depended on the
old sampler state (wrap u/v).

This fixes the issue by simply setting a u/v wrap sampler state in the
scroll filter.
2016-07-08 03:03:23 -07:00
Gol-D-Ace
81adb13f59 Update translations from Crowdin 2016-07-06 01:18:27 +02:00
jp9000
9413a43869 obs-filters: Add scaling/aspect ratio filter
Allows forcing a specific resolution or aspect ratio on a source, with
user-defined sampling.
2016-06-29 08:00:52 -07:00
Olle Kelderman
c7e3dfc347 obs-filters: Change 'Crop' filter to 'Crop/Pad' filter
Allows the ability to pad in addition to cropping.  Changes the name to
Crop/Pad filter.

(Additional edits by Jim: Greatly refactored/simplified filter code)

Closes jp9000/obs-studio#532
2016-06-28 02:46:36 -07:00
nd
f7ac9258d4 obs-filters: Change async delay filter max delay to 20 sec
Closes jp9000/obs-studio#549
2016-05-30 10:42:16 -07:00
Gol-D-Ace
fe56a12867 Update translations from Crowdin 2016-05-14 00:27:59 +02:00
jp9000
5edc0c9580 obs-filters: Fix more chroma key shader code
In aa4e18740a I mistakenly thought that I could add the variables
back in and that it would automatically cull variables that aren't used,
but that wasn't the case -- the shader parser always checks to see
whether parameters were set, and if they're not, it'll fail.  This fixes
an issue where the shader would try to access parameters that are no
longer needed and fail due to the shader parameter check.

YUV-based shader support has been removed (due to the fact that no
sources ever use YUV shading) so there's no reason to keep around the
YUV processing code.
2016-04-24 15:57:46 -07:00
jp9000
aa4e18740a obs-filters: Fix chroma key shader bug 2016-04-24 13:55:39 -07:00
jp9000
5349bbf633 obs-filters: Skip scroll filter if parent has no cx/cy
There's no point in the filter continuing its processing if there's
nothing to draw.
2016-04-23 14:39:38 -07:00
jp9000
a23d8e3f2c obs-filters: Fix scroll filter offsets becoming non-finite
If the parent source of a scroll filter has a 0 width or 0 height, the
scroll filter would do a division by zero on the size_i variable, which
would then cause the offset variable to perpetually have a non-finite
value, thus preventing the scroll filter from rendering properly after
that due to the non-finite offset value being uploaded to the shader.
2016-04-23 14:39:37 -07:00
Gol-D-Ace
5ed7081213 Update translations from Crowdin 2016-04-23 10:29:21 +02:00
jp9000
ff99ba7818 libobs: Allow filter processing function to return false
(Note: this commit also modifies the obs-filters and test-input modules)

Changes the obs_source_process_filter_begin return type so that it
returns true/false to indicate that filter processing should or should
not continue (for example if the filter is bypassed or if there's some
other sort of issue that causes the filtering to fail)
2016-04-22 10:18:12 -07:00
jp9000
9e15e3d8fd libobs: Remove need for DrawMatrix technique in effects
(Note: This commit also modifies obs-filters and text-freetype2)

This simplifies writing of effects.  DrawMatrix is no longer necessary
because there are no sources that require drawing with a color matrix
other than async sources, and async sources are automatically processed
and don't defer their initial render stage to filters.
2016-03-21 21:22:26 -07:00
jp9000
69da1151e0 Update translations from Crowdin 2016-03-19 12:08:48 -07:00
Gol-D-Ace
2b7036dc93 Add latest translations from Crowdin 2016-02-21 22:16:12 +01:00
dodgepong
ea9db8249b Add latest translations from CrowdIn 2016-01-31 18:28:35 -05:00
jp9000
bd6ffd76d0 obs-filters: Make mask filter use gs_image_t helper
Prevents it from loading the entire image in the graphics thread, and
allows for animated gifs in the filter (not that anyone would ever do
that.  ..right?)
2016-01-26 11:49:24 -08:00
jp9000
4f782f2415 obs-filters: Make mask/blend image center w/aspect by default
Fixes what is arguably the most annoying feature of the mask/blend
filter, the fact that the image always stretches to the entire source.
It now centers and preserves aspect ratio by default, with an option to
make it stretch and discard aspect ratio to make it operate as it did
before.
2016-01-26 11:49:23 -08:00
jp9000
1bbb18ea3d obs-filters: Mark unused parameter 2015-11-20 14:31:01 -08:00
jp9000
78d5e27abe obs-filters: Reset cx/cy/mul/add crop vals in tick, not render
To first render the filter, the width/height values must be set, but
currently they're only set in the render function, which means that the
crop filter can never be rendered when the program first starts up.
This would cause the filter to fail to render at all under those
circumstances.

This patch moves the calculations from render to tick to ensure that
they're always called and the values are always set.
2015-11-20 14:07:14 -08:00
Gol-D-Ace
2ee1d82860 Add latest translations from Crowdin 2015-11-16 21:04:55 +01:00
Richard Stanway
6c15d814bf obs-filters: Null check filter->effect instead of filter
Detected by Coverity Scan (CID 12876, 12877, 12878, 12879)
2015-10-12 23:21:45 +02:00
dodgepong
76c18b079b Latest translations from CrowdIn 2015-09-22 23:33:29 -04:00
jp9000
6285a47726 (API Change) libobs: Pass type data to get_name callbacks
API changed from:
obs_source_info::get_name(void)
obs_output_info::get_name(void)
obs_encoder_info::get_name(void)
obs_service_info::get_name(void)

API changed to:
obs_source_info::get_name(void *type_data)
obs_output_info::get_name(void *type_data)
obs_encoder_info::get_name(void *type_data)
obs_service_info::get_name(void *type_data)

This allows the type data to be used when getting the name of the
object (useful for plugin wrappers primarily).

NOTE: Though a parameter was added, this is backward-compatible with
older plugins due to calling convention.  The new parameter will simply
be ignored by older plugins, and the stack (if used) will be cleaned up
by the caller.
2015-09-16 09:21:12 -07:00
hwdro
fc19d9d11b obs-filters: Fix noise-gate calculation errors
For both cases the cur_level calculations were "wrong". For one channel
case, I assume that was only an oversight, as for two channels case
cur_level "calculation", getting the level from downmixing to mono will
result in an attenuated level than expected. One solution is to use the
highest level of both channels to drive the gate.
2015-09-09 18:07:30 +03:00
dodgepong
fb679bdd02 Add latest translations from CrowdIn 2015-07-08 14:56:07 -04:00
jp9000
f8c5c7f55f obs-filters: Add gain filter
This filter simply modifies the volume of the signal as a convenient way
of modifying the volume before other filters, or amplify the volume
without having to mess with advanced audio properties.
2015-06-26 06:11:54 -07:00
jp9000
8bb84cdb3b obs-filters: Use audio-math.h for db conversions 2015-06-26 03:40:29 -07:00
jp9000
204d5f30ce obs-filters: Remove fminf/fmaxf redefinitions
These functions are already defined in math.h, so there's no need to
define them again.
2015-06-26 03:03:15 -07:00
jp9000
07ca99f523 obs-filters: Change 'db' abbreviation to 'dB' 2015-06-25 23:28:26 -07:00
jp9000
cc45b92a8e obs-filters: Add noise gate filter 2015-06-25 15:55:28 -07:00
jp9000
ecabe35f36 obs-filters: Add scroll filter 2015-06-21 01:21:22 -07:00
jp9000
eab60e04d9 obs-filters: Make crop shader wrap texture
This is mostly so that it can be used with the scroll filter, which uses
identical shaders, but needs to wrap the texture instead of clamp.
2015-06-21 01:12:02 -07:00
jp9000
aafd114e67 Add latest translations from Crowdin 2015-05-12 15:29:43 -07:00
dodgepong
d0fbe3b382 Add latest translations from CrowdIn 2015-05-08 17:10:39 -04:00
jp9000
6e98fb89f4 obs-filters: Add sharpen filter 2015-05-01 02:07:18 -07:00
dodgepong
a04548070c UI: Add latest translations from CrowdIn 2015-03-25 20:51:25 -04:00
jp9000
2f6ba39b41 obs-filters: Add color key filter
Masks out a specific color range in RGB color space.  Commonly used with
solid image data or animated video rather than live video.
2015-03-25 14:14:39 -07:00
jp9000
adb392e08a obs-filters: Add chroma key filter
This allows applying a mask based upon the chroma value (U/V) of a
specific color in YUV color space.  Commonly used to mask out
greenscreens and bluescreens in live video.
2015-03-25 14:14:38 -07:00
jp9000
bee5b3a2d2 obs-filters: Add color correction filter
Adds a color correction filter if one wishes to just apply
gamma/constrast/brightness/opacity/color to a source.
2015-03-25 14:12:05 -07:00
jp9000
bd1ede883d obs-filters: Add crop filter
Allows any source to be cropped, though note that this renders to
texture first, so for more optimal results, cropping values should
probably be put in to capture sources that can be cropped as they're
actually rendered by the source.
2015-03-25 14:12:05 -07:00