Currently creating new sources can cause a deadlock:
OBSBasicSourceSelect locks the scene mutex when adding a new source
(required to add invisible sources), and later OBSBasic tries to
lock the graphics mutex (via CreatePropertiesWindow); meanwhile the
graphics thread is holding the graphics mutex and tries to lock each
scene as it renders them, resulting in a (non-obvious from the code)
lock ordering conflict.
Moving the CreatePropertiesWindow call out of the locked scene mutex
restores the previous lock ordering; in addition, the requirement
for keeping sourceSceneRefs for opening that initial properties
window is removed
When an async video source is about to be rendered, the async texture
should be updated before any effect filtering occurs, rather than right
when it's about to render.
Fixes a few bugs:
- If the async texture hadn't drawn for its first time, and the source
has an effect filter, it would never end up rendering the first
frame due to the fact that it would fail on obs-source.c:2434 for the
first filter, causing it to never actually render the source, and thus
never get to a point in which it could call set_async_texture_size to
establish the async texture width/height for the first time.
- Any time the async texture size changed, it would only update the
async texture size at the end of the filter loop, which means that the
first frame after a size change would use the old size for the filters
rather than update to the new size right away.
Passing 0,0 texture size should be considered legal, and safely return
false to indicate that rendering can't begin. Also there's no need to
try to use the current swap chain's width/height if either of the sizes
are 0, there's no need try try to "force" success here anymore.
Adds warnings for graphics functions to ensure that graphics functions
are called within an active graphics context, and add warnings if
required pointer parameters are null.
To prevent confusion with the new obs_source_valid function which
displays a warning, rename the "source_valid" function to "data_valid"
to emphasize that it's checking for the validity of the internal data as
well as the source itself.
API removed:
--------------------
gs_effect_t *obs_get_default_effect(void);
gs_effect_t *obs_get_default_rect_effect(void);
gs_effect_t *obs_get_opaque_effect(void);
gs_effect_t *obs_get_solid_effect(void);
gs_effect_t *obs_get_bicubic_effect(void);
gs_effect_t *obs_get_lanczos_effect(void);
gs_effect_t *obs_get_bilinear_lowres_effect(void);
API added:
--------------------
gs_effect_t *obs_get_base_effect(enum obs_base_effect effect);
Summary:
--------------------
Combines multiple near-identical functions into a single function with
an enum parameter.
(Jim) The documentation for glXChooseFBConfig states that the last value
of the visual attributes array must be 'None'. Fixes potential
initialization issues with certain drivers.
Closesjp9000/obs-studio#486
Use explicit UTF-8 byte sequence for the "no-break space" character.
Prevents issues with certain editors, and fixes the following compiler
warning on Visual C++:
warning C4819: The file contains a character that cannot be represented
in the current code page (X). Save the file in Unicode format to prevent
data loss
Use explicit UTF-8 byte sequence for the "no-break space" character.
Prevents issues with certain editors, and fixes the following compiler
warning on Visual C++:
warning C4819: The file contains a character that cannot be represented
in the current code page (X). Save the file in Unicode format to prevent
data loss
Use explicit UTF-8 byte sequence for the "no-break space" character.
Prevents issues with certain editors, and fixes the following compiler
warning on Visual C++:
warning C4819: The file contains a character that cannot be represented
in the current code page (X). Save the file in Unicode format to prevent
data loss
(Jim) For some reason a character outside of the standard ASCII
character set was used in this source file. "Eight Spoked Asterisk",
Unicode character 0x02733. Non-ASCII characters should probably not be
used directly in source files due to potential character encoding
issues that can occur depending on the operating system and compiler.
Closesjp9000/obs-studio#485
This replaces the name-based detection of the 4K intensity pro, and
allows other devices to be able to use the BGRA pixel format, if the
user so chooses.
It's possible for one signal handler to disconnect another during signal_handler_signal, which could result in crashes when the disconnected signal handler is called with a potentially freed data pointer due to other cleanup.
Another thread could be manipulating the active_log_contexts array while the current thread is trying to read it, resulting in an uninitialized memory crash as the da_push_back call was not protected by the mutex.
Note: This functionality should probably be considered as a temporary
solution. Ideally, sources should not be visible on creation until the
user presses "OK" in the initial properties dialog. Also, the problem
of initial visibility can additionally be solved by implementing the
preview/program functionality. Once preview/program is implemented the
need for this patch will be negated, and the option should probably be
removed.
Closesjp9000/obs-studio#483
Polls for file changes like the text plugin does. This is an interim
solution; both the text plugin and image source should use a file
monitoring API, preferably implemented through libobs.
Closesjp9000/obs-studio#482
In case a system authentication prompt is open the actual error code
(via err_get_code) is kIOReturnExclusiveAccess on OSX 10.9; I'm not
100% sure if this makes the "if (!value)" part of the code obsolete,
but that code path shouldn't be triggered under most circumstances
anyway
Fixes https://obsproject.com/mantis/view.php?id=346
When using a text file with the source and the font face is changed, it
would cause it to fail to update the glyphs and text accordingly. It
would trigger an error jump at line 392 of text-freetype2.c, ultimately
resulting in the text to render garbled after that.
How to reproduce:
Set the source to get text from a file, then just change the font face
(but not the size or anything else).
When updating text from file periodically, newer glyphs that weren't
already cached would not end up being rendered. This fixes the issue by
calling cache_glyphs after the file has been updated.
How to reproduce the original issue:
Set a text-freetype2 source to load an english-only text file. Then
overwrite the text in the file with non-english characters. The
non-english characters will then fail to render.
Reported at https://obsproject.com/mantis/view.php?id=336Closesjp9000/obs-studio#481
Instead of using shell functions to get the windows system directory,
use the kernel32 functions (GetSystemDirectory and
GetSystemWow64Directory). Reduces a bit of unnecessary overhead.
When the crash text is generated, it's generated with LF line endings
only. Pasting the crash text in to notepad will result in garbled text
on windows (due to the fact that notepad still to this day has not been
programmed to understand anything other than CRLF). Instead of using
LF, just use CRLF.