This fixes an issue where local files were using the avformat interrupt
callback, which is only supposed to be use to prevent blocking on
network calls.
The interrupt callback is designed to prevent the media source from
blocking; FFmpeg will internally call it periodically to prevent FFmpeg
function calls from blocking too long, and allow the caller to determine
whether blocking should stop.
The problem with this however is that AVERROR_EXIT causes the thread to
completely exit. This fixes it so that it treats it as an EOF rather
than as an abnormal error.
The current scripting directory path given to Python on OSX is
`../data/obs-scripting`. This works when bin/ and data/ are in the same
folder like rundir after a compile and in the old .app bundles but the
new normal .app bundle structure is different.
For bundles move obspython.py and _obspython.so to the binary folder,
just like the Lua one, and pass that bin path to the Python interpreter
so it can find it.
The current working dir isn't guaranteed to be set with .app bundles
so look up binary path at runtime.
_obspython.so currently links directly against python as @rpath/Python
and has 3 common python install paths set as rpaths so it would only
work if a user had python installed at one of those hardcoded paths.
Don't link _obspython against python at all but instead link it with
"-undefined dynamic_lookup" so when it is imported by python all it's
undefined python symbols get resolved at runtime against the user
supplied python instance loaded into the process earlier.
The rpaths aren't needed anymore this way.
The libpython .dylib files on MacOS are in the python_path/lib
subdir. The user supplied python_path still needs to be to the actual
python root and not lib/ as the root path get's used as python home dir
so just add lib/ when loading the dylib.
Cuda appears to be a bit buggy and can result in corruption where as
it's not being seen with other hardware decoders. Remove cuda for now
as a hardware decoder to prevent the possibility of corruption.
Fixes a bug where hardware frames would not transfer to RAM for the last
few frames of a video. The 'ret' variable can be 0 even though there
are still frames ready.
The hardware accelerated decoder context needs to be explicitly unrefed
when it's no longer in use, otherwise it and many resources associated
with it will leak.
When hardware accelerated decoding is enabled, sometimes it can't
initialize for whatever reason, so it will fall back to software on its
own. When this occurs, it will not use the hardware pixel format on the
frame; instead it will defer to a standard format on the frame. So if
the frame format does not match the expected format, assume software
decoding. (This was also what the hw-decode.c FFmpeg example did if the
format did not match the expected format)
I40A -> RGBA, 1080p, CPU
swscale (MMX), Intel i7-6700: 1910 us -> 0 us
GPU measurements used Intel GPA with SetStablePowerState.
I40A -> RGBA, 1080p, GPU
Intel HD Graphics 530: 0 us -> 677 us
NVIDIA RTX 2080 Ti: 0 us -> 43 us
Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed. Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
Makes Visual C runtime libraries consistent across
Debug/MinSizeRel/Release/RelWithDebInfo, rather than just changing those
flags for RelWithDebInfo. Also adds /Zl for statically linked
libraries.
Closesobsproject/obs-studio#1421
obs-scripting CMakeList.txt expects SWIG, Python3 or Luajit to enable
scripting so in case of not finding just return and don't abort
the configuration
This adds build-time options for disabling the Lua and/or Python
scripting support in cases where users do not wish to build
it, but have the required libraries installed.