Similar to how outputs can pass errors, add the same functionality for
encoders so that if an output encoder has an error, it is made available
to the output and eventually the UI / user.
As os_gettime_ns() gets large the current scaling methods, mostly by casting
to uint64_t, may lead to numerical overflows. Sweep the code and use
util_mul_div64() where applicable.
Signed-off-by: Hans Petter Selasky <hps@selasky.org>
On 10.15, if a user activates secure input of some sort, the hotkey code
will begin to crash inside of any Apple function related to hotkeys,
even after secure input has ended. This does not appear to be the fault
of OBS; the reason to this is still as of yet unknown, but is suspected
to be a bug inside of Apple code that's a new regression as of 10.15.
So for the time being as a temporary solution to the crash, simply
disable external hotkey support once secure input has been detected.
Because of this issue, the hotkey code should probably be replaced by a
different method of tracking hotkeys, perhaps InstallEventHandler for
example. This commit is little more than a bandaid to the crash.
The fix for the race condition that was made in 432017b2c also broke
audio lines. This fixes audio lines and moves the fix to just the case
where it actually applied.
Fixes a group id comparison where it was comparing the pointer of the
group name rather than the string contents itself, causing it to treat
it as a non-group source.
Instead of erroring out completely when it can't determine if the
certificate is valid, proceed anyway. This matches how web browsers
treat failed cert revocation checks. schannel just has somewhat
paranoid defaults.
This reverts commit 4da73445c3.
This is being reverted because apparently it causes flickering displays
for some people. Bad drivers or something? Not sure. Very annoying.
The id of the source was being pointer compared rather than string
compared, so naturally with the source versioning system where the
string is duplicated, the pointers no longer matched.
When someone adds a source and the plugin is removed for whatever
reason, it would cause a crash with the new source versioning system.
This fixes that by ensuring the unversioned id is also backed up along
with the normal id.
(This also modifies image-source, obs-text, text-freetype2, and UI)
This improves source definition versioning. To do this, it now stores
two identifier names. One "unversioned" which is the original name, and
one "versioned" with the version number appended.
This fixes both backward compatibility with older OBS versions, and
fixes the inability to use "add existing" in OBS itself on sources
created from older version definitions.
Filters can be hidden without being shown, which can unbalance the ref
count and destroys them prematurely. We really only care about input
sources having a chance to clean up from the render thread from the hide
handler, Windows 10 window capture specifically.
This reverts commit ff22c20019.
This caused a bug in FTL output, which started hitching after this
commit. Presumably due to opus; it's likely you're not supposed to do
this with all audio encoders.
os_readdir might return an empty path if the OS filename doesn't fit
into the buffer after os_wcs_to_utf8. If this empty path is then passed
to os_get_path_extension it causes a crash.
Previously, any short write would be treated elsewhere as a failure. The
easiest solution is to have pipe_write() automatically retry until either
it's written everything, or it couldn't write anything at all.
Complex external systems using the D3D11 device may need to perform
their own device loss handling, the upcoming Windows Graphics Capture
support for example.
A plugin that saves whitespace-only data would crash OBS on startup as
the whitespace stripping would send the string length negative. While
that bug is fixed in this commit, there is also no good reason that OBS
is stripping whitespace to begin with. All data going into the configs
should be well formed and some plugins legitimately wish to save
whitespace as a config option (eg for search / replace characters).
(This commit also modifies libobs)
Hides encoders that are marked as internal. Same general functionality
as DEPRECATED but not actually deprecated, just internal-only.
Returns whether rescaling is enabled for an encoder. This will be used
with texture-based encoders to determine whether to fall back to
RAM-based encoding instead.
`obs_sceneitem_group_add_item` and `obs_Sceneitem_group_remove_item`
were leaving the affected scene in an inconsistent state.
To resolve, simplify and make the code more readable, we replace the
manual linked lists mutation with existing `detach_sceneitem` and
`attach_sceneitem` calls.
Adds API:
obs_scene_add_group2
obs_scene_insert_group2
obs_sceneitem_group_ungroup2
These functions should be used by plugins if they need to use these
functions and need to send a refresh signal. If a major API rework ever
happens the old functions should be removed. The old functions should
eventually be deprecated.
The reason why specifying a 'signal' parameter is useful is because it's
a bit more seamless for the user interface to be able to have custom
handling of these specific cases. It looks better and doesn't require
completely erasing/recreating the entire list, which is visually
unappealing.
Previously the assertion required the idx to be smaller than the number
of elements in the darray. This would mean you could not insert anything
at the end of a darray, and would make it impossible to insert an array
into an empty darray.
SIMDE was introduced for aarch64 support, however, the library itself
supports non-SIMD fallback, which allows us provide support to other
platforms without code changes.
There is another world beyond x86. So we can simply enable SIMDE for
processors without SSE2 support.
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
This allows the ability to do things such as change defaults or
properties of sources without necessarily breaking older user
configurations that had older defaults or properties.
This uses three methods of obtaining the actual windows version,
RtlGetVersion which is the ntdll version of GetVersionEx that bypasses
the manifest check garbage, looking up the file version of a file that
is most likely to be updated per windows version (ntoskrnl), and the
registry. Of the three values, it chooses the highest windows version
obtained by the three.
Closesobsproject/obs-studio#2294
Allows the ability for manual transitioning to smoothly flow
(interpolate) to the intended transition point over a short period of
time rather than simply setting a hard transition point number. Doing
this allows manual transitioning to occur more smoothly, and in a more
visually pleasant way.
Allows the ability to manually specify the transitioning point so the
user can transition at a custom rate, usually done by a device that can
be used as a T-bar
Co-authored-by: Jim <obs.jim@gmail.com>
When obs_properties_remove_by_name is called on any obs_properties_t*,
it corrupts the pointers for first_property and last which end up
pointing at either unallocated memory or randomly into the heap memory.
Neither of these is a good thing, and it usually leads to rapid
unscheduled program behavior, also known as crashing and security
issues.
This fixes the issue by first checking if the pointer stored in
props->last is identical to &cur->next, then checking if we are the
only element (cur is also prev element), and if we are then the pointer
is fixed to point back at props->first_property. Additionally fixes
props->first_property which was never updated either.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.