0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
Commit Graph

10416 Commits

Author SHA1 Message Date
jp9000
6a72cd64e7 obs-outputs: Add support for reading RTMP packets
Instead of ignoring RTMP packets, allow the ability to read incoming
RTMP packets
2021-12-21 09:44:21 -08:00
Matt Gajownik
adff02a6b7 Revert "CI: Update CEF hash for Flatpak to fix crash"
This reverts commit 7bf7c01ff1.

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.
2021-12-21 22:14:54 +11:00
jpark37
e77421a805 libobs-d3d11: DuplicateOutput1 for DXGI capture
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.
2021-12-21 02:38:42 -08:00
jp9000
1dbc6c177a UI: Invoke QCoreApplication::quit in queued connection
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.
2021-12-21 01:49:47 -08:00
jp9000
8bff191b32 UI: Use sendPostedEvents with deleteLater events on destroy
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.)
2021-12-21 01:48:58 -08:00
jp9000
fb58e58892 UI: Use null with sendPostedEvents()
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.
2021-12-21 01:41:19 -08:00
jp9000
1604a8d362 obs-browser: Do not wait for browser on source destroy
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.
2021-12-21 01:33:18 -08:00
jp9000
51050b3075 Revert "mac-capture: Improve window capture performance"
This reverts commit 257715d31f.

