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

2438 Commits

Author SHA1 Message Date
tt2468
529a412840 libobs: Block sceneitem create if item source is removed
There are some cases where an item may attempt to be created for a
removed source.

Previously, items created from removed sources would lead to the item
itself being saved, but the underlying source not being saved. While
this does not break OBS immediately, it means that the source along
with all associated items will disappear on OBS reload.

This prevents the item from being created in the first place, reducing
the chances of user work being lost.
2021-09-13 01:37:51 -07:00
jpark37
f20a7c0540 libobs: Remove dependency on psapi.lib 2021-09-12 14:10:36 -07:00
jp9000
b2839c3ec3 libobs: Actually fix ungroup deadlock
66c27c2cea (#4664) was mistakenly merged. It was also the incorrect
way to fix the deadlock. Because duplicate_item_data() already defers
the texture creation process, we can just add a param to
obs_scene_add_internal() which allows us to exclude the creation of the
item texture for this specific case. The texture will then automatically
be created later before it's used. There was no reason to be creating
the texture there, as it was unnecessary.

Properly fixes obsproject/obs-studio#3166
2021-09-11 22:00:08 -07:00
jp9000
551eff0c26 Revert "libobs: Avoid request graphics lock after full_lock(scene)."
This reverts commit 66c27c2cea.
2021-09-11 21:07:43 -07:00
Tommy Vercetti
aed2211dcd libobs: Restrict emmintrin.h to x86(_64) platform
There is a new toolchain called ARM64EC on MSVC which allows linking x64 objects to ARM64 objects.

It defines multiple architecture preprocessor definition including but not limited to `_M_X64`, `_M_ARM64` and `_M_ARM64EC`.

The original implementation will fail if compiling to ARM64EC.
2021-09-11 15:52:47 -07:00
Tommy Vercetti
e1cf7c0e4b libobs: Fix near and far redefinition on MSVC 2021-09-11 15:50:06 -07:00
Tommy Vercetti
1f4c6fd154 libobs: Fix connect() redefinition on MSVC 2021-09-11 15:50:06 -07:00
wangshaohui
66c27c2cea libobs: Avoid request graphics lock after full_lock(scene).
As logic in video render thread, gs lock (obs_enter_graphics) should be requested before full_lock(scene).
However in function obs_sceneitem_group_ungroup called from UI thread, the order for requesting locks are contrary.
2021-09-11 15:49:25 -07:00
Kurt Kartaltepe
b47e4858b8 libobs: Add profiler section for send_packet
This makes it a bit more clear when muxing takes longer than expected
instead of attributing the time to the do_encode.
2021-09-11 15:33:02 -07:00
jpark37
aa342ab6fc libobs/util: Const-correct win_version_compare 2021-09-10 20:19:24 -07:00
jpark37
920a160600 libobs: FIx missing noexcept warnings
warning C26439: This kind of function may not throw. Declare it
'noexcept' (f.6).
2021-09-05 20:35:46 -07:00
jpark37
f5b65ec5d3 libobs/graphics: Fix gs_generalize_format warning
warning C26819: Unannotated fallthrough between switch labels (es.78).
2021-09-05 20:35:46 -07:00
jpark37
1eb20ad5aa libobs/util: Improve SetThreadDescription usage
Fix warning about potential passing of NULL to FreeLibrary, and switch
from Kernel32.dll to KernelBase.dll based on MS documentation.
2021-08-30 22:33:17 -07:00
Jim
9b6cc99828
Merge pull request #5180 from jpark37/leaks
Fix a bunch of pthread leaks
2021-08-27 22:55:58 -07:00
tt2468
3e4c275efc libobs/util: Remove old ifdefs
These defs inadvertently redefinine `std::strtoll` in C++ code
that includes the header, causing lots of problems. They only
serve to provide compatability with very old MSVC versions.
As such, they can just be removed entirely.
2021-08-27 08:12:53 -07:00
jpark37
0d282c0715 libobs: Add missing util.hpp to CMakeLists.txt 2021-08-23 23:15:15 -07:00
jpark37
353868e87c libobs: Fix pthread mutex leaks 2021-08-23 22:57:10 -07:00
jpark37
8a43c55918 libobs/util: Fix pthread mutex leaks 2021-08-23 22:57:10 -07:00
jpark37
0c208f1e62 libobs/media-io: Fix leaks and error handling 2021-08-23 22:57:07 -07:00
jpark37
8075e8bb65 libobs/callback: Fix pthread mutex leaks 2021-08-23 22:31:00 -07:00
jpark37
b9657f6239 libobs/util: pthread_mutex_init_recursive helper
Add helper for creating a recursive mutex because it's easy to forget to
destroy the pthread_mutexattr_t.
2021-08-23 22:09:08 -07:00
Richard Stanway
4772a99e3e libobs: Defer reconfiguring encoders to the encode threads
Fixes a long-standing issue with Dynamic Bitrate where the RTMP output
thread could try to reconfigure an encoder while the encoder is in the
middle of encoding. x264 seems to handle multithreaded calls well, but
NVENC would deadlock in this situation with no error visible to the
user.
2021-08-23 18:26:37 -07:00
Ryan Foster
ea9c75bacb cmake: Remove local files for checking threading support
These local copies of CheckForPthreads.c and FindThreads.cmake override
the ones included with CMake. These versions create CMake::Threads, but
Qt6 expects Threads::Threads created by CMake 3.1+. These local versions
seem to be based on old copies from CMake from late 2014 with some
customizations. Let's just use the built-in ones that CMake ships.

This commit also changes CMakeLists.txt files in UI and libobs to
require and link to Threads::Threads.

Co-authored-by: Kurt Kartaltepe <kkartaltepe@gmail.com>
2021-08-17 02:46:09 -07:00
jpark37
96c1a76523 libobs: Avoid recycling async frames
Fixes major cause of lock contention when using lots of media sources.
2021-08-15 00:12:14 -07:00
jpark37
e6ab8106aa libobs/graphics: Avoid darray recycle
Reset size instead of capacity.
2021-08-15 00:12:14 -07:00
Norihiro Kamae
bdb8f3f27b libobs/util: Fix reading memory usage on Linux
Memory usage displayed on Stats was too small due to a misaligned unit
of `resident_size` read from `statm` file and libobs.
2021-08-09 11:42:34 -07:00
Norihiro Kamae
7b4ae8611c libobs: Fix da_push_back taking a wrong type of item
Since the darray `sys_include_dirs` is an array of `char *`, it is
required to take a pointer to `char *`, that is `char **`. However,
`char *` was passed.
Since this function never called, another fix is removing entire
function `cf_preprocessor_add_sys_include_dir`.
2021-07-31 15:29:26 -07:00
Richard Stanway
3dbfa4919a libobs: Add stop_audio function, change shutdown order
This fixes a crash that could occur during freeing of sources, as the
audio subsystem was destroyed before sources were released. If a source
had monitoring enabled, it would try to lock a mutex that has been
destroyed, resulting in a crash.

Freeing audio after obs_free_data was also not a solution, as the main
view is freed in obs_free_data, and the audio subsystem is still running
and trying to lock the main view channel mutex which has been freed.

This seems to be the best middle ground, making sure the audio subsystem
is stopped so it no longer tries to access the main view channel, then
freed after obs_free_data.

Fixes https://github.com/obsproject/obs-studio/issues/4409
2021-07-24 22:34:44 +02:00
jpark37
8440a53da3 libobs: Round up chroma sizes for odd resolutions
When playing video, OBS can overflow and crash, or render video edges
incorrectly if the video resolution does not divide into 2 for trivial
chroma subsampling. This is fixed by rounding chroma plane sizes up
instead of down, and maintaining that through the video pipeline.
2021-07-23 12:02:06 -07:00
liu.haibin
d6c77964c0 libobs: Fix stack buffer overflow in build_current_order_info 2021-07-20 08:46:53 -07:00
Georges Basile Stavracas Neto
99559aab5a libobs: Add portal inhibitor
XDG Portals provide a plethora of features meant to be used inside and
outside sandboxed environments. OBS Studio currently uses portals to
implement Wayland-compatible monitor and window captures.

However, OBS Studio performs another action that can be done through
portals: inhibit the screensaver. Under the Desktop portal (the same
used by the captures mentioned above), there is an "Inhibit" portal
that provides session inhibition.

Add a new portal-based inhibitor. This inhibitor is only used when the
Desktop portal is available and running; the previous D-Bus implementation
is used in the absence of the portal. Because it's basically another set
of D-Bus operations, wrap the new portal inhibitor under the HAVE_DBUS
call too.
2021-07-18 14:04:44 -07:00
jpark37
7c72fd1d4c libobs: Plumb texcoord hint to reduce GPU cost
In order to do linear-correct filtering cheaply when scale filtering is
disabled, we need to know whether or not texture coordinates will always
sample from texel centers. This can be computed at the scene item level
relatively easily, and passed along to sources when rendering. Scene
items will use obs_source_set_texcoords_centered to set hint status, and
sources will use obs_source_get_texcoords_centered to retrieve it.
2021-07-11 08:26:29 -07:00
jpark37
da3375d5a4 libobs: Add gs_generalize_format helper 2021-07-11 08:26:29 -07:00
jpark37
c9766d8e28 libobs: Add DrawSrgbDecompress default technique
Useful when the texture does not support SRGB conversion on load.
2021-07-11 08:26:05 -07:00
jpark37
05b507d900 libobs: DrawSrgbDecompressPremultiplied technique
Necessary for an upcoming fix to browser source.
2021-07-11 08:11:12 -07:00
tt2468
53a8a326da libobs: Add obs_enum_all_sources()
There is currently no way to enumerate *all* sources in OBS. Only
inputs and scenes have a way to be enumerated. Some applications
like obs-websocket have features that need to take advantage
of enumerating all sources in order to function properly.
2021-07-09 17:33:17 +12:00
Matt Gajownik
74c3781554 libobs, UI: Add support for button properties as links
This adds support for a button property that opens a URL, after showing
a confirmation dialog to the user. Both the Type and URL must be set.
2021-07-09 17:32:09 +12:00
Georges Basile Stavracas Neto
712478f48c libobs/nix: List Flatpak search paths
The proposed way to handle plugin distribution
through Flatpak depends on these directories to
be read. It goes as follows:

 1. Flatpak's extension point merges the 'lib'
    and 'share' directories at /app/plugin

 2. Plugins prefix their install paths in the
    Flatpak manifest to /app/plugins/<plugin name>

 3. OBS Studio lists /app/plugin as one of the
    search paths in OBS Studio code

This commit implements the third step of this
process, which is the only one that actually
involves OBS Studio itself.

With that, it is possible to distribute plugins
as Flatpak extensions, which in turn allows them
to be listed at app stores such as GNOME Software,
elementary's app store, and KDE's Discover.

Related: https://github.com/flathub/com.obsproject.Studio/issues/135
2021-07-08 10:53:15 -07:00
jpark37
b94fbac7ef libobs: Fix warnings
Cast away truncation, and widen type before multiplication.
2021-07-06 14:08:28 -07:00
jpark37
b70161bc67 libobs: Add DrawOpaque for rect effect
Needed by Syphon Client.
2021-07-04 10:35:54 -07:00
Norihiro Kamae
5e44e6412a libobs: Fix memory overrun if libobs version mismatches
When size of source_info_t is larger then current structure, memcpy
overruns. Size check is moved before the memcpy.

HANDLE_ERROR macro copies info to data but data is not used. When
calling free_type_data and type_data, the member of data should be used
to ensure the free_type_data is not out of bounds.
2021-07-04 08:49:42 -07:00
Exeldro
93205e5729 libobs/callback: Fix signal_handler_disconnect_global 2021-07-04 04:32:45 -07:00
jpark37
c021338ceb libobs,deps/media-playback: Avoid bitfields
Use unused padding of obs_source_frame/obs_source_frame2 instead.
2021-06-11 07:02:37 -07:00
jp9000
3887c09066 libobs: Update version to 27.0.1 2021-06-10 08:50:41 -07:00
jpark37
1fa152092c libobs: Plumb linear alpha flag
Use union for backwards compatibility.
2021-06-04 19:04:08 -07:00
jpark37
c6937eb559 libobs: Assume sRGB instead of linear for 64 bpp
Should fix regression for 16-bit PNGs.
2021-06-01 19:08:07 -07:00
jpark37
35c07bb7e6 libobs: Restrict direct filtering to SRGB match
Fixes issue where color-correction filter v1 changes from v26 to v27.
2021-05-31 12:33:55 -07:00
jp9000
0ca465c683 libobs: Update version to 27.0.0 2021-05-30 11:54:46 -07:00
jpark37
8cf28ceafd libobs: Straight alpha blend for filtered inputs
This is necessary if the source contains overlapping draws.
2021-05-22 05:48:26 -07:00
jp9000
6b2c3f4845 libobs: Add obs_group_or_scene_from_source()
Makes it a little bit easier to get a scene from either a source or
group.
2021-05-17 16:34:09 -07:00
jpark37
df30e3aca6 libobs: Add srgb.h to CMakeLists.txt 2021-05-13 18:31:18 -07:00
jpark37
a8f0a27a3a libobs: Remove DrawAlphaBlend technique 2021-05-11 13:12:39 -07:00
jpark37
abe1cb1425 libobs: Support premultiplying images on load
Add gs_image_alpha_mode enum for requested alpha handling: straight,
premultiplied with SRGB conversion, and just premultiplied. Both
premultiplied settings behave the same if the image is not SRGB, linear
is assumed.

Add gs_image_file3_t to store the alpha mode.

Add srgb.h file with helper functions.

Clean up vec4.h to use helpers, and remove unused functionality.

Update FFmpeg image loader to perform premultiplication on load.
2021-05-11 03:44:02 -07:00
jpark37
c1948c16b0 libobs: Fix direct rendering test
Pass test if the filter wants SRGB, and the source supports SRGB.
2021-05-11 03:08:49 -07:00
jpark37
83cb43f166 libobs: Mark unused parameters 2021-05-08 14:12:54 -07:00
jpark37
ef72eb70ec libobs: Fix uninitialized variable warning 2021-05-08 14:12:54 -07:00
Exeldro
8810e7ae98 libobs: Fix deadlock removing scene item 2021-05-08 00:32:03 -07:00
jpark37
5a8842d9f0 libobs: Support 64 bpp images
Useful for loading high-precision alpha channels.
2021-05-05 09:43:34 -07:00
jpark37
de7cec3dee libobs: Add DrawAlphaBlend technique
Useful when fixed-function blend does not provide enough precision.
2021-05-05 09:43:34 -07:00
jpark37
ae7718a765 libobs, obs-filters: SRGB backwards compatibility
Add OBS_SOURCE_SRGB to indicate sources that support SRGB rendering. We
can use this flag to know which sources do not know how to handle SRGB,
and disable accordingly inside obs_source_main_render().

We can also use this flag to clean up the filter interface and remove
the SRGB-specific functions. We also need to disable direct rendering if
the filter source wants to render SRGB, but the parent source does not
support it.

Scenes and groups are marked as having SRGB support, and those are
internal sources that we control.
2021-05-03 01:19:56 -07:00
jp9000
60447872c0 libobs: Add obs_source_reset_settings()
Allows the ability to reset (erase) a source's existing settings and
replace them with new settings. This is useful for things such as
reverting to older settings.
2021-04-30 18:37:38 -07:00
jp9000
0fd1238d45 libobs: Add functions to backup/restore filters
Adds functions to backup and restore filters (along with their order) on
a specified source. Useful for undo/redo operations.
2021-04-30 00:11:52 -07:00
jpark37
a44e09f2e4 libobs: Don't force premultiplied alpha on filters
Many filters need to remultiply alpha on output.
2021-04-28 18:09:52 -07:00
Jim
81e9ad818f
Merge pull request #4587 from jpark37/alpha-hack
Apply alpha in nonlinear space for images and async video
2021-04-25 11:26:21 -07:00
tt2468
cb6a381823 libobs: Fix crash in missingfiles when source is invalid 2021-04-25 09:36:50 -07:00
jpark37
aed52412d4 libobs: Render async video with DrawNonlinearAlpha
Match previous OBS alpha behavior.

DrawNonlinearAlpha requires premultiplied alpha blend state.
2021-04-25 02:13:01 -07:00
jpark37
50dfa566e6 libobs: Filter using premultiplied alpha
Convert incoming straight alpha color to premultiplied at filter begin,
and process premultiplied value at filter end.

If direct rendering is allowed, we assume the input source outputs
premultiiplied alpha. If not, that source will need to be updated.
2021-04-25 01:27:19 -07:00
jpark37
840e2b3d43 libobs: Add DrawNonlinearAlpha technique
This allows OBS to mimic other programs that incorrectly use alpha.

Requires premultiplied blend state.
2021-04-24 17:18:42 -07:00
jp9000
74c2379eba libobs: Add obs_data_get_last_json()
Helper function to return the last generated json string for this
object.
2021-04-23 12:38:50 -07:00
jp9000
09ffab6f90 libobs: Add helper func to find a scene by name 2021-04-16 20:28:14 -07:00
jp9000
0dc1e01b5b libobs: Save obs_data json in compact form 2021-04-16 19:09:55 -07:00
tt2468
7b2b723270 libobs: Return target vec not current when within EPSILON
If current vector is within EPSILON, it would return the current,
when logically the target should be returned instead.
2021-04-13 05:31:00 -07:00
Exeldro
b9a2fe7851 libobs: Add transition save/load functions
Moves the transition saving/loading to functions, and refactors existing
code to use those functions instead.
2021-04-11 10:10:54 -07:00
Ford Smith
2932cd0fd3 UI: Fix wrong behavior with undo/redo and groups 2021-04-10 11:28:04 -07:00
jp9000
d332a8ea76 libobs: Add obs_source_is_scene() 2021-04-09 04:30:30 -07:00
jp9000
33c5563c1e libobs: Add obs_obj_is_private()
Returns true if an obs object is considered private. (Author's note: the
concept of "private" objects is not ideal, but we're stuck with it for
now)
2021-04-09 04:30:30 -07:00
jp9000
ca08df9fb2 libobs: Add obs_source_load2()
Allows loading a source and all of its filters automatically.
Previously, the original obs_source_load would not load filters.
2021-04-09 04:30:29 -07:00
jp9000
0ecf24d0ed libobs: Add obs_source_enum_full_tree()
Allows the ability to enumerate all sources and subsources in a source's
hierarchy, regardless of whether they're active or not.
2021-04-09 04:30:29 -07:00
jpark37
9220316700 libobs: Add filter functions for SRGB support
This way, legacy filters can use the original functions without
triggering SRGB support.
2021-04-04 00:58:38 -07:00
Richard Stanway
6078dfef76 libobs: Don't save temporarily removed sources
The only references to these sources exist in the undo buffer, they are
not attached to a scene and cause issues when loaded on the next
startup.
2021-04-04 00:09:17 +02:00
Richard Stanway
cdbb216bd0 libobs: Remove unnecessary null check 2021-04-03 00:31:07 +02:00
jpark37
62bc8f905a libobs: obs-scene type fixes
Replace "rot" int usages with double.

Add explicit narrowing casts to fix warnings.
2021-03-31 06:07:11 -07:00
jpark37
0a121b6d22 flibobs: Fix unnecessary truncation 2021-03-31 06:07:11 -07:00
jpark37
3c09074ed5 libobs/util: Skip pointless free for null 2021-03-31 06:07:11 -07:00
jpark37
d5e265d7dd libobs/util: Fix warnings for about null usages 2021-03-31 06:07:11 -07:00
Exeldro
edc439b0a5 libobs: fix property group check 2021-03-30 03:44:23 -07:00
Jim
e92c1fe6bc
Merge pull request #4287 from GeorgesStavracas/gbsneto/pipewire
Wayland / PipeWire capture
2021-03-30 03:16:46 -07:00
Jim
5d87f3c00b
Merge pull request #3426 from Programatic/undo_redo
UI: Implement Undo/Redo System
2021-03-30 03:16:24 -07:00
Kurt Kartaltepe
705a47b0e4 libobs, libobs-opengl: add drm format param
This adds the drmbuf format as a parameter separate from the obs texture
format that will be used. drmbuf's may have a variety of formats that we
need to pass correctly to get a usable texture which may correspond to
multi-platform texture formats.
2021-03-29 17:00:31 -03:00
Ford Smith
3a620c485e UI: Undo/Redo Transformations
Implements undo/redo for transformations of sources, both through
preview and the transformations properties.
2021-03-29 03:06:26 -04:00
Ford Smith
60d95cb5bd UI/libobs: Undo/Redo Sources and Scenes
Implements the Undo/Redo for scenes and sources, ranging from renaming,
deletion, addition. It also adds several elements to libobs that were
designed to facilitate undo/redo, and should not affect the rest of
libobs.
2021-03-29 03:06:26 -04:00
Ford Smith
eaf992119f libobs: Fix obs_data_item_numtype returning null in some cases 2021-03-22 15:45:59 -04:00
Ford Smith
31e5d2e5e3 libobs: Implement obs_data_get_defaults
Implements obs_data_get_defaults and updates the documentation. This is
supposed to allow someone to access all the defaults of an object.
Should help in cases where the full data is needed, and not just the
currently set.
2021-03-22 15:44:56 -04:00
Anton Bershanskiy
fc9716f0dd libobs: fix property group check 2021-03-20 12:37:00 -07:00
Exeldro
32e7ba1abe UI: Add visibility transitions
This also modifies libobs.

This adds the ability for scene items to have transitions
when their visibility is toggled.
2021-03-16 22:15:16 -07:00
Anton Bershanskiy
54cbd98d91 libobs: add helper for source filter count
Add function size_t obs_source_get_filter_count(obs_source_t *source)
which returns the number of filters a source has. Update docs for it.
2021-03-16 21:38:06 -07:00
jpark37
c03320cfc2 libobs: Add function to count GPU adapters
Only implemented for D3D11 for now.
2021-03-12 20:59:31 -08:00
Kurt Kartaltepe
9525943bc0 libobs: Fix crash when no context
If obs was shutting down in very early in initialization like when the
X11 display is missing this context parameter might still be NULL.
Return early to allow shutdown to complete without crashing.
2021-03-10 20:14:01 -08:00
jpark37
a20b4c67eb libobs/util: Compiler barriers for ARM64 atomics
Unsure if the intrinsics imply ordering. Safer to assume they don't.
2021-03-07 21:11:32 -08:00
Richard Stanway
6c0d234385 libobs: Minor fixes / code cleanups
Fixes some warnings generated by code analysis tools, removing redundant
checks etc.
2021-03-04 19:29:33 +01:00
Doug Kelly
4ab5a3bea1 libobs: use clock_gettime_nsec_np() for macOS
macOS should use the function clock_gettime_nsec_np() to get the
current clock in nanoseconds, instead of manually using
mach_absolute_time() and manually adjusting the timebase. This
greatly simplifies the platform-specific code to manage the
current time in nanoseconds.
2021-02-28 19:00:43 -08:00
Georges Basile Stavracas Neto
7f27963caa libobs/util: Split bus name from interface
When calling D-Bus methods, three fields are required:

 * The bus name, which is what applications own when they
   want to expose themselves to D-Bus;

 * The object path, which represents a D-Bus object exported
   under a bus name;

 * The interface, which holds the methods and signals;

While out of pure coincidence all the D-Bus buses have a
matching interface name, it is technically incorrect to assume
that.

Add a new 'interface' field to service_info, and split the bus
name.
2021-02-25 12:32:44 -08:00
Georges Basile Stavracas Neto
ec1b07cc85 libobs/util: Replace libdbus by GDBus
GDBus is more and better maintained than libdbus these days. In the
future, a potential Wayland-compatible capture plugin will need to
interact with D-Bus in a way that's way too complicated for libdbus,
and it won't be nice to have both libraries talking to the D-Bus
socket.

Replace the libdbus usage by GDBus. As it turns out, it results in less
code.
2021-02-25 12:32:44 -08:00
Georges Basile Stavracas Neto
94d2166951 libobs/util: Rename struct field 'id' to 'cookie'
All D-Bus interfaces call the unique identifier that is returned by their
calls "cookie", so rename the 'id' field to 'cookie' to match that.
2021-02-25 12:32:44 -08:00
Georges Basile Stavracas Neto
f7a55f45fd libobs/graphics: Add Linux-only gs_texture_create_from_dmabuf()
DMA-BUF is a widespread Linux buffer sharing mechanism. It is what's
commonly used zero-copy screen sharing by Wayland compositors.

Add a new 'device_texture_create_from_dmabuf' vfunc to gs_exports,
and stub implementations to libobs-opengl. Add a new public method
gs_texture_create_from_dmabuf() that calls this vfunc.
2021-02-13 19:13:54 -03:00
Jim
190ab876cc
Merge pull request #2484 from GeorgesStavracas/feaneron/egl-wayland
EGL/Wayland (Wayland, pt 3)
2021-02-12 01:30:05 -08:00
Georges Basile Stavracas Neto
2b3cb54771 libobs: Add a Wayland platform
Introduce the OBS_NIX_PLATFORM_WAYLAND enum value, and try to detect
it when OBS Studio runs by looking into the platform name.
2021-02-09 09:39:04 -03:00
jpark37
951acf2dfe libobs/util: More atomic fixes
Use _ARM_BARRIER_ISH for ARM path.

Remove useless conversion in os_atomic_load_bool.
2021-02-04 17:14:46 -08:00
jpark37
3df4a1109c libobs/util: ARM atomic fixes
Use native instructions on ARM64 (dmb is slow).

Use magic number for 32-bit ARM since _ARM64_BARRIER_ISH is for ARM64.
2021-02-03 22:18:26 -08:00
Henrik "Henke37" Andersson
f0ad7a92cd libobs: Include thread names in thread traces
Makes the crashlog a little nicer to read.
2021-02-03 13:08:57 -08:00
jpark37
d48e77385c libobs: Update compare-exchange pattern
Use function that updates previous value automatically.

Also load initial value seq_cst to be safe.
2021-02-03 08:51:31 -08:00
jpark37
1f90f0e36b libobs/util: Various atomic improvements
Add exchange functions to alias the poorly named set functions.

Add store without reading previous. Faster on non-x86 processors.

Add compare-exchange that updates previous to avoid redundant fetch.

On Windows, load bool without conversion from char.

On Windows, load using mov with compiler barrier. Still seq_cst.

On POSIX, use GCC __atomic builtins.
2021-02-03 08:51:31 -08:00
Hector Martin
31a9dc384d libobs: guard against lagging audio sources
df4eb82 fixed a bug that caused source audio timestamps to perpetually
lag. However, there is a deeper issue where after we reach max
buffering, lagging sources make OBS's entire audio pipeline fall over.
These may be corrected by later code, but still cause global audio
glitches at best. Persistent problems, as prior to df4eb82, cause audio
to fail entirely.

The root cause is that OBS's audio mixing tree cannot deal with
timestamps prior to the current audio tick. Intermediate mixing stages
assume that the lowest incoming timestamp is the base of the current
tick, and mix accordingly. This propagates lagged timestamps up the
tree, where at the top level mix_audio will drop the source entirely -
which at this point is a transition covering all inputs, thus glitching
audio globally. Where extra buffering can cover the slip, the entire mix
gets retried and the error corrected, but when the global buffer
duration is maxed out, it makes it to the output.

The solution is to catch laggy sources immediately after rendering, and
drop audio to bring them back in sync, or mark them pending if not
enough audio is available. This ensures later mixing stages are not fed
with out of sync timestamps.

This improves the ignore_audio code to only drop as much audio as
needed to bring the source back in sync, and moves its call to
immediately after source audio rendering.
2021-02-02 13:28:54 -08:00
Hector Martin
3191f5ddb0 libobs: transition: ignore sources with ts=0
This is a safety against sources which somehow end up with
audio_pending=false but ts=0. Other codepaths guard against this too.
2021-02-02 13:28:54 -08:00
Georges Basile Stavracas Neto
506b950d02 libobs: Introduce the concept of a Unix platform
This is a Unix-specific code. The only available platforms
at this point are the X11/GLX and X11/EGL platforms.

The concept of a platform display is also introduced. Again,
the only display that is set right now is the X11 display.
2021-02-01 19:05:10 -03:00
Georges Basile Stavracas Neto
510c747459 libobs/nix: Move X11-specific code to obs-nix-x11.c
Currently, obs-nix.c is highly tied to the X11 display
server. It includes X11 headers directly, and make use
of X11 functions. Most of the code inside obs-nix.c that
is X11-specific is related to hotkeys handling.

Introduce a new vtable for hotkeys callbacks, that will
used by X11 and Wayland to expose their specific routines.
In this commit, only the X11 hotkeys vtable is implemented.

Move all the X11-specific code to obs-nix-x11.c, and add
a new function to retrieve the X11 hotkeys vtable.
2021-02-01 19:03:43 -03:00
Jim
2eca4d80b6
Merge pull request #2233 from VodBox/missing-files-dialog
libobs + UI: Add Missing Files API & Dialog
2021-01-31 08:02:16 -08:00
Jim
1c99cad33d
Merge pull request #4140 from jpark37/wgc-monitor
Add display capture via Windows Graphics Capture
2021-01-31 07:10:57 -08:00
jpark37
54047ef9ca libobs: Avoid strncpy warning 2021-01-30 00:24:16 -08:00
jpark37
98d1f340da libobs: Fix unused parameter 2021-01-29 21:50:06 -08:00
jpark37
bd14c926eb libobs: Fix truncation warning on 32-bit Windows 2021-01-29 21:47:34 -08:00
Kurt Kartaltepe
5efb10a5e2 libobs: Fix leaking obs-internal.h
Removes prior attempt to expose libcaption headers which really shouldnt
have public. This instead moves the obs-internal include out of the
public obs-scene.h and into it's implementation.
2021-01-28 23:59:02 -08:00
Exeldro
44ace7618f libobs: Duplicate source name for private sources
Allows for identification of sources in studio mode
2021-01-27 00:24:33 -08:00
jpark37
2b652cc763 libobs: gs_duplicator_get_monitor_index
Helper function to find DXGI output index of HMONITOR.
2021-01-26 17:11:04 -08:00
Clayton Groeneveld
99d10c2607 libobs: Add function to get module lib
This adds a function find module library.

Co-authored-by: Stéphane Lepin <stephane.lepin@gmail.com>
2021-01-26 03:31:31 -08:00
Kurt Kartaltepe
d8a253c42f libobs, linux-v4l2: Set thread names
Sets thread names for the hotkey and v4l2 capture threads.
2021-01-25 04:13:24 -08:00
jpark37
ccf16ddb65 libobs: Fix dstr leak 2021-01-22 22:16:17 -08:00
jpark37
71bd5860ce libobs: Final downsample with SRGB formats 2021-01-21 07:42:57 -08:00
jpark37
9e66a4d1ad libobs: Deinterlace as linear SRGB when needed 2021-01-21 07:42:57 -08:00
jpark37
72efe8b942 libobs: Update render_item to enable linear SRGB
Does nothing without linear-aware modifications to sources.
2021-01-21 07:42:56 -08:00
jpark37
66259560e0 libobs: Add dormant SRGB format support
GS_RGBA, GS_BGRX, and GS_BGRA now use TYPELESS DXGI formats, so we can
alias them between UNORM and UNORM_SRGB as necessary. GS_RGBA_UNORM,
GS_BGRX_UNORM, and GS_BGRA_UNORM have been added to support straight
UNORM types, which Windows requires for sharing textures from D3D9 and
OpenGL. The D3D path aliases via views, and GL aliases via
GL_EXT_texture_sRGB_decode/GL_FRAMEBUFFER_SRGB.

A significant amount of code has changed in the D3D/GL backends, but the
concepts are simple. On the D3D side, we need separate SRVs and RTVs to
support nonlinear/linear reads and writes. On the GL side, we need to
set the proper GL parameters to emulate the same.

Add gs_enable_framebuffer_srgb/gs_framebuffer_srgb_enabled to set/get
the framebuffer as SRGB or not.

Add gs_linear_srgb_active/gs_set_linear_srgb to instruct sources that
they should render as SRGB. Legacy sources can ignore this setting
without regression.

Update obs_source_draw to use linear SRGB as needed.

Update render_filter_tex to use linear SRGB as needed.

Add gs_effect_set_texture_srgb next to gs_effect_set_texture to set
texture with SRGB view instead.

Add SRGB helpers for vec4 struct.

Create GDI-compatible textures without SRGB support. Doesn't seem to
work with SRGB formats.
2021-01-21 07:42:13 -08:00
Richard Stanway
900b5341eb libobs: Add os_is_obs_plugin function
This function determines if something is an OBS plugin before attempting
to load it. On Windows, many plugins ship their dependent DLLs alongside
the plugin DLL, so OBS would load things like libcef.dll on startup only
to immediately free it. For other platforms, this is less of a concern
so this function is a no-op for now.

This improves startup time and reduces risk from dependent DLLs
potentially running code with unwanted side effects in DllMain.
2021-01-18 19:05:41 -08:00
VodBox
fb95e1d1e9 libobs: Add missing file API to sources 2021-01-17 10:31:58 +13:00
Theodore Dubois
7852efcba6 libobs: Cleanup uses of objc_msgSend in Objective-C code
Also remove use of deprecated [NSProcessInfo operatingSystem]. It always
returns the NSMACHOperatingSystem.

Also stop parsing [NSProcessInfo operatingSystemVersionString]. The
documentation explicitly says "not for parsing".
2021-01-12 10:10:37 -08:00
Marcus Rückert
12b6e28f03 libobs: Fix missing Linux libraries with certain flags
Make sure libobs links all libraries needed to satisfy symbols in the
library.

Fixes obsproject/obs-studio#3924
2021-01-11 14:10:53 -08:00
jpark37
b80919f65f libobs: Support color picker with alpha 2021-01-11 11:52:50 -08:00
ckelsel
9e07c42d74 libobs: Fix gs_duplicator_get_texture function check 2021-01-11 11:16:02 -08:00
jp9000
2597ed0ecc libobs: Update version to 26.1.2 2021-01-08 15:43:39 -08:00
Colin Edwards
0fa5dfcd30
Merge pull request #3933 from PatTheMav/macos-cef-texture-sharing
libobs: Add texture sharing support for macOS/OpenGL
2021-01-07 23:03:08 -06:00
jp9000
a9484fe737 libobs: Update version to 26.1.1 2021-01-03 08:18:43 -08:00
Richard Stanway
d0cbc83da2 libobs: Avoid unnecessary mallocs in audio processing 2021-01-02 14:53:19 +01:00
Michael R. Crusoe
1e96573328 libobs: Update to SIMDe 0.7.1
c3d7abfaba

Simplify usage of the SIMDe header

This obviates the need for sse2neon as well and fixes compilation of all
plugins that referenced sse-intrin.h on all architectures, not just
arm*.
2021-01-02 04:07:55 -08:00
Clayton Groeneveld
fdd34c35fc libobs: Set lock state when duplicating scene item
Fixes bug where the lock state wouldn't be copied when duplicating
a scene.
2020-12-31 13:26:39 -08:00
pkubaj
d46e8b03c9 libobs: Add definitions in ARCH_SIMD_DEFINES
This is necessary on ppc64 to build plugins that use cmake, so that
-DNO_WARN_X86_INTRINSICS is defined.
2020-12-31 06:31:25 -08:00
Richard Stanway
e5c6839904 libobs, obs-ffmpeg: Use correct value for EINVAL error check
FFmpeg functions such as av_interleaved_write_frame return negative
on error, so all errno values are negated.
2020-12-21 18:37:49 +01:00
PatTheMav
61ea6e0247
libobs: Add texture sharing support for macOS/OpenGL 2020-12-18 17:44:03 +01:00
Hector Martin
a5d08e347e linux-pulseaudio: fix race conditions
PulseAudio code needs to be called with the PA lock held. This chiefly
fixes multiple races during stream shutdown:

* If the functions are called without the lock held, deferred event
  handling races end up with PA infinite looping on the mainloop, or
  asserting, or other badness, as the reentrant calls cause data
  structure corruption on the PA side.
* If we don't reset our callbacks, PA might call us even after we
  request stream disconnection (since the stream actually getting fully
  shut down is asynchronous), and then we dereference NULL pointers from
  our userdata etc. PA will keep its data structures alive until necessary
  via reference counting, but not ours.

The lock around pa_stream_begin_write doesn't result from any issues I
experienced, but it looks correct; PA doesn't say anywhere that that
function is thread-safe.
2020-12-12 12:05:12 -08:00
Hector Martin
df4eb8219c libobs: fix the pending stop trick
Regression introduced by dc4e20500: while the stop detection is pending,
it should still return false so the rest of the discard code can run.
Otherwise, the source audio will remain in the buffer, lagging the
source and triggering audio buffering increases until max audio
buffering is reached.
2020-12-10 03:15:13 -08:00
jp9000
3c6b356208 libobs: Update version to 26.1.0 2020-12-09 02:34:15 -08:00
Richard Stanway
e00feef7ab libobs: Ignore non-fatal ffmpeg return values during remux
Similar to 315fbd6 and 6071098, ignore non-fatal errors during the
remux process. It's possible OBS itself writes a file that generates
these errors when remuxed.
2020-12-02 21:05:43 +01:00
jpark37
2d547cf669 libobs: Allow wrapping D3D11 object with gs_texture_t
This can be useful for reading from textures provided by middleware.
2020-11-24 14:39:56 -08:00
PatTheMav
fb27900e94 CI: Remove explicit LANGUAGE flags for cmake 3.19+ 2020-11-21 12:00:52 -08:00
Vadim Zhukov
0d222b6b56 Add OpenBSD support 2020-11-14 11:55:22 -08:00
jp9000
ebbe8d1bf9 libobs: Change service max res. to res. list
(This commit also modifies rtmp-services and UI)

Changes the maximum resolution size to a resolution list, and splits the
maximum FPS to its own function.

(Note: ABI has not been modified because the last changes still haven't
been released yet, so it's safe to modify this as long as the changes
haven't been officially released)
2020-11-13 18:22:53 -08:00
jp9000
fb7747c56e libobs: Implement obs_service func to get max bitrates
(This commit also modifies rtmp-services)

Implements obs_service_get_max_bitrate, which allows retrieving the
maximum audio/video bitrates directly rather than being forced to use
the apply method. Makes it a bit easier to get the bitrate values.
2020-11-11 09:42:26 -08:00
jpark37
86ecaadffb libobs: Fix bad type and size mismatch 2020-11-04 04:45:07 -08:00
Colin Edwards
5b8f89d86e decklink: Clean up warnings introduced by caption code 2020-11-03 17:00:14 -08:00
Colin Edwards
7b0d7c6357 Remove BUILD_CAPTIONS build flag 2020-11-02 22:46:55 -06:00
Colin Edwards
923f06bfa6 decklink: Add ability to ingest/embed cea 708 captions
(This commit also modifies libobs, UI)
2020-11-01 22:28:49 -08:00
Florian Zwoch
0c39fd08c7 libobs: Add desktop session type to Linux log
Add the content of the XDG_SESSION_TYPE environment variable to
the output log if it is set. This is usually set on modern Linux
distributions and typically carry either "x11" or "wayland" when
run from a desktop environment.

This is independent from the QT_QPA_PLATFORM environment variable
which would allow OBS Studio to run inside a wayland session. The
session type it runs on does have an implication on the behavior of
some plugins like screen and window capture. So having this
information exposed here is extremely helpful for diagnosing
issues.
2020-10-30 02:19:21 -07:00
jp9000
e4c6b59852 libobs: Add ability to get max cx/cy/fps from service
This obs_service_t object callback was implemented specifically for
services which may have a maximum recommended width, height, and
framerate that needs to be enforced.
2020-10-30 00:28:44 -07:00
Matt Gajownik
a86d4c073d libobs: Return default obj and array rather than current
Fixes #3357
2020-10-23 22:32:20 -07:00
Clayton Groeneveld
2b50263d5c UI, libobs: Add ability to copy/paste single filter 2020-10-15 10:14:22 -07:00
jp9000
18486853a5 obs-ffmpeg: Add ability to debug ffmpeg-mux subprocess
Adds a cmake variable (DEBUG_FFMPEG_MUX) which enables FFmpeg debug
output in the ffmpeg-mux subprocess, and if on Windows, shows the
console window of the ffmpeg-mux subprocess so the current output can be
seen.
2020-10-14 18:42:22 -07:00
jp9000
755e4f8897 libobs: Update version to 26.0.2 2020-10-06 07:57:55 -07:00
jp9000
50cbafd711 libobs: Update version to 26.0.1 2020-10-05 09:13:17 -07:00
jp9000
e24aaa0b58 libobs: Update version to 26.0.0 2020-09-28 04:41:22 -07:00
jp9000
e1447c22db libobs: Check if output active when setting encoders
This fixes an issue where someone might mistakenly try to change an
audio/video encoder before the output is complete.
2020-09-23 14:52:15 -07:00
jp9000
af09057395 libobs: Deprecate service multitrack check
This isn't particularly needed, as a service with multiple tracks won't
be using multiple tracks to begin with anyway.  This might change later,
but for now just mark it deprecated.
2020-09-07 13:38:38 -07:00
jpark37
b6afaceeae Update VIDEO_CS_DEFAULT to mean 709 instead of 601
Consistent with modified default UI setting.
2020-09-06 20:51:28 -07:00
Richard Stanway
d7e8f115e8 libobs/media-io: Fix suspicious memset behavior 2020-09-04 21:46:18 +02:00
Richard Stanway
c8f7a4563d libobs: Check data validity for media sources 2020-08-29 02:42:03 +02:00
Manuel Kroeber
618781e563 libobs: Log Windows 10 Hardware GPU Scheduler
This adds logging for the "Hardware-accelerated GPU Scheduler" (HAGS)
introduced with Windows 10 2004 which is known to cause issues with OBS
and game performance.
2020-08-26 22:57:52 +02:00
Jim
33ecd10358
Merge pull request #3319 from kkartaltepe/x11-underlinking
libobs: Fix underlinking X11
2020-08-23 11:22:59 -07:00
Jim
e36b9c309d
Merge pull request #3216 from Xaymar/pr-fix-obs_source_enum_full_tree
libobs: Call enum_all_sources in check for enum_all_sources
2020-08-22 15:09:42 -07:00
Kurt Kartaltepe
c3ab6b91f6 libobs: Fix underlinking X11
Add explicit linkage to X11 fixing #3305
2020-08-21 16:25:42 -07:00
Jim
5803504c36
Merge pull request #3261 from e00E/undefined-behavior-utf8
libobs: Fix undefined behavior
2020-08-17 19:23:21 -07:00
Jim
53b65bb5fd
Merge pull request #3245 from e00E/fix-defer-update
libobs: Fix deferred update sometimes using stale data
2020-08-17 08:03:21 -07:00
jp9000
d45017370b libobs: Add functions to get locale text from modules
Useful for sharing translated text from modules with the frontend.  This
is technically already done via properties, but it would be nice to just
be able to explicitly look up locale text directly rather than have to
go through properties.
2020-08-10 12:24:01 -07:00
jp9000
de2e89d972 libobs: Add function to get module pointer
Useful for getting getting locale text associated with a specific module
2020-08-10 12:24:01 -07:00
jp9000
f5d6a695be libobs: Add OBSRef::Get()
Allows explicitly getting the pointer associated with the object.
2020-08-10 12:24:01 -07:00
Valentin
b7f5cde4e3 libobs: Fix undefined behavior
It is undefined behavior to apply an offset to a null pointer. I would
have liked to reference cppreference but best I found was the PR that
added this check to clang's undefined behavior sanitizer:
https://reviews.llvm.org/D67122 .
2020-08-08 10:41:24 +02:00
Jim
bfdf5dc947
Merge pull request #2356 from jpark37/sycc-color-space
Color space refinements
2020-08-05 08:58:21 -07:00
Valentin
4508cb03b5 libobs: Fix deferred update sometimes using stale data
Currently we use a bool flag to signal the video thread that it should
call obs_source_deferred_update. This does not work correctly when the
update callback is slow and the update is triggered faster than the
callback can complete.

For example:
* the settings are set to state A
* defer_update is set
* obs_source_deferred_update is called and enters into the callback
* the callback starts making use of the settings in state A
* the settings are set to state B
* defer_update stays set
* the callback finishes
* defer_update is set to false

Now defer_update is false but the callback has only observed settings in
state A but not B.

This commit fixes this bug by keeping an update counter. If the counter
has changed while we were in the callback we know that we need to update
again.

The counter is atomic. The current version uses a plain bool which is a
data race as the value is written and read in parallel.
2020-08-04 09:28:55 +02:00
jp9000
d117908440 libobs: Add func to set async video frame immediately
Allows the ability to directly override the current async frame
immediately.
2020-07-29 13:59:49 -07:00
Jim
80bb9b4675
Merge pull request #3206 from notr1ch/frame-fix-squashed
Fix preloaded video behavior
2020-07-29 13:57:52 -07:00
Uro
5fd51eab31 libobs: Add util/sse2neon.h to CMakeLists
Add util/sse2neon.h to libobs_util_HEADERS in CMakelists.txt. The
previous patch #3180 for arm/rpi support was missing this in
libobs/CMakeLists.txt, and as a result plugins such as obs-websocket,
obs-ndi fail to compile on arm/rpi as the header is not copied with the
install.
2020-07-27 11:47:29 -07:00
Michael Fabian 'Xaymar' Dirks
127dce6bf6 libobs: Call enum_all_sources in check for enum_all_sources
Fixes a crash caused by checking for enum_all_sources and then calling
enum_active_sources instead of enum_all_sources. enum_active_sources is
not required for sources that specify enum_all_sources.
2020-07-27 01:53:58 +02:00
Richard Stanway
4f7767111a libobs: Update async texture when showing preloaded video
The previous preloaded video behavior updated the texture on preload
rather than when the video was shown, during which time the texture may
have been modified by other processes, resulting in the wrong frame
being displayed.
2020-07-23 23:54:10 +02:00
Richard Stanway
06321f89e1 UI: Remove OBSContext class and shutdown in run_program
The OBSContext never called obs_startup but would always call
obs_shutdown in its destructor, resulting in shutdown calls even if
libobs wasn't initialized (eg due to a startup error). Instead, we now
track if libobs was initialized in OBSApp and call shutdown in the
destructor.
2020-07-23 23:17:52 +02:00
jpark37
06e4b10675 libobs/media-io: Add missing codec_tag set 2020-07-18 23:35:35 -07:00
jpark37
a69151e204 libobs: Add VIDEO_CS_SRGB support 2020-07-18 19:43:04 -07:00
jpark37
40b4db0c0c libobs/media-io: Fix FFmpeg deprecation warnings 2020-07-18 18:47:52 -07:00
jpark37
0628c844f8 libobs: Fix FFmpeg deprecation warnings 2020-07-18 18:47:45 -07:00
venepe
f5d877b393 libobs: Add arm support 2020-07-18 00:53:03 -05:00
jp9000
18b915a47b libobs/util: Use is_padding() for wcsdepad as well
Fix wcsdepad so that it checks for padding in the same way strdepad
does.
2020-07-11 16:15:38 -07:00
sunjingzhao
05826491af libobs/util: Fix potential crash 2020-07-11 16:01:32 -07:00
Matt Gajownik
76bdbdfbb0 libobs: Translate F13-F24 hotkeys on Windows
Fixes #2377
2020-07-11 16:27:44 +10:00
Jim
b83a9dd0d6
Merge pull request #3133 from jpark37/fix-plane-heights
libobs: Fix video scalar copy heights
2020-07-10 20:31:50 -07:00
Jim
8b00f7d341
Merge pull request #3085 from eric/fix-audio-on-timestamp-jump
libobs: Reset audio data on timestamp jump
2020-07-10 17:35:44 -07:00
jpark37
cf911744f7 libobs: Fix video scalar copy heights
Use plane height instead of overall height for copying planes to fix
memory stomp.
2020-07-07 12:48:49 -07:00
Jim
3b11e170b7
Merge pull request #2836 from jpark37/yuv-image-fix
Fix FFmpeg YUV to RGB conversion by adding extra destination padding to line sizes
2020-06-26 06:13:45 -07:00
Jim
8e28c89a93
Merge pull request #2786 from pkubaj/patch-1
Add CFLAGS necessary on PPC64(LE) to libobs.pc
2020-06-26 01:39:45 -07:00
Jim
76c42215d6
Merge pull request #2755 from exeldro/keep_filters
libobs: Don't check filter compatibility on not loaded sources
2020-06-24 14:13:48 -07:00
Jim
0d7b4e1ced
Merge pull request #3006 from mr-c/simde_20200529
libos: Freshen SIMDe code copy
2020-06-21 05:34:38 -07:00
Jim
5f00f8c42a
Merge pull request #3014 from notr1ch/remove-excessive-null-checks
libobs: Remove excessive null checks
2020-06-21 04:56:45 -07:00
Jim
a5f4850d7a
Merge pull request #3048 from jpark37/unused-audio-code
libobs/media-io: Remove unused code
2020-06-21 04:53:57 -07:00
Eric Lindvall
f79f816b72 libobs: Reset audio data on timestamp jump
To prevent issues in audio mixing make sure the audio data is also cleared
when audio timing is reset.
2020-06-20 14:55:31 -07:00
jpark37
d9fa5de572 libobs: Fix right edge for "video scaler"
FFmpeg YUV to RGB conversions require extra destination padding.

This code only appears to be exercised for DeckLink.
2020-06-14 20:26:10 -07:00
jpark37
4c2e430c0c libobs: Fix right edge for JPEG images
FFmpeg YUV to RGB conversions require extra destination padding.
2020-06-14 20:00:58 -07:00
jpark37
6aa50b3ef1 libobs: Use autoreleasepool for graphics thread
Apparently necessary to clean up macOS leaks.
2020-06-08 13:16:35 -07:00
jpark37
886bf5ceb7 libobs/media-io: Remove unused code 2020-06-07 11:16:24 -07:00
Richard Stanway
b9ea45e498
Merge pull request #2977 from futr/fix-non-terminated-str
libobs: Fix os_get_executable_path_ptr on Linux
2020-06-01 21:27:49 +02:00
Richard Stanway
b62ced9bf2 libobs: Unload modules while OBS core is active
Modules are now unloaded while OBS core is still active, allowing
modules that call into libobs in their unload function to continue to
work. This changes the behavior of such calls - previously they were a
no-op since the OBS core would be gone, but they are now executed with
the OBS core still being active.
2020-06-01 15:54:46 +02:00
Richard Stanway
dd519123c6 libobs: Remove excessive null checks
libobs functions check for a null obs_core inconsistently. If the core
is null, the functions silently return with no indication of an error to
the API user. This commit removes all null checks in libobs functions
that require libobs to be initialized. For OBS Studio, we are
(hopefully!) using the API properly so this should have no impact.
2020-06-01 15:54:23 +02:00
Exeldro
2d75639f58 libobs: Use correct data pointer for hotkey pair 2020-06-01 08:22:47 +02:00
Masato Takahashi
4ded3b39fd libobs: Fix os_get_executable_path_ptr on Linux
Terminate a non-terminated string generated by readlink()
to pass to dirname() that needs terminated string as a parameter.
2020-06-01 09:22:12 +09:00
Michael R. Crusoe
9f72a8ef8c
libos: Freshen SIMDe code copy
Up to date with cafec4b952

Documentation was added to libobs/util/simde/README.libobs
2020-05-29 12:37:14 +02:00
Jim
b0e8ba6db8
Merge pull request #2972 from kkartaltepe/cmake-variety-fixes
cmake: Fix warnings and normalize variables/errors
2020-05-21 19:40:57 -07:00
Kurt Kartaltepe
d928bfd1ea cmake: Fix warnings and normalize variables/errors
As of 3.17 using find_package_handle_standard_args checks that the name
of the FindXXX file and the first argument are the same case.

Some modules used non-standard variables or the old singular variables
instead of plurals. This normalizes variable usage to the new-style.

Some CMakeLists.txt did custom error checking instead of propagating
find_package errors. These were changes to call find_package with
REQUIRED or without QUIET where needed and shortens the custom status
messages. This helps users who want to enable that functionality see
what precisely wasnt found.
2020-05-21 18:45:16 -07:00
Jim
665180350d
Merge pull request #2657 from hselasky/improvement
libobs: Implement and use better scaling function for 64-bit integers
2020-05-21 18:07:53 -07:00
Jim
770408a7da
Merge pull request #2967 from jpark37/promotion-warnings
libobs: Fix potential truncation warnings
2020-05-21 17:36:35 -07:00
jpark37
cd6f56d0ea libobs: Fix potential truncation warnings 2020-05-21 10:02:03 -07:00
jpark37
5734ab7a9b libobs: WinRT and dispatcher init on graphics thread
Suspected necessary for WGC stability.
2020-05-21 09:25:54 -07:00
tt2468
ba0f8de3a0 libobs: Return target instead of current in calc_torquef
If the previously calculated torque value is too close to 1.0
(but not considered 1.0), it would be impossible for the TBar to
finish its transition since it returned the old value, causing desync.
2020-05-13 22:43:11 -07:00
jp9000
7993179466 cmake: Add cmake folders 2020-05-13 06:52:37 -07:00
jpark37
0a700dbc2a libobs: Remove log entry for CoInitializeEx pass
Remove entry from the top of the log. Always returns S_FALSE, and that's
unlikely to change.
2020-05-10 12:36:20 -07:00
Jim
63cbcc5dcc
Merge pull request #2900 from jpark37/fix-posix-events
libobs/util: Fix POSIX event bugs
2020-05-09 16:00:27 -07:00
jpark37
7ce30ece82 libobs/util: Fix POSIX event bugs
Handle spurious wakeups, and ensure mutex unlock.
2020-05-09 14:21:35 -07:00
jpark37
7dc2782840 libobs: Fix da_reserve early return logic
Test desired capacity against original capacity instead of size.
2020-05-09 09:15:02 -07:00
Jim
3e1b5426e3
Merge pull request #2738 from exeldro/scene_not_duplicate
libobs: Don't allow duplicating scene sources
2020-05-04 01:38:27 -07:00
Henrik "Henke37" Andersson
6fb19a8904 libobs: Use SetThreadDescription if possible
It's the better way to declare thread names, but you need Windows 10,
version 1607 to use it.
2020-05-03 06:37:28 -07:00
Jim
d5d36b2f7a
Merge pull request #2835 from RytoEX/crash-log-win-release-id
libobs: Add Windows 10 release version to crash log
2020-05-03 06:31:29 -07:00
张昆
eb44e05169 libobs: Fix unnecessary duplication
Original code makes duplicated item and bad memory

Closes obsproject/obs-studio#2837
2020-05-03 06:28:21 -07:00
jp9000
3100cc6234 libobs: Update version to 25.0.8 2020-05-03 05:25:48 -07:00
Ryan Foster
b7f1bf9bc4 libobs: Add Windows 10 release version to crash log
Follow-up to eadb96f.
2020-04-29 20:38:21 -04:00
Richard Stanway
0ea39baf95 libobs: Clear last error on encoder shutdown
This fixes an issue where an encoder may error out on a path that
doesn't use obs_encoder_set_last_error, resulting in a stale error being
used.
2020-04-27 01:15:53 +02:00
Piotr Kubaj
7da9a2f0d3 libobs: add ppc64(le) specific flags to libobs.pc
-DNO_WARN_X86_INTRINSICS -mvsx flags are necessary on PPC64(LE), but
those flags haven't been added yet to libobs.pc, making some plugins
fail to build.
2020-04-27 00:07:18 +02:00
Exeldro
6a567eded6 libobs: Don't check filter compatibility on not loaded sources 2020-04-19 09:11:32 +02:00
Colin Edwards
55e2985026
Merge pull request #1944 from WizardCM/windows-rc-definition
CMake: Build Windows modules with file descriptors
2020-04-18 18:27:22 -05:00
Richard Stanway
a81071f8cc
Merge pull request #2739 from exeldro/removed_sources
libobs: Don't save removed sources
2020-04-18 16:58:48 +02:00
Exeldro
874820ec2f libobs: Don't save removed sources 2020-04-18 08:30:06 +02:00
Exeldro
74b9ae07f3 libobs: Don't allow duplicating scene sources 2020-04-17 12:40:25 +02:00
Colin Edwards
b7b202fac7 libobs: Fix plugin folder search path case on macOS 2020-04-16 19:28:00 -05:00
Colin Edwards
e3c63c003a libobs: Update version to 25.0.6 (mac release) 2020-04-13 20:41:04 -05:00
Richard Stanway
5e3e9c1f13 obs-ffmpeg: Use new encoder error handling functions 2020-04-12 17:05:19 +02:00
Richard Stanway
5dc9f989d6 libobs: Add support functions for encoder error handling
Similar to how outputs can pass errors, add the same functionality for
encoders so that if an output encoder has an error, it is made available
to the output and eventually the UI / user.
2020-04-12 17:05:19 +02:00
Richard Stanway
2d261e79ff
Merge pull request #2663 from khng300/obs-25-fbsd-fix-execpath
libobs/util: Add FreeBSD and Dragonfly support in os_get_executable_path_ptr()
2020-04-10 00:40:46 +02:00
jp9000
e10d44d5f5 libobs: Update version to 25.0.5 (mac release) 2020-04-08 16:21:09 -07:00
Ka Ho Ng
ab2743dd23 libobs/util: FreeBSD/Dragonfly exec path support
Add support for FreeBSD and Dragonfly in os_get_executable_path_ptr().
This is required to obtain the path of the running executable image
correctly.

Fixes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245299
Fixes https://github.com/obsproject/obs-studio/issues/2622
2020-04-08 03:44:40 +08:00