Existing code made use of macros which broke parsing in Xcode and
complicated debugging as crucial code was executed within macros and
not actual source code.
Use of mutable CoreFramework data structures (which were never mutated)
is replaced by use of faster non-mutable variants.
When an allocator needs to be used, `kCFAllocatorDefault` is specified
explicitly.
VideoToolbox session properties are also set in bulk instead of
multiple consecutive calls.
Also simplifies detection of Apple Silicon hosts to make code more
readable.
The sliderMoved signal doesn't trigger when clicking on the slider, only
the valueChanged signal. According to QTBUG-72995 this is intentional,
since the documentation states that sliderDown also needs to be true for
the sliderMoved signal to be triggered. As for why sliderDown isn't true
when clicking, or why that would even be necessary for a signal that
should trigger when the slider is moved (and it very clearly moves)
remains a mystery.
Also gets rid of the wrong usage of the on_foo_bar slot declaration,
which should only be used for signals where the sender is part of a UI
file and it gets connected automatically. While it of course is possible
to connect it manually, this is against convention and can cause
confusion. In this case it was particularly wrong since even if tBar was
part of a UI file (which it isn't), the method should have been called
on_tBar_valueChanged instead of on_tbar_position_valueChanged.
These widgets are all children of updateSettingsGroupBox, meaning they
get deleted when updateSettingsGroupBox gets deleted. This means that
the first two calls are unnecessary and the third one segfaults as
updateChannelLabel is gone already.
Just delete the parent widget instead.
Before calling the button callback, two values are null-checked but when
the property is created with an id (const char*). Those values are null
which prevent the callback from being called.
CMake build framework 3.0 introduces more strict typing checks, which
require additional code fixes to silence.
* Fixes warnings about implicit casts
* Fixes warnings about weak references used multiple times inside
blocks
When bitrate is updated, a check against 'lookahead' setting is done.
If 'lookahead' is enabled, the bitrate update is disabled.
We indeed used to observe crashes with nvenc when frequent bitrate
resettings were effected while lookahead option was enabled.
But recent tests have shown that the issue is gone.
As a result this commit allows 'lookahead' with bitrate live update.
Signed-off-by: pkv <pkv@obsproject.com>
FFmpeg wipes priv_data if the encoder fails to start, so we need some
way of knowing if the GPU index was non-zero. This is a bit ugly but the
best way to do it for now.
This writes the result of nvEncGetLastErrorString to the last encoder
error instead of just the log file. This makes it user-visible, which
should help users diagnose and solve the problem.
Also strips off leading colons from NVENC error strings as these can
look odd given our format string. An example of such an error:
::NV_ENC_TWO_PASS_FULL_RESOLUTION is only supported multipass encoding
on this architecture.