Was merged prematurely by mistake (clicked the merge button on the wrong
tab).
2021-12-20 14:02:58 -08:00
jw0z96
447b17e75e libobs: Implement additional source blending modes 2021-12-20 09:06:38 -08:00
jw0z96
33a6d2a5fd libobs: Expose blending operation types 2021-12-20 09:06:38 -08:00
Dossy Shiobara
257715d31f mac-capture: Improve window capture performance 2021-12-20 09:05:36 -08:00
Matt Gajownik
7bf7c01ff1 CI: Update CEF hash for Flatpak to fix crash
This fixes a crash/assert on shutdown caused by Chromium debug mode.
2021-12-20 21:58:27 +11:00
jp9000
8b3416c1e7 libobs: Implement deferred destruction of sources
(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.
2021-12-19 11:53:19 -08:00
jp9000
ab84214356 libobs: Add obs_in_task_thread() function
Allows determining which thread the caller is currently in, if any
2021-12-19 11:53:19 -08:00
jp9000
cf492ca271 libobs: Add ability to queue audio task
This is mostly framework for allowing the ability to wait for certain
threads
2021-12-19 11:53:14 -08:00
jp9000
e4f0c21252 UI: Process deleteLater() tasks in OBSBasic::ClearSceneData
Causes QObject::deleteLater() events to be processed immediately in
OBSBasic::ClearSceneData() to ensure no lingering source or scene item
references remain
2021-12-19 11:25:57 -08:00
jp9000
5a36bd5c9a libobs/util: Add task queue helper
Adds a cool little task queue thing so a dedicated task thread can be
spawned
2021-12-19 11:25:57 -08:00
jp9000
408ce92146 Revert "libobs: Do not release while traversing sources for tick"
This reverts commit 080090c40e.
2021-12-19 11:25:57 -08:00
tt2468
d07bd7dff2 libobs: Hold source ref during source_remove signal
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.
2021-12-19 11:25:43 -08:00
PatTheMav
0072629ceb CI: Fix build issues introduced by updates obs-deps 2021-12-19 10:47:40 -06:00
Matt Gajownik
96ee97e997 obs-vst: Avoid using empty editorWidget for deleteLater() 2021-12-19 10:55:59 +11:00
hellowanda
a01a01f752 win-virtualcam: Make sure virtualcam output thread safe 2021-12-18 07:14:47 -08:00
tt2468
647fb1376d libobs: Add preprocessor directive for AutoRelease types
Since these helpers come from obs-websocket, obs-websocket needs a way
to disable its own helpers if OBS is new enough to include them
already.
2021-12-18 16:42:51 +11:00
Matt Gajownik
e35b8d5888 CI: Update Windows CEF version to 4638 (Chromium 95) 2021-12-17 12:24:01 -08:00
Matt Gajownik
9c12a9ac98 CI: Update Linux CEF version to 4638 (Chromium 95) 2021-12-17 12:24:01 -08:00
Matt Gajownik
0c26becd80 CI: Update macOS CEF version to 4638 (Chromium 95) 2021-12-17 12:24:01 -08:00
Warchamp7
f5947d9b9b UI: Update the filters window to be resizeable
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.
2021-12-17 06:52:35 -08:00
Mike
02f3495b72 UI: Add checks for overwrite setting to replay buffer 2021-12-17 06:49:44 -08:00
liu.haibin
1883b774e8 obs-outputs: Reset dbr bitrate before end_data_capture_thread start 2021-12-17 04:31:16 -08:00
gxalpha
d121c92fbb UI: Add undo/redo for "Add existing source"
Adds an undo/redo action for the "Add existing source", which previously
was missing.
2021-12-17 04:30:36 -08:00
Tommy Vercetti
c83b758f4d UI: Remove Qt Windows Extras for Qt 6 and later
Co-Authored-By: Matt Gajownik <matt@wizardcm.com>
2021-12-17 01:35:40 -08:00
Jim
91a9688d9f
Merge pull request #5501 from RytoEX/fix-ffmpeg-deprecations
Fix FFmpeg deprecations up to FFmpeg 4.4 and current FFmpeg git
2021-12-17 01:16:35 -08:00
Translation Updater
062de2c998 Update translations from Crowdin 2021-12-17 08:01:29 +00:00
wangshaohui
81d70b5d1b win-capture: Should not init module if HWND is invisible 2021-12-16 23:39:55 -08:00
wangshaohui
90f11b3eae UI: Fix a stack overlow caused by using OBSScene 2021-12-16 23:38:59 -08:00
Kurt Kartaltepe
0729007f19 libobs: Add Wayland hotkey infrastructure
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.
2021-12-16 10:54:29 -03:00
Kurt Kartaltepe
21fdd83b7e libobs: Fix Numpad Minus naming in UI
OBS_KEY_NUMMINUS was not included in the key to string function so it
was reported as a regular minus.
2021-12-16 10:54:29 -03:00
jp9000
080090c40e libobs: Do not release while traversing sources for tick
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.
2021-12-15 11:57:52 -08:00
Matt Gajownik
24faaf085d CI: Update Crowdin Sync workflow to 0.1.2
See https://github.com/obsproject/crowdin-synchronization/pull/7
2021-12-15 22:09:53 +11:00
jp9000
b2c09d3523 libobs: Fix potentially unsafe linked list traversal
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.

Closes obsproject/obs-studio#5600
2021-12-14 10:34:53 -08:00
jp9000
1f20e0ca93 obs-browser: Fix deadlock 2021-12-14 10:34:53 -08:00
Jim
83f08725e4
Merge pull request #5580 from VodBox/add-cpp-templates
libobs: Add AutoRelease OBSRef wrappers for OBS types
2021-12-13 21:31:27 -08:00
Richard Stanway
ea1ae59149 UI: More user-friendly error when using a bad output path 2021-12-13 22:32:09 +01:00
Georges Basile Stavracas Neto
b0e82b9233 CI: Run Flatpak jobs on release branches too
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.
2021-12-13 09:16:28 -08:00
Kurt Kartaltepe
5daf3b1ad1 libobs-opengl: Ensure proper draw buffer
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.
2021-12-13 11:37:28 -03:00
Translation Updater
261345f9ef Update translations from Crowdin 2021-12-12 02:38:59 +00:00
Matt Gajownik
d1478271a4 obs-browser: Fix build issues on Qt 5.9 (Ubuntu 18.04) 2021-12-12 11:56:34 +11:00
Matt Gajownik
1483aa9f7d obs-browser: Update version to 2.17.1
New features:
 - Expose Scene controls to sources
 - Pass on JS function arguments to BrowserClient
 - Add Browser Source Refresh Hotkey
 - Render JavaScript dialogs using Qt
 - Improve performance of CEF 4638 browser sources
 - Set window title for web popups using X11
 - Add TypeScript definitions information

Bug fixes/cleanup:
 - Don't call WasHidden on browser panels
 - Use mutex when accessing BrowserSource::cefBrowser
 - Correct JSDoc definitions
 - Remove old CEF ifdefs
2021-12-12 11:40:29 +11:00
Matt Gajownik
748279bd86 obs-vst: Update submodule with a variety of bugfixes
- Cleanup EditorWidget.h
 - Modify log in obs-vst, fix compile error
 - Update effect name even effect is unavailable
 - Fix crash caused by unsupported interface
 - Use deleteLater on editorWidget to prevent crash
 - Check result after creating vst plugin
 - Fix button states on properties refresh
 - Replace QMacCocoaViewContainer with QWidget::createWindowContainer
 - Modify incorrect code about mallocing memory
2021-12-12 11:37:46 +11:00
Matt Gajownik
9c01b1ecc8 libdshowcapture: Add FindPin, RGB24, & use CMake instead of pragma
This updates the libdshowcapture submodule to the latest commit.
This also changes win-dshow CMakeList to ensure compatibility.

Full commit list:
 - Add support of RGB24 format
 - CMake: Add Win32 libs instead of pragma directives.
 - Implement FindPin
 - Simplify error handling
 - Fix log level of DebugHR
 - Use default constructor instead of empty function
 - Use std::move instead of copy where appropriate
 - Mark some strings as const
2021-12-12 11:35:48 +11:00