This fixes an issue where cache frames would not free at all after
having been allocated with no upper limit on the cached frame size. If
cached frames go unused for a specific period of time, they are
deallocated and removed from the cache.
This is preferable to having an upper cache limit due to the potential
for async delay filtering.
Under certain circumstances the cache could be prone to growing too
large unintentionally. Setting a hard maximum limit should prevent
memory from growing if we suddenly get a lot of frames.
Async frames are only swapping when rendering, or when not visible.
This is a flawed design due to the fact that there are certain
circumstances where the source is neither visible nor currently
rendering.
This is what caused a memory leak when scene items were marked as
invisible, because if a source has an async child source and decides not
to render that source for whatever reason, the child source would not
process the async frames at all, and the cache would just grow.
To fix this, simply moving the async frame cycle to tick fixes the issue
due to the fact that tick is always called regardless of circumstance.
If capture starts too quickly, the file mapping will return 2, which
means file not found, and it would then reset the capture and try again.
Sometimes this would result in long intervals where it wouldn't capture.
This fixes the issue by simply making game capture retry if file mapping
returns error number 2.
There was an issue where the position/size would keep changing every
time the program opened/closed, was due to the fact that we were not
calling setGeometry to restore the position/size.
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.
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.
This filter allows the ability to use a texture to modify the video
output of a source, the ability to:
- apply a color-based mask (dark = transparent, light = opaque)
- apply a mask based upon the alpha of an image
- blend an image via subtraction, addition, or multiplication
Adds a filter for delaying asynchronous video/audio data, for example
from webcams, video devices, or media playback sources. Mainly intended
to allow users to sync up their webcams to other devices.
Adds a visibility checkbox to the main sources list so that users can
temporarily disable/re-enable sources. Only applies to scene items, not
the sources themselves.
The FocusList subclass of QListWidget emits a GotFocus signal when it
gets focus -- used for the filters window to know when a specific filter
list gets focus.
This is used to allow the user to temporarily disable sources/filters.
For each item in the list box, it displays a visibility checkbox (with
eye icon) that the user can click to disable/re-enable sources or
filters.
I did not end up using the Qt::ItemIsUserCheckable flag with the list
items for a few reasons:
- We could not style the checkbox indicator without qss screwing up
other parts of the list widget style on certain operating systems
- We could not get the icon to properly invert on active selection like
the text does on mac/linux, which made it look strange
- Clicking the checkbox too fast would cause it to signal a double-click
on the icon, opening the properties for a source in the source list
This checkbox gives an 'eye' icon that indicates whether something is
visible or not. The color of the icon is influenced by the current
style's foreground color.
Filtering the video before it's output to the texture means that it
happens after all the processing on the timestamps and such of the video
data. This way, the video filter does not have to worry about what's
currently buffered, and it won't affect timing.
When OBS is shutting down, if for some reason the filter is destroyed
before the parent source is destroyed, it would try to remove itself
from the source, but it would decrement the reference and try to destroy
itself again while already in the process of destroying itself.
So, the solution was simply to make sure that if it's removing itself
from the source that it doesn't decrement its own reference.
The "last" filter that's rendered is technically at filter index 0, so
enumeration needs to be from the last index in the list to the first
index in the list.
When rendering a filter to a texture, the target is empty and unused, so
there's no reason for blending to be on when rendering the filter to a
render target.
obs_source_process_filter tried to do everything in a single function,
but the problem is that effect parameters would not properly be
accounted for due to the way it internally draws, therefore it was
necessary to split the functions in to two, you first call
obs_source_process_filter_begin, then you set your effect parameters,
then you finally call obs_source_process_filter_end. This ensures that
when the filter is drawn, that the effect parameters are set.
When the filter chain finally reaches the source and the last filter in
the chain is set to not render directly (meaning it has to render to
texture), it would not render the source with any effect due to the fact
that it expects a filter to be present.