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.
When adding to the queue, this triggers rowCountChanged which then
calls canClearFinished, reading undefined memory for state if this is
not set. The correct state is set immediately after by checkInputPath.
Detected by UBSan.
When an external display is disconnected with a fullscreen projector
attached to it, Qt will trigger a resize of the window twice, which
makes the renderer queue 2 resize event blocks.
At the time when those blocks are run, Qt's window destructor will have
reset all pointers, and the block directly accesses pointers within
structures identified by pointers, which are invalid by that point.
This commit makes a block return early if the associated window has
been destroyed already and also explicitly checks for valid pointers
after.
Receiving buffers flagged as corrupted, or empty, is a casualty of
how things are implemented in various compositors, and it's not
a critical situation to be afraid of. We can expect a few buffers
to be flagged as corrupted here and there, and that's fine.
Demote these warnings to debug messages, as they're still useful
for debugging.
The crash reporter made with Qt was introduced in 824c7b0, but then was
quickly replaced by a native OS implementation in d42a7ce. This code has
been lying around ever since.
A trivial cosmetic change. This groups the constructor and
destructor together. Two sides of the same coin, yin and yang,
bound by their nature, and linked by their position in code.
This commit introduces an important distinction in the initialization
process that is essential to future camera and audio work: it splits
creating and connecting to the PipeWire socket, from connecting to
specific PipeWire nodes.
Right now, for the only consumer in existence - the ScreenCast portal
code - this distinction is irrelevant, but from an API perspective it
just makes sense to model it this way.
We don't actually need to restore the node id anymore, since this
is handled by the screencast-portal.c code now.
Remove the pipewire_node field, and just create the stream directly
from the passed file descriptor now.
This separation of obs_pipewire_create() and play_pipewire_stream()
was an artifact of how the original code was written, and there is
no reason to keep this separation anymore. Inlining it will help
future commits too.
And let each portal pass the stream properties relevant to them.
This makes the pipewire.c more independent of the actual portal
by providing a wrapper to create a stream. This will be relevant
later, when linux-pipewire introduces more portals like the Camera
one.
When the linux-pipewire plugin is unloaded, make sure to cleanup
the D-Bus proxy for the ScreenCast portal too. This effectively
doesn't change anything, but it's always good to keep up with the
code hygiene.