New space availability keys seem to have very specific file system
requirements not documented anywhere. Using the opportunistic free
space key opportunistically (and falling back on the legacy value
otherwise) should always yield a "good-enough" free disk space value.
Transition from using popen() to using fork()/dup2()/execl() to provide
a way to read stderr from ffmpeg.
Co-Authored by: PatTheMav <PatTheMav@users.noreply.github.com>
MSVC noticed inline is not allowed, and new/delete replacments also
don't belong in a header file. We're also just leaning on
__STDCPP_DEFAULT_NEW_ALIGNMENT__ being 16 for MSVC x64 now.
While the NSURLVolumeAvailableCapacityForOpportunisticUsageKey resource
correctly reports available disk space for local volumes (regardless
of actual file system used), it does not report actual values for
attached network drives.
The NSURLVolumeAvailableCapacityKey resource will still report
available disk space as expected, so use this value for non-local
volumes instead.
By default duplicate non-static symbols loaded by dynamic libraries are
de-duplicated by the dynamic library loader. This can lead to issues
with statically linked libraries inside obs plugins if the symbols
share their signature: Whichever plugin is loaded first gets to "set"
the symbol (which can become problematic especially for C++ template
functions).
Using RTLD_LOCAL ensures that all symbols are hidden and can only be
explicitly loaded using dlsym() which avoids this issue.
Unfortunately due to the way scripting works in obs-studio, Python
still needs to be loaded with RTLD_GLOBAL, hence the branch in the fix.
With the lowest deployment target being macOS 11.0, there is no need
to check for the availability of the selectors on the NSProcessInfo
class anymore.
Define PRAGMA_WARN_DEPRECATION for MSVC to enable using that define for
cross-platform code, which allows us to write slightly less code when we
need to suppress this warning.
To avoid passing `struct darray *` type, which cannot hold the type
information of the array element, use defined array types on the
function parameter lists.
Passing DARRAY with an operator such as dereference (`*`) sometimes
caused a compile error. To avoid the error, introduced parentheses
inside the macros.
MinGW comes with it's own intrinsics macros as regular MSVC does.
On MinGW the inclusion of SIMDe would cause multiple definitions
of the same macro names.
Since sse-intrin.h leaks into the public header space this
will cause 3rd party plugins build with MinGW tool-chains emit
redeclaration warnings when including obs-module.h.
In its current form `struct dstr` is used in functions declarations
in the header file before the actual type is included (as `dstr.h` is
included after in `window-helpers.c`.
`clang-cl` is unable to compile this code because the function signature
defined in the header will not match the implementation in the source
code due to the implicit forward-declaration of `struct dstr` before
the type is included in the actual header.
In some cases (ffmpeg_mux), the extension and format values are a
direct passthrough from arbitrary data. Instead of always postfixing
a `.` at the end of a generated path if the extension is invalid,
don't postfix the `.` at all.
Before: `my_formatted_string.`
After: `my_formatted_string`
Use inline assembly for x86_64 speed/accuracy.
Sacrifice speed for accuracy on other processors.
Continue to use original implementation for ARM on Windows.
The macro PRAGMA_WARN_STRINGOP_OVERFLOW was introduced to suppress a
warning -Wstringop-overflow caused by a macro da_push_back_new calling
darray_push_back_new.
Extract the function in the macro to avoid the warning.
This will also enables checking the type check of the returned pointer.