This reverts commit 7bf7c01ff1b45e5e6c295982f89cfae896e94d8d.
The f639d8923 CEF wrapper fails to build on Ubuntu 18.04 due to
outdated glibc, and Jim's recent commits seem to solve the shutdown
assert. For now, revert to the known functional build.
Despite DuplicateOutput deing documented to always return BGRA8, it is
seen fluctuating between BGRA8 and RGBA16F when HDR is enabled.
DuplicateOutput1 seems to provide a stable format whether SDR or HDR.
Also update the texture recreation logic to check for format changes.
Instead of calling App()->quit() directly, which may shut down the event
loop prematurely, invoke it and put it in the event queue so other
events can be processed first.
Again, this may be redundant, but we want to make sure any remaining
events are taken care of before the main window gets completely
destroyed, and before the program shuts down. This should help ensure
that.
Plus it also says you're supposed to do it this way in the documentation
rather than call it correctly so uh... yea. Probably should have done
this sooner.
On destruction of the window, send remaining QEvent::DeferredDelete
events just to ensure there are no lingering actions remaining in the
queue. May cause additional events to be posted, which should be covered
by the final sendPostedEvents call.
(Jim note: I admit this is probably unnecessary, and this may be
redundant, but the reason such redundant precaution is being taken is
because we want to make sure that browser panels in particular are
properly cleaned up. To be quite frank I'm adding this mostly out of
paranoia.)
After stepping into this function with a debugger, it's been determined
that App() won't do anything because it'll marked as a recursive call,
and 'this' will only clear events for this specific object. Instead, we
should be using nullptr to send all posted events for the program.
This fixes an issue where posted events would not be processed on
shutdown as expected before destroying the main window.
On source destroy, the browser source should not wait for other threads
if it's avoidable, as this could cause hard locks. Instead, mark the
source for destruction, destroy any obs/graphics data, and let the CEF
queue delete the what's left of the pointer at its leisure.
Fixes a hard lock on macs due to the browser source destructor having to
wait for the UI thread (due to USE_QT_LOOP), which may already have been
waiting for the source.
(This also modifies the UI)
The purpose of deferring destruction of sources is to ensure that:
1.) Hard locks from enumeration cannot occur with source destruction.
For example, if the browser source is destroyed while in the graphics
thread, the browser thread would wait for the graphics thread, but the
graphics thread would still be waiting for the browser thread, causing
a hard lock.
2.) When destroys occur during source enumeration, that the integrity of
the context's next pointer in the linked list can no longer be
compromised
3.) Source releases are fully asynchronous rather than having the risk
of stalling the calling thread
4.) We can wait for source destruction when switching scene collections
or when shutting down rather than hoping for threads to be finished
with sources.
This introduces a new requirement when cleaning up scene/source data:
the obs_wait_for_destroy_queue() function. It is highly recommended that
this function be called after cleaning up sources. It will return true
if at least one or more sources were destroyed. Otherwise it will return
false. Forks are highly advised to call this function manually on source
cleanup -- preferably in a loop, in conjunction with processing
outstanding OBS signals and UI events.
Causes QObject::deleteLater() events to be processed immediately in
OBSBasic::ClearSceneData() to ensure no lingering source or scene item
references remain
Holds an active reference to a source during signaling of the
`source_remove` signal, to prevent receivers from being given an
already-destroyed source.
- Call obs_source_remove(source)
- Receiver 1 gets signal, calls `obs_source_release(source)`
- Receiver 2 gets signal, calls `obs_source_release(source)`,
refs == -1, source destroyed
- Receiver 3 gets signal, source already destroyed, is forced to ignore
signal due to invalid source
This is a theoretical situation which is currently possible in
obs-websocket.
Updates the filters window to use a QSplitter layout for the properties area.
The handle is disabled for audio filter windows. The handle and property area are hidden when there are no filters.
Users on Wayland are displeased that they cannot see their hotkey
bindings. This enables key reporting like X11, and has the infrastructure
in place in case Wayland ever decides to allow for capturing input.
obs_source_release should not be called while iterating through the
global sources linked list, otherwise the linked list will be
compromised. Annoying.
Basically the same fix as obsproject/obs-studio#5600, but should be
slightly more optimal and a bit more explicit.
Fixes an issue pointed out in obsproject/obs-browser#333 where a source
may destroy the next source in obs_source_video_tick(), thus
invalidating the next source in the linked list. Get the next source in
the list *after* calling obs_source_video_tick() rather than before.
Closesobsproject/obs-studio#5600
We'll soon be moving to branching before releases, which
is a case that the current Flatpak worflow did not account
for.
Adapt it to also run on release/** branches.
This commit ensures that we set the appropriate draw buffer when making
a context current. Mesa drivers enforce opengl ES semantics where the
targets passed to eglMakeCurrent are bound, but nvidia instead ignores
these parameters after the 1st eglMakeCurrent. In obs we make current
with EGL_NO_SURFACE so our draw targets end up as EGL_NONE on nvidia
and previews fail to render.
This also allows us to fail back ignoring NATIVE_RENDERABLE
requirements. Nvidia driver does not report support for this attribute
on any context and after resolving the draw target issues previews
render correctly on nvidia and intel drivers.