Commit graph

2888 commits

Author SHA1 Message Date
derrod 3bb101d7a2 libobs: Finalise source creation before firing signal
Fixes a possible crash when renaming a source during the source_create
signal callback as it has not been added to the hash table yet.
2023-04-22 16:13:17 -07:00
Ryan Foster ba263ee4fa Revert "libobs: Improve util_mul_div64 outside MSVC"
This reverts commit c977417747.

Reverted due to a regression.
2023-04-16 20:29:47 -04:00
jpark37 c977417747 libobs: Improve util_mul_div64 outside MSVC
Use inline assembly for x86_64 speed/accuracy.

Sacrifice speed for accuracy on other processors.

Continue to use original implementation for ARM on Windows.
2023-04-15 17:08:04 -07:00
Norihiro Kamae 593fb3d12d libobs: Remove newly introduced PRAGMA_WARN_STRINGOP_OVERFLOW macro
The macro PRAGMA_WARN_STRINGOP_OVERFLOW was introduced to suppress a
warning -Wstringop-overflow caused by a macro da_push_back_new calling
darray_push_back_new.
Extract the function in the macro to avoid the warning.
This will also enables checking the type check of the returned pointer.
2023-04-15 16:03:10 -07:00
PatTheMav b2e66bb401 libobs: Add missing headers for framework export 2023-04-12 17:17:00 +00:00
derrod b3cf98f230 libobs: Fix compiling in ISO C17 mode 2023-04-08 19:30:12 -04:00
cg2121 6254e031d9 libobs: Fix transition lookup by uuid
The obs_get_transition_by_uuid function would return a valid source
even if it wasn't a transition.
2023-04-05 16:52:46 -07:00
jpark37 5a46c1e513 libobs: Fix v210 display name 2023-04-05 21:54:25 +02:00
jpark37 504cc76e93 libobs: Ensure v210 preserves precision 2023-04-05 21:54:25 +02:00
PatTheMav 6e07b86729 cmake: Remove EXCLUDE_FROM_ALL directive from interface libraries 2023-04-04 17:27:54 +00:00
gxalpha caccd86092 cmake: Sort libobs target_sources alphabetically 2023-04-01 16:15:41 -07:00
Simon Rost a144a736f9 libobs: Remove dependency on Visual Studio 2019+
In util_uint64.h the intrinsic function _udiv128 is used.
The implementation is only available in Visual Studio 2019+
2023-03-30 19:51:08 -04:00
Ryan Foster bfb8fba066 Revert "libobs: Enable fast clear on Windows always"
This reverts commit c2afa58125.
2023-03-27 15:24:52 -04:00
Norihiro Kamae 050d2e69b3 libobs: Log when libobs data file is not found
When an effect file is not found while initializing graphics, only one
line error below is logged. To clarify the reason why the initialization
was failed, also log when the file was not found.
Failed to initialize video. Your GPU may not be supported, or your
graphics drivers may need to be updated.
2023-03-27 15:20:56 -04:00
Norihiro Kamae e4eeecf3df cmake: Fix OBS_INSTALL_PREFIX
Before 349372b3b3, OBS_INSTALL_PREFIX contained trailing slash so that
it can concatinate with further paths.
2023-03-27 15:30:05 +02:00
Kurt Kartaltepe 36409f01cf libobs/media-io: Use inputs_mutex during close
This code assumed that no one would be racing after we stopped the input
thread, however the obs output thread also races and can free the inputs
during disconnect before we finish closing the video mix.

Instead keep the locks around after stop and use them during close to
avoid races.

Fixes crashes when stopping virtual webcam on linux.

Co-authored-by: Norihiro Kamae <norihiro@nagater.net>
2023-03-27 01:14:32 -07:00
PatTheMav 349372b3b3 cmake: Add changes for CMake build framework 3.0
New code path only taken if OBS_CMAKE_VERSION is set to 3.0.0 or
greater, old functionality remains unchanged.
2023-03-26 18:20:38 -04:00
Jim e233931dff
Merge pull request #8522 from nquah/enhanced-rtmp
Enable AV1, HEVC via RTMP to YouTube
2023-03-26 14:07:37 -07:00
PatTheMav 90f46a9d4d libobs: Add missing VIDEO_FORMAT_V210 handling in switch statements
Format was added to enum but not handled in all switch statement
handling the enum.
2023-03-26 13:48:01 -04:00
Yuriy Chumak 7dbc829c15 libobs,UI: Add output failure code for HDR being unsupported 2023-03-26 16:37:31 +02:00
Yuriy Chumak 31ba0973e5 libobs: Export HEVC NAL type enum 2023-03-26 14:47:22 +02:00
Norihiro Kamae 94bf325dd9 libobs: Fix VIDEO_FORMAT_V210 shader for GLSL 2023-03-26 05:13:00 -07:00
jpark37 97843dd7d7 libobs: Add VIDEO_FORMAT_V210
Support 10-bit packed format that DeckLink uses.
2023-03-26 01:52:44 -07:00
cg2121 d291830d23 libobs: Copy private scene item data when duplicating scenes
For example, this makes sure scene item colors are copied when
duplicating a scene. This also removed the now redundant private data
variable.
2023-03-25 18:30:31 -07:00
Jim 7a30d535aa
Merge pull request #8289 from derrod/more-audio-codecs
libobs,obs-ffmpeg: Add option for recording lossless audio
2023-03-25 16:52:49 -07:00
cg2121 1ac609f1ff UI, libobs: Fix not handled in switch warnings
These warnings were being spit out by GCC on Linux.
2023-03-26 10:47:01 +11:00
jpark37 8f3bf0a0e3 libobs: Keep output as premultiplied alpha
Simplify code until someone needs straight alpha.
2023-03-25 03:19:26 -07:00
derrod dcee4fc61a libobs: Allow encoders to request unclamped audio mix
This is useful for formats such as 32-bit float PCM which providers
greater flexibility in editing by retaining information that would
otherwise be clipped.
2023-03-25 10:38:18 +01:00
jpark37 e32c2c1427 libobs: Add callback for main texture rendered
Useful for redirecting main texture to DeckLink output for example.
2023-03-24 15:18:45 -07:00
derrod a73e13eeeb libobs: Keep mixer data for placeholder sources
Placeholder sources are created when a plugin providing a source type is
unavailable. Since they're not marked as having audio any audio track
settings for them get lost. With this change we retain mixer information
if the source owns its id to avoid that.
2023-03-24 12:16:32 -04:00
Jim e9ef38e3d3
Merge pull request #7978 from jpark37/dxgi-display-sdr-on-hdr
libobs-d3d11,win-capture: Add Force SDR for DXGI duplicator
2023-03-20 01:43:14 -07:00
Jim 0a9ed4569b
Merge pull request #7814 from jpark37/decklink-preview-rescale
decklink: Move preview output rescaling to GPU
2023-03-20 01:42:36 -07:00
jpark37 c2afa58125 libobs: Enable fast clear on Windows always
NVIDIA driver 527.37 fixes flickering when multiple GPUs are installed.
2023-03-20 01:41:47 -07:00
tytan652 22ebed8d02 libobs,docs: Add connect infos check to the Services API
This new function allows to know if the service has all the info needed
to try to connect.
2023-03-19 17:38:02 +01:00
tytan652 ea4ac2d08d libobs,docs: Add connect infos to the Services API
This replace and deprecate url, key, username and password functions.
2023-03-19 17:38:02 +01:00
tytan652 aeab6b8fc4 libobs,docs,rtmps-services: Add supported audio codecs
Also remove Opus-only "supported audio codecs" in the services JSON.
2023-03-19 17:27:42 +01:00
tytan652 1e0f4a6ebf libobs,docs: Add preferred output type to Service API 2023-03-19 17:16:13 +01:00
tytan652 48dc6dde68 libobs,docs: Add supported codecs functions with output id 2023-03-19 16:49:56 +01:00
tytan652 56411eda8e libobs,docs: Add protocol enumeration functions 2023-03-19 16:31:05 +01:00
tytan652 813b3b2763 libobs,docs: Add protocol to Services API 2023-03-19 15:29:44 +01:00
tytan652 201bcda051 libobs,docs: Add protocol in Outputs API 2023-03-19 15:29:03 +01:00
Jim 6eace37e06
Merge pull request #8229 from derrod/hashed-tables
Hashtable Adventures
2023-03-19 00:34:44 -07:00
Kurt Kartaltepe b7f29ca767 libobs: Reduce synchronization limit for multiple audio tracks
Since 65eb3c0815 we tried to get as close
a sync between audio and video tracks as we could before starting to
send frames to the output.

But in be717dbb2c when multi-track audio
was considered for synchronization it continued to try and line ALL
audio packets up with one video packet. While audio and video packets
are similar size this will work out. But once video packets duration is
smaller than 1/2 audio packet duration this may fail forever. In
practice with AAC's 20-23ms frame duration we can often get tracks
producing frames 5-10ms out of phase. For 60fps video this mostly fine
as 16ms frame duration will cover the gap, but for framerates as low as
100 its possible to fail to synchronize. In practice this is ~50%
for 6 audio tracks and 120fps video on my system, or 100% at 240fps.
2023-03-18 18:40:12 -07:00
Exeldro a5e9c94e4b libobs: Add obs_view_get_video_info 2023-03-18 15:54:38 -07:00
Jonathan Bennett 73dea7c475 libobs: Fix Pulseaudio audio monitoring listing sources
The Pulseaudio implementation of audio monitoring was actually listing audio sources.
This change corrects that, so all possible outputs are available.
2023-03-18 15:45:36 -07:00
Norihiro Kamae 4ea0b69974 libobs/util: Simplify implementation of os_get_path_extension
To avoid a false use-after-free warning from GCC's -Wuse-after-free
option, revise the implementation without using memory allocation.
2023-03-18 15:36:41 -07:00
Norihiro Kamae 434bdc1768 libobs: Fix possible use-after-free of obs_scene_t
When creating a group, a newly allocated group `sub_scene` is released
just after calling `obs_scene_add_internal`.
If another thread released the scene-item, which is the sub_scene,
use-after-free might happen.
2023-03-18 15:34:47 -07:00
derrod a41c616b21 libobs: Do not send hotkey_bindings_changed if nothing changed 2023-03-18 10:47:50 +01:00
derrod e6a7cff034 libobs: Use uthash for hotkeys and hotkey pairs 2023-03-18 10:47:50 +01:00
derrod 78aa4e03dc libobs: Use uthash for properties 2023-03-18 10:47:49 +01:00
derrod eff3cf134c libobs: Use uthash for hotkey name map 2023-03-18 10:47:49 +01:00
derrod c68eeaef1d libobs: Use uthash for source objects
All sources are part of a hash table that allows a lookup by UUID.
Public sources additionally are in a hash table allowing lookup by name.
2023-03-18 10:47:49 +01:00
derrod 183fa8c06c libobs: Use uthash for translation lookup 2023-03-18 10:47:49 +01:00
derrod e720bb4c09 libobs: Use uthash for config 2023-03-18 10:47:49 +01:00
Jim f4a8814998 libobs: Use uthash for obs data objects
Co-authored-by: Rodney <dennis@obsproject.com>
2023-03-18 10:47:49 +01:00
derrod 2986d36d9b libobs/util: Add uthash
Adds a header including uthash and redefining some of its options for
use withint libobs and plugins (potentially).
2023-03-18 10:47:49 +01:00
jp9000 619edf5e7d libobs: Add pointer to obs_data_item name
Rather than have to look up the string each time, just add a pointer to
the string. Still all stored in the same memory though.
2023-03-18 10:46:28 +01:00
derrod 1fd50a9324 libobs: Add obs_reset_source_uuids 2023-03-12 01:11:38 +01:00
derrod 29db52ad27 libobs: Save/Load source UUID in scene item data 2023-03-12 01:11:38 +01:00
derrod 30519768ad libobs: Add UUIDs to obs_source objects 2023-03-12 01:11:38 +01:00
derrod f72cc4498f libobs: Add os_generate_uuid() to platform utils 2023-03-12 01:11:38 +01:00
derrod 4b062a7147 libobs: Add functions for getting/saving pretty JSON 2023-03-10 23:55:42 +01:00
derrod 75693a6682 libobs: Write default values to config 2023-03-07 17:44:19 -05:00
pkv a0a23e8a18 libobs: Fix leak with empty path in stats
If the recording path is left empty in Settings, a leak can occur in
window-basic-stats.cpp because a bmalloc is called for a size 1.
This fixes the leak by checking against the path in the
os_get_free_disk_space function.

Signed-off-by: pkv <pkv@obsproject.com>
2023-03-04 16:23:07 -08:00
Richard Stanway 2468268569 libobs: Hold async mutex when calling set_async_texture_size
Calling set_async_texture_size without holding async_mutex is dangerous
as cur_async_frame could be changed / freed by another thread.
2023-03-04 16:10:19 -08:00
Richard Stanway 01786a3f11 libobs: Disable encoder scaling request if it matches output size
It was possible to set the encoder to scale the video to the same size
as the output, resulting in unnecessary passes through swscale and
skipping hardware encoders. This was a common user error in Advanced
Output mode where they would tick the rescale box but leave it at the
same resolution as their main output.
2023-03-04 15:14:42 -08:00
Chris (Flaeri) 0eb496e8cf libobs/media-io: Add color range and space to conversion
By adding the range data we can get successful handling of full range
color via custom FFmpeg output. Previously it would always default to 0
which would yield partial/limited output. Without the colorspace info
the output file is correctly tagged, but not undergone the actual
conversion.
2023-03-03 21:48:09 +00:00
Richard Stanway 5b193bca55
libobs/util: Fix typo in curl revocation support check 2023-03-02 19:36:31 +01:00
derrod f9cce334d2 libobs: Add copy constructor for ComQIPtr 2023-03-01 20:39:53 +01:00
pkv 2e79d4c902 obs-ffmpeg: Fix for FFmpeg 6 deprecating a flag
Also modifies libobs & deps/media-playback.
AV_CODEC_CAP_TRUNCATED was removed in avcodec 60 [1].
We ifdef the code depending on it to allow compilation.

[1] avcodec: remove FF_API_FLAG_TRUNCATED
3ceffe7839

Signed-off-by: pkv <pkv@obsproject.com>
2023-03-01 13:23:51 -05:00
PatTheMav e23455dc74 libobs: Fix device functions not marked as EXPORT
As clang and gcc use "default" visibility (as in "not hidden") when
no visibility is specified, all functions are implicitly exported.

When changing default visibility to "hidden", the corresponding symbols
are not exposed anymore and linking fails. This PR updates all
functions signatures that were added in recent commits but not set to
be EXPORTed.

Also makes required OpenGL imports for texture sharing on macOS
mandatory.
2023-03-01 12:02:33 -05:00
derrod a9d3b9cbd1 libobs: Clarify memalign ToDo item 2023-03-01 11:18:47 -05:00
derrod a5468cfee0 libobs: Make wcs<->utf8 conversion consistent
On Windows NULL characters would be included in the output if insize is
non-zero, but on *nix it would abort on the first NULL.
2023-02-28 18:36:18 -08:00
Frank 20a3ec4a2f libobs: Fix scene_audio_render() incorrectly mixing audio
When the `pos` variable is non-zero, audio does not get mixed correctly.
This is due to the fact that the `pos` variable was erroneously being
applied to the input rather than the output.
2023-02-25 19:25:15 -08:00
CodeYan01 d2dd917721 docs: Fix layout and typos 2023-02-26 10:31:02 +11:00
Kurt Kartaltepe bc9eee922e libobs: Fix pulseaudio monitoring, once and for all
This makes multiple changes to resolve issues with monitoring. We have
added a number of things over time to resolve various issues due to our
misunderstanding of the pulse api and the explicitly wrong pulse api
documentation.

First is removing the prior stream write tracking. Write tracking
was incorrect as pulse sends you the total number of bytes it wants
written at that time and not a incremental, but also this write tracking
is unhelpful since we can just let begin_write signal when we should
stop writing.

Second removing underflow tracking, this sort of worked to detect high
latency sources like vlc which buffer ~1s of data before writing audio
data. It worked because it would grow the buffer in PA until we could
write enough data into it, but it didn't allow us to leverage that
larger buffer because we never paused the PA stream.

To solve the buffering/high latency issue instead start the PA stream
corked and only uncork it once we have enough data to reach the targeted
latency. We also check how much data we recieve from the source and if
it appears to be high latency providing us with much more data than our
target latency we increase the latency to match the source. Fixing the
VLC source issue and resulting in a smooth start to audio instead of
underruns while we play and increase latency.

Finally add some handling for pulses incorrectly documented API. Notably
that begin_write may request more or less data from you so handle both
cases. And stop attempting to use attr.maxlength which is not updated
after set_buffer_attr calls and was always -1, and tlength is just more
appropriate.

old mantis resulting in some changes, still fixed. https://obsproject.com/mantis/view.php?id=1076
fixes #7574
2023-02-25 15:13:08 -08:00
PatTheMav 76732846d7 libobs: Fix non-exhaustive switch statements
New video formats introduced for ProRes 4444 encoding have not been
implemented in function calls used for video decoding, which makes the
switch statements non-exhaustive.

This does not functionally change the status quo (decoding ProRes 4444
files could still be broken because libobs does not explicitly handle
the colour format).
2023-02-23 20:32:52 +01:00
jpark37 463bf0dff5 libobs,UI: Add P216/P416 pixel formats
Will be useful for ProRes.
2023-02-21 18:48:44 +01:00
jpark37 0efaf88caf libobs: Add PQ/HLG support for I210/I412 formats
Seen when playing back ProRes files.
2023-02-21 18:48:44 +01:00
jpark37 9ee97bba1a libobs: Add obs_output_get_video_conversion
Need post-convert size to avoid CPU rescale.
2023-02-19 11:46:20 -08:00
jpark37 7bfde66578 libobs-d3d11: Support color spaces for duplicator
Need this plumbing to make decisions about duplicator colors.
2023-02-19 11:40:32 -08:00
PatTheMav db3a01db6b libobs: Remove unused variables 2023-02-18 15:22:33 -08:00
PatTheMav fb7a9edadc libobs: Fix non-exhaustive switch statements 2023-02-18 15:22:33 -08:00
Richard Stanway c57a291316 libobs: Convert security product name to UTF-8 for logging
Co-Authored-By: gkvjwa <285794886@qq.com>
2023-02-15 15:36:13 -05:00
Richard Stanway 7178124da9 libobs: Fix typo in function name 2023-02-15 13:40:13 -05:00
tuduweb e36163ce89 libobs/media-io: Correctly check codec tag compatibility for out stream 2023-02-15 18:21:09 +01:00
tytan652 cb6b5cc249 libobs: Add desktop environment to Linux log 2023-02-11 16:19:12 -08:00
tytan652 eacc246584 libobs: Add Flatpak info logging 2023-02-11 16:19:12 -08:00
Norihiro Kamae ee6ddeeaed libobs: Avoid position underflow when mixing audio sources
When a variable `pos` became larger than `AUDIO_OUTPUT_FRAMES`, `count`
will get overflowed number. To avoid the overflow, continue the loop
when `AUDIO_OUTPUT_FRAMES - pos` is not positive.
2023-02-11 15:22:17 -08:00
Jim 1f469e4f7c libobs/media-io: Add get_total_audio_size()
get_audio_size() gets the size of individual planes.
get_total_audio_size() gets the size if you include all planes.
2023-02-05 02:55:24 -08:00
jp9000 2ff210acfd libobs: Update version to 29.0.2 2023-02-04 02:17:49 -08:00
Jim 5d3943ab48 libobs: Update version to 29.0.1 2023-01-31 22:58:37 -08:00
Norihiro Kamae 2b4bc03b4c libobs/graphics: Remove unused macros for inputs 2023-01-28 19:03:55 -08:00
Norihiro Kamae d18a6f1039 libobs/graphics: Remove unused macros
The macros BOUNDS_MAX_X, BOUNDS_MAX_Y, and BOUNDS_MAX_Z are never used
and they are never defined how to use.
2023-01-28 19:03:55 -08:00
Barnabás Pőcze 5810571e53 libobs: Close display when destroying X11 hotkey platform
Currently, the X11 display is leaked when the X11 hotkey
platform is destroyed. Fix that by calling XCloseDisplay()
to free it.

Fixes: bcb04bb800 ("libobs: Open a separate X11 connection for hotkeys")
2023-01-25 13:56:50 -05:00
jpark37 792f8473ee libobs: Fix SDR async video on non-SDR targets
Bug was seen when projecting SDR video capture on WCG displays.
2023-01-24 19:39:42 -08:00
Jan Beich c082c4a74d libobs/graphics: Enable DMABUF on FreeBSD and DragonFly
Required under Wayland (wlrobs) on FreeBSD and DragonFly. DMABUF was
already partially exposed after c50c625555.
2023-01-24 11:50:13 -05:00
tt2468 018ce16703 libobs: Fix loading of custom_size for empty scenes
Previously, `custom_size` was checked at the end of the `scene_load`
function. If the scene contained no "items" array, the `custom_scene`
loading code would never be run.

This moves the `custom_size` code above the return statement.
2023-01-22 10:26:47 +11:00
tytan652 678b0287e6 libobs: Calm stringop-overflow warning on GCC
Those warnings appeared with GCC 12 with -O2, those are potentially
created by regression from GCC.
2023-01-19 13:08:46 -05:00
tytan652 c648222332 libobs,libobs-opengl,obs-ffmpeg-mux: Calm deprecation warnings on *nix
Calm libobs-opengl deprecation warnings on macOS.

Calm FFmpeg deprecation warning with LIBAVFORMAT_VERSION_MAJOR < 59.
2023-01-19 13:08:46 -05:00
tytan652 ca896dbce7 media-io: Fix FF_API_BUFFER_SIZE_T not being defined on Ubuntu 20.04 2023-01-19 13:08:46 -05:00
tytan652 b0c1c9c86c libobs,plugins: Remove individual -Wno-switch 2023-01-19 13:08:46 -05:00
John Bradley 61284cf9ba libobs: Refactor obs-output encoded use of mixes
There was quite a bit of conflated usage of mixes (which refers
to raw audio) and encoder counts. This fully separates the two
and makes a distinct separation when iterating over mixes vs
encoders.
2023-01-18 11:54:20 -08:00
John Bradley d70171daa6 libobs: Make internal version of remove encoder 2023-01-18 11:54:20 -08:00
tt2468 25df3e183e libobs: Fix logging of remaining views
OBS has been logging `1 views remain at shutdown` when in reality there
are not technically any views remaining. When views are removed, the
view itself is destroyed immediately, but the mix remains, to be
garbage collected by the graphics thread.

In this case, the view has already been removed, but the graphics
thread has not run an interation and cleaned up the mix, so this
log message appears.

Fixes the issue by checking if a mix actually has an assigned view,
instead of blindly logging existing mixes.
2023-01-18 12:17:35 -06:00
tt2468 c69e40734d libobs: Prevent encoders from initializing/starting if no media is set
This fixes a case of undefined behavior, where encoders can try to init
or start without actually having any video_t or audio_t object
assigned.
2023-01-18 12:17:35 -06:00
tt2468 7e30d3f8a2 libobs: Remove unused internal encoder util function
Was previously introduced in a0f679bc40,
but has since been made unused.
2023-01-18 12:17:35 -06:00
tt2468 eb0d9dc5d2 libobs: Allow sending NULL to obs_encoder_set_video/audio()
There is currently no way to clear a video_t or audio_t object from an
encoder once applied. `audio_t`/`video_t` objects can be destructed at
any time, and it is dangerous to prevent these object references from
even being cleared.

This does not fix the issue where destroying an audio/video object does
not clear the reference from all subscribed encoders.
2023-01-18 12:17:35 -06:00
tt2468 dfc20bbb31 libobs: Protect some encoder functions from being used while active
Protect `obs_encoder_set_video()` and `obs_encoder_set_audio()` from
being used if the encoder is active. Changing these values while active
is undefined behavior.
2023-01-18 12:17:35 -06:00
tt2468 f6d0c63b1e
Merge pull request #6960 from tytan652/fix_switches
Switch clean up (remove one-case switch and switch warning workaround)
2023-01-16 03:55:48 -08:00
tytan652 cf5c68b773 UI,libobs,libobs-opengl,obs-ffmpeg: Remove unneeded cast in switches
Those casts were usually used to workaround switch warnings.

Also adds default to OBS frontend event switches that had this
workaround.
2023-01-16 11:52:26 +01:00
tytan652 9cde3c302c libobs: Fix all-except-one switches 2023-01-16 11:52:17 +01:00
tytan652 7de0bd350f libobs,plugins: Remove one-case switches 2023-01-16 11:43:47 +01:00
tt2468 78d31322b2 libobs: Remove extra space in output reconnect log message
It has been bothering me to no end.
2023-01-15 22:59:59 -08:00
Exeldro eb35b07f44 libobs: Fix stopping transitions that are not active 2023-01-14 15:54:48 -08:00
Norihiro Kamae 1805712f46 libobs/util: Fix text-lookup not always case-insensitive
Convert `lookup` to upper-case before creating the tree so that later
code does not need to consider the case-insensitivity.
When converting to upper-case, use `toupper` instead of adding 0x20 so
that the behavior is consistent with `astrcmpi_n`.
2023-01-14 15:09:25 -08:00
jp9000 301fb48449 libobs: Update version to 29.0.0 2023-01-06 09:42:38 -08:00
Ryan Foster 19abcbcd3c Revert "libobs-d3d11: Make sure libobs knows the new adapter index"
This reverts commit e62759a3fa.
2022-12-30 21:14:15 -08:00
Ryan Foster 8dde4bab1e Revert "libobs: Fix adapter index not getting applied to resets"
This reverts commit 02d20e9f36.
2022-12-30 21:14:15 -08:00
jp9000 78f3389d17 libobs: Add funcs to get windows video adapter LUIDs
Useful for providing adapter order to encoder test subprocesses
2022-12-19 11:59:44 -08:00
Sergo Pogosyan 5582503d4f libobs: Duplicate URL string for OBS_BUTTON_URL
WidgetInfo::ButtonClicked() is aborting because URL string is not
allocated and eventually free-d by Python. This fix is allocating
a new string to store the URL passed to the Python function
obs_property_button_set_url().

Free button URL

Repace spaces with tabs

Typo
2022-12-10 15:31:13 -08:00
Antti Tapaninen 44fe366fb0 libobs: Override fps ovi for aux views 2022-12-03 15:15:50 -08:00
Ryan Foster 9f31a9d7a5 libobs: Suppress LNK4098
Suppress LNK4098 to allow building against pre-built Jansson for now.
2022-11-22 00:14:16 -05:00
Jim 02d20e9f36 libobs: Fix adapter index not getting applied to resets 2022-11-21 17:56:45 -08:00
derrod cdc9313829 cmake/libobs: Set OBS_COMMIT based on git describe 2022-11-22 02:54:07 +01:00
Jim e62759a3fa libobs-d3d11: Make sure libobs knows the new adapter index
Because Intel has wonderful code which forces it to run on the iGPU if
there are both an Intel iGPU and an Intel dGPU on the same system, the
adapter index OBS is set to internally will no longer be valid, thus if
anyone calls `obs_get_video_info()` to try to find out what adapter
index OBS is running on, it will be invalid on those computers.
Wonderful.

So, basically, this code here just fixe it so if you want to call
`obs_get_video_info()`, it'll actually have a valid adapter index now,
that way we can reference the adapter index when determining what GPU
we're actually running on without having to like, do anything super
complicated and silly like comparing adapter GUIDs just to figure out
what adapter OBS is actually runing on. I don't want the code to be a
mess anymore.

(I like how in any other situation on the face of the planet, there's no
need to force OBS to run on an integrated adapter. *Normally* OBS
*should* run on the dedicated adapter, that way it can actually capture
games properly. You can probably guess as to why they're forcing it to
run on the integrated adapter rather than the dedicated adapter. But you
know what? Whatever. I don't really care anymore I guess. Just...
whatever. Here we are I guess. Also I was in a bad mood while writing
this just as a disclaimer.)

(I hate that this commit exist. I hate that the commit c83eaaa51c exists
even more.)
2022-11-21 08:47:36 -08:00
gxalpha 34e6a5b73f libobs: Deprecate obs_get/set_master_volume
These methods were never implemented to do anything.
2022-11-19 20:37:22 -05:00
Antti Tapaninen c7f4c78a69 libobs: Allow overriding video resolution per view 2022-11-19 15:34:54 -08:00
jpark37 3d36ba5579 libobs: Fix SRGB to SCRGB async video rendering
SDR source projectors are no longer blown out on HDR displays.
2022-11-17 02:16:48 -08:00
PatTheMav c6cb1eb7d1
libobs: Replace invocations of sprintf with snprintf
Fixes deprecation warnings in Xcode 14/clang on macOS and reduces
chance of buffer overflows.
2022-11-11 19:51:27 +01:00
pkv2 252e352a51 libobs: Change audio resampler to new channel API
The channel_layout API was overhauled by FFmpeg [1-5]. The previous
bitmask channel_layout is replaced by a struct ch_layout which combines
the number of channels, a bitmask and other infos.
The resampler needs to be updated whenever using swresample > 4.5.100.
This commit makes the necessary changes.

[1] Bump minor versions after the channel layout changes
FFmpeg/FFmpeg@cdba98b
[2] lavc: switch to the new channel layout API
FFmpeg/FFmpeg@548aeb9
[3] avutil/channel_layout: Add a new channel layout API
FFmpeg/FFmpeg@086a804
[4] avframe: switch to the new channel layout API db6efa18
FFmpeg/FFmpeg@db6efa1
[5] swresample: convert to new channel layout API
FFmpeg/FFmpeg@8a5896e

Signed-off-by: pkv <pkv@obsproject.com>
2022-11-10 19:37:07 -05:00
jpark37 e709797d80 libobs: Add P3 shaders for Mac 2022-11-09 22:34:50 -08:00
Tommy Vercetti 1adb984bd9 libobs: Log Windows emulation status 2022-11-09 03:03:26 -08:00
Tommy Vercetti eb93011463 libobs: Log macOS Rosetta status 2022-11-09 03:03:26 -08:00
Tommy Vercetti 41efdc498c libobs/util: Add function to get Windows x64 emulation status 2022-11-09 03:03:26 -08:00
Richard Stanway da3a81a637 libobs: Remove Aero logging 2022-11-08 20:44:47 -08:00
derrod 567505b2ed libobs: Fix reading Windows release name 2022-11-08 08:47:23 -05:00
derrod 1b6e1ce655 libobs: Add utility function to get total RAM 2022-11-08 05:38:37 -08:00
jpark37 6306c8de74 libobs: Move async filtering from render to tick
Fixes frame/texture size mismatch crash that can happen at render time.
2022-11-08 05:37:47 -08:00
gxalpha 5658bf6732 libobs: Add "source_update" signal
Adds a source signal that gets triggered when a source's settings are
updated.
2022-11-05 18:06:53 -07:00
Jim 6bd4b854f7 libobs: Update to 28.1.2 2022-11-05 06:33:04 -07:00
PatTheMav bbb3dc0059 libobs: Force hvc1 codec tag for HEVC video and respect input tags 2022-11-02 22:44:20 +01:00
jp9000 808c8105cc libobs: Update version to 28.1.1 2022-11-01 00:51:42 -07:00
jp9000 da6bf3ffba libobs: Update version to 28.1.0 2022-10-31 14:28:33 -07:00
jpark37 080095786f libobs: Force SRGB conversion for tonemapped video
Fixes case where video capture is darkened when both luma wipe and scale
filtering are set.
2022-10-31 14:05:04 -07:00
jpark37 3d985f7c60 libobs: Fix blend method in studio mode
Property was not being copied over.
2022-10-29 16:15:58 -07:00
Kurt Kartaltepe a9641940cb libobs: Add media key support for linux
Links up the xkb keysyms with the obs vk codes.

Fixes #7649
2022-10-29 16:08:16 -07:00
Richard Stanway a282b1c64d libobs: Add ifdef for Windows-only variable assignment 2022-10-15 16:17:46 -07:00
jp9000 3dfcdb8c07 Revert "libobs: Update version to 28.1.0"
This reverts commit 9baf7f4a8f.
2022-10-11 19:37:32 -07:00
jp9000 9baf7f4a8f libobs: Update version to 28.1.0 2022-10-11 17:11:47 -07:00
jpark37 e119a7024d libobs: Sample video at default chroma location
Expect left for 4:2:0 SDR and 4:2:2, and top-left for 4:2:0 HDR.

MJPEG will be a half-pixel off, but we'll live with that for now.
2022-10-09 16:15:16 -07:00
jpark37 2a76ffaf02 libobs/graphics: Precompute more accurate matrix
This is generated with .NET BigInteger fractions, and late divide.
2022-10-05 08:36:29 -07:00
jpark37 51c452e937 libobs: Precompute more accurate matrices
These are generated with .NET BigInteger fractions, and late divide.
2022-10-05 08:36:29 -07:00
jp9000 77b11c16f1 libobs: Update version to 28.0.3 2022-10-01 17:39:24 -07:00
jp9000 4741a9aa50 libobs: Add function to get encoder pause offset 2022-09-30 13:07:19 -07:00
jpark37 3dd0f895f8 libobs/media-io: Restore color range conversion
FFmpeg needs color range during context init to handle conversions.
sws_setColorspaceDetails after the fact is too late.
2022-09-26 21:26:01 -07:00
jpark37 5af9c87e1b libobs/media-io: Avoid scaler for range diff
Green tint appears when using converting full NV12 to limited NV12 with
swscale, so just avoid creating scaler by color range for now.
2022-09-24 16:45:01 -07:00
jpark37 a34fae0327 libobs,UI: Swap red/blue render/output channels
Don't need to unswizzle channels for DeckLink output in the future.
2022-09-24 16:06:34 -07:00
Kurt Kartaltepe 615728fa3b libobs/util: Reject plugins linking Qt5 library for Linux
Since obs-studio switched to Qt6, old plugins linking Qt5 should be
rejected. On Linux system, OBS and it's plugins link the system
libraries so that obs could be crashed by such plugins that links Qt5
when Qt5 functions are called.

Co-authored-by: Norihiro Kamae <norihiro@nagater.net>
2022-09-19 10:01:18 -03:00
jpark37 bb02620169 libobs: Add support for reading NV12/YUY2 PQ/HLG
8-bit HDR shouldn't exist, but OBS looks broken, so just support it.
2022-09-17 16:36:31 -07:00
jpark37 1a7e5babc2 libobs: Add support for reading I420 HLG
Sony cameras can create 8-bit HLG videos for some reason.
2022-09-16 03:04:23 -07:00
jpark37 70f8e83353 libobs/media-io: Create scaler in more cases
Check for other data mismatches the scaler can fix up.
2022-09-10 15:36:27 -07:00
jpark37 1ddabc5c7c libobs: Remove unnecessary branch
Fast path for output texture shouldn't care what the effect is.
2022-09-10 15:34:29 -07:00
jp9000 4563413d15 libobs: Update version to 28.0.1 2022-09-02 19:06:23 -07:00
jp9000 3cde5dd48a libobs: Update version to 28.0.0 2022-08-30 20:17:35 -07:00
jpark37 b4cc32c4c9 libobs: Extend NVIDIA anti-flicker to desktops 2022-08-29 10:02:32 -07:00
jpark37 37389ff243 libobs: Avoid display clear workaround if possible 2022-08-27 16:32:50 -07:00
jp9000 07df6548fd libobs: Increase texture encode buffering
Seems to solve lag encountered on the new AMF encoder. The SubmitInput
call in the AMF encoder can occasionally stall for quite a long amount
of time, but most take microseconds, so we can compensate by simply
increasing the buffering (3 to 10 textures).
2022-08-27 14:29:28 -07:00
PatTheMav 2bb0818fb4 libobs: Use system header notation for pthread.h include
Using a relative path for the pthread.h header by w32-pthreads breaks
compilation of plugins which include threading.h from libobs (as
w32-pthreads will exist at a different location relative to the
libobs header).

As w32-pthreads (and its include directory) is added to the libobs
target by CMake, the pthread.h header will be found even when using
system header notation.

Fixes https://github.com/obsproject/obs-studio/issues/7155
2022-08-24 05:40:37 -07:00
derrod 44eb8ffbb6 libobs: Fix Windows 10/11 Gamemode/HAGS detection
It seems that the older key still exists on Win 11 and 10 but is always
set to 0, so use the newer to start with and fall back to the old one if
necessary.

Additionally, if the key for HAGS and GameMode do not exist assume
they're on as this is the default on Win 11. On Windows 10 game mode is
also on by default in recent versions.

Also changes "10" to "10/11" just for correctness.
2022-08-24 05:08:04 -07:00
jpark37 f88300a613 libobs: Emulate clear with draw for displays
Laptops that render OBS displays on NVIDIA, and display through Intel
have been seen flickering, and we think the driver is not properly
handling swap chain buffers that have been cleared but not drawn to. To
work around this, we use a draw to simulate a render target clear. This
is not as efficient, so hopefully NVIDIA will fix this soon.
2022-08-24 05:01:08 -07:00
Richard Stanway 8227dccf77 libobs: Initialize main_view video mix before video thread
Fixes a race condition where the video thread would exit because it sees
no active mixes, causing OBS to freeze on startup.

Fixes #7095
2022-08-20 01:27:47 -07:00
jp9000 6abf89af21 Revert "libobs: Correctly set texture size"
This reverts commit 90a409fe58.

Reverts #7077 for now. This really shouldn't be done so close to
release. This crash technically only happens under very niche scenarios,
and the fix seems to have some other potential issues. Prematurely
merged by Jim.
2022-08-18 11:04:11 -07:00
tududweb 90a409fe58 libobs: Correctly set texture size
Correctly set texture size according to the frame to be rendered this time.
Fixes the mismatch between frame and texture when async-delay-filter on.
2022-08-18 03:43:22 -07:00
Chip Bradford 590fa1ffe6 UI: Free virtual cam memory on shutdown 2022-08-17 23:21:28 -07:00
jpark37 6494d46111 libobs: Use nal_ref_idc for H.264 priority
H.264 spec only mentions zero/non-zero, but RFC 6184 uses 0/1/2/3 values
for prioritization. Go back to reading packet field for priority.
2022-08-17 05:30:16 -07:00
Ed Maste 25d308c727 libobs: Read /etc/os-release on FreeBSD
Previously FreeBSD had an optional port that installed /etc/os-release
so it was already available on many FreeBSD systems, but os-release is
now provided by the base system and will be universally available.
2022-08-16 18:40:48 -04:00
gxalpha bad54448ce
libobs: Fix format specifier warning 2022-08-14 23:45:34 +02:00
Chip Bradford eb1cc8d076 libobs: Fix gpu thread termination when additional video mixes are added 2022-08-13 01:33:34 -07:00
jpark37 64ef93a29d libobs: Fix filter color space passthrough
Need to chain against target instead of parent.
2022-08-13 01:32:42 -07:00
Norihiro Kamae 33e6ad3cc9 libobs: Remove unnecessary UTF characters 2022-08-13 00:49:17 -07:00
Jim 9e15114750
Merge pull request #6577 from chippydip/multiple-video-mixes
libobs: Add support for multiple video mixes
2022-08-09 21:37:48 -07:00
jpark37 fb146fa370 libobs: Remove display GPU markers without draws 2022-08-09 20:21:27 -07:00
PatTheMav 43a49dca47 cmake: Fix CMake package export templates for CMake 3.24
CMake 3.24 implemented changes that break dependency discovery of the
exported libraries built by OBS.
2022-08-09 19:48:03 -04:00
Richard Stanway 86963f65d2
libobs, win-capture: Don't export ms_get_obfuscated_func
Since this was included in things like the inject helper and game
capture DLLs, it added an additional export to those programs. Instead,
simply share the source files directly in the projects that need it.

Co-authored-by: jpark37 <jpark37@users.noreply.github.com>
2022-08-07 19:41:23 +02:00
Norihiro Kamae c42047cb68 libobs: Fix missing pair of GS_DEBUG_MARKER
The conditional branch added by 4fe6803fe resulted GS_DEBUG_MARKER_END
is not called when the branch condition is failed.
2022-08-06 17:24:56 -07:00
jpark37 4fe6803fe4 libobs: Prevent D3D11 projectors from tearing
Some users stream projectors, so don't let them tear. Use the waitable
object to check the flip queue, and only flip if there's space.

Metal and Vulkan can probably perform similar flip throttling once OBS
starts using them.
2022-08-06 16:16:20 -07:00
jpark37 0e5420750b libobs: Implement H.264/HEVC priority parsing
Parsing priority while serializing/discarding packet data is too gross.
2022-08-01 08:15:29 -07:00
jpark37 5361d936ce libobs: Implement obs_parse_hevc_packet 2022-07-31 17:38:25 -07:00
jpark37 55f35d1d89 libobs: Consolidate H.264 priority scheme
The spec for nal_ref_idc doesn't indicate that it should be used for
priority like x264 seems to be using it for. NVENC seems to pass
different values, so let's not rely on it.

The new scheme might be naive, but we can iterate on it, and apply
evenly to all H.264 encoders.
2022-07-31 17:38:25 -07:00
Chip Bradford 0a87797a21 libobs: Format changes for multiple video mixes 2022-07-31 15:35:37 -07:00
Chip Bradford 7e39ee291c libobs: Add support for multiple video mixes
Split render_texture and derived fields in obs_core_video into new
obs_core_video_mix struct. Add new APIs to add additional obs_view to the render loop, each with a separate render_texture / obs_core_video_mix.
2022-07-31 15:35:36 -07:00
jpark37 3a43fc4a07 libobs: Use left chroma location for SDR
Top-left chroma should be for Rec. 2020/2100.
2022-07-31 00:10:50 -07:00
tytan652 5490e4f44c libobs,docs: Improve failed module loading logging
- Avoid putting libs (like CEF) in the plugins load failure message.
- Consider obsolete macOS obs-browser plugin fail as a hardcoded skip.
2022-07-30 16:55:03 -07:00
gxalpha de01cfc063 libobs: Include plugin path in log error message 2022-07-29 03:29:13 +02:00
jp9000 23c3ad4d02 libobs: Add obs_load_all_modules2 and obs_find_modules2
obs_find_modules2 allows the ability to get the module name in the
callback, and the change to obs_find_modules2 also adds the ability to
find out whether any modules failed to load or not.
2022-07-28 16:36:01 -07:00
jp9000 a0eae6f33c libobs/util: Add get_plugin_info (internal)
Allows the ability to get additional information about the plugin beyond
just whether it's an OBS plugin. For this case, whether it can load,
which is primarily used on Windows and mostly just determines whether it
has an incompatible Qt version.
2022-07-28 16:36:01 -07:00
jp9000 97b34ebb76 libobs: Add currently used Qt version to obsconfig.h.in
Allows the ability to have code depending on whether OBS is being
compiled with Qt5 or Qt6
2022-07-28 16:36:01 -07:00
jp9000 8f1ab15281 libobs: Remove funcs/structs to "load all modules" from SWIG
There's no reason to expose these to scripting. Additional context: More
functions/structures will be added related to loading all modules, and
there's no reason to expose them to scripting either.
2022-07-28 14:53:58 -07:00
jp9000 f6e349f033 libobs/util: Put module load detection in its own func
Puts the detection of obs_module_load in Windows DLLs for the "is this
an obs plugin" check into its own function
2022-07-28 14:53:58 -07:00
Tommy Vercetti 90b705fcbc libobs: Rename "Mac OS X" to "macOS" in log 2022-07-28 14:04:01 -04:00
Richard Stanway ad11ae2f5c
libobs: Remove redundant get_data calls in obs_data functions 2022-07-27 21:58:16 +02:00
gxalpha 9d68c8a848 libobs: Fix crash handler noreturn compiler warning
Maybe not the most correct solution since it never gets hit but much
less code and ifdefs compared to what we'd have else wise.
2022-07-27 12:05:16 -04:00
Norihiro Kamae 106f5f9ace libobs: Remove unused cmake configure files
These files replaces the old input files for `configure_file` in cmake.
- `libobs/cmake/libobsConfig.cmake.in`
- `libobs/pkgconfig/libobs.pc.in`
2022-07-27 10:35:31 -04:00
jp9000 8a698e863d libobs: Add func to get supported service codecs
Allows a service to return a list of codecs that are currently supported
2022-07-26 09:23:35 -07:00
jp9000 cc242ada58 libobs: Remove trailing whitespace 2022-07-26 09:23:35 -07:00
Theodore Dubois 0032d349c9 libobs: Rewrite macOS hotkeys implementation
Co-authored-by: Sebastian Beckmann <beckmann.sebastian@outlook.de>
2022-07-26 14:21:21 +02:00
Anastasiia Sidorovskaia ef9c99f5f4 libobs: Set coefficients with higher precision 2022-07-25 17:41:26 -04:00
PatTheMav ab62c9c615 libobs: Trigger bindings injected by Qt directly
Instead of lettings the hotkey thread handle bindings triggered by Qt,
call the callback directly.

By this point, Qt has resolved the modifier state (so no need for the
hotkey thread to do the same), the pressed state is set as well,
the branch takes care of matching the pressed keys.

This also fixes the issue with the hotkey changes introduced by #3914,
which only inject key events when OBS is _not_ in focus (and as such
modifier states are never updated).
2022-07-25 17:33:40 +02:00
tududweb 25d84f40d6 libobs: Fix audio monitor output error in macOS 2022-07-25 17:28:42 +02:00
jpark37 0d129988a9 libobs: Allow Chrome class executable matching
Lets OBS find Spotify.exe even if the window title changes.
2022-07-23 17:41:34 -07:00
jpark37 69ff026647 libobs, win-capture: Share window helper code
Add "ms_" prefix as makeshift namespace.
2022-07-23 17:41:34 -07:00
jpark37 9b46795d57 libobs, UI: Add OBS_ICON_TYPE_PROCESS_AUDIO_OUTPUT 2022-07-23 17:41:34 -07:00
jpark37 7864c8649a libobs/util: Add WinModule RAII wrapper 2022-07-23 17:41:34 -07:00
tytan652 17ba8359e4 deps,libobs,plugins: Fix discarded-qualifiers warnings with FFmpeg 5 2022-07-22 08:50:36 -04:00
tytan652 447f2869ab libobs: Remove OBS_UNUSED 2022-07-20 09:03:31 +02:00
tytan652 12657e4fcc libobs: Replace OBS_UNUSED with UNUSED_PARAMETER
OBS_UNUSED is not portable to MSVC.
2022-07-20 08:22:08 +02:00
tytan652 348cf1b872 libobs: Remove unused parameters 2022-07-20 08:21:20 +02:00
Norihiro Kamae af3890a4a9 libobs: Cleanup unused-parameters
- Add OBS_UNUSED to unused function parameters
- Remove unnecessary UNUSED_PARAMETER
Also update libobs-opengl/
2022-07-19 11:01:00 -04:00
Norihiro Kamae 4f49968f92 libobs: Remove set but not read variable 2022-07-19 11:01:00 -04:00
PatTheMav 4252c8a069 cmake: Fix pkgconfig generation
Existing code didn't check for possible "empty" linked libraries
(e.g. Threads::Threads when compiler has built-in pthreads support).
Also adds support for compile options defined on linked dependencies.
2022-07-19 09:28:51 -03:00
bin c19946d7e8 libobs: Fix pulseaudio crash. 2022-07-16 16:25:47 -07:00
Richard Stanway c5965c8605 libobs: Log errors for bmalloc(0)
malloc(0) is implementation defined and almost always a mistake. I
believe we should be more like malloc and treat bmalloc(0) as an error
instead of tying to handle it. For now we can log an error in case 3rd
party plugins are broken, in the future I would suggest this becomes a
crash-worthy error.
2022-07-16 15:20:55 -07:00
Richard Stanway dbdbfe79d2 libobs: Deprecate base_set_allocator and make it no-op
Hopefully nothing is actually using this in the first place. As a
library libobs has alignment requirements so we should probably not
allow an application to replace our aligned mallocs with something else.
This also allows more aggressive optimizations inside libobs as the call
can be completely inlined into a libc malloc.
2022-07-16 15:20:55 -07:00
jpark37 92d1ca41cc libobs: Fix warnings about type usage 2022-07-11 22:07:10 -07:00
PatTheMav ff7f756886 libobs: Explicitly mark variables as unused 2022-07-10 09:59:55 +10:00
PatTheMav 91c915e4e9 libobs: Disable compiler warnings about non-exhaustive switch cases 2022-07-10 09:59:55 +10:00
tt2468 b56196dcf7 libobs: Remove newlines on ends of fixed audio buffering message 2022-07-02 13:19:45 -07:00
tytan652 bf985946a4 libobs,UI,docs: Add info as text property sub-type in the property API 2022-06-26 17:31:59 +10:00
tt2468 bb55cfbc05 libobs: Improve exponential backoff functionality
- Changes the default base exponent value to 1.5 from 2.0
- Applies a random skew of +-0.05 to the exponent to lessen the
"water hammer" effect caused by predictable backoff techniques
- Fixes the logging associated with exponential backoff to log the
true reconnect delay value
2022-06-25 17:06:00 -07:00
Tommy Vercetti 3b64e74660 libobs/util: Add function to get Rosetta translation status 2022-06-19 01:37:15 +02:00
Jim 29782cd594 libobs: And fix area scaling effect with RGBA 2022-06-04 19:54:52 -07:00
Jim a33a5d2151 libobs: Fix bilinear lowres RGBA as well 2022-06-04 19:03:20 -07:00
Jim 4a2a06b22f libobs: Fix RGBA format output not working
Due to a bug in shader parsing, it thinks that because the token
"multiplier" is used here, that the "multiplier" uniform is being used.

This is a workaround for the issue because fixing the parser is probably
going to be much more annoying than just working around the issue for
now.
2022-06-04 17:47:47 -07:00
gxalpha d093128935 libobs: Deprecate obs_hotkey_enable_strict_modifiers
In bb6787968, we changed the default behaviour to be strict modifiers
and we consider this to be the correct way. There is no need to change
this from code either, since if someone really needs non-strict
modifiers, they can work around it by setting multiple hotkeys.
Having this option in code just means a bigger maintenance cost, so
we'll deprecate the function and remove it in the future.
2022-06-04 16:03:23 -07:00
jpark37 bacd4713da libobs: Clear low bits when writing P010
Don't want to rely on consumer to ignore those bits.
2022-06-04 01:00:21 -07:00
jpark37 1ac758a2ef libobs: Ensure active copy surfaces are active
Stale surfaces can cause improper downloads from GPU, and lead to video
corruption in certain cases.
2022-06-03 01:17:07 -07:00
OldBaldGeek bb6787968c libobs: Fix issue 4408 (hotkey logic)
If obs_core_hotkeys.strict_modifiers is true (new default),
hotkey is triggered only if current key modifiers exactly match
the hotkey definition. If false, legacy behavior is selected.
2022-05-28 17:13:03 -07:00
Jim 1705edf8f9
Merge pull request #6475 from GeorgesStavracas/gbsneto/drop-glx
Au revoir, GLX
2022-05-28 17:04:17 -07:00
Norihiro Kamae 8a4b765c9c libobs: Fix rendering null sprite
When rendering an async-source that does not have a frame yet, massive
error `A sprite cannot be drawn without a width/height` was logged.
2022-05-28 16:05:29 -07:00
tytan652 9a33e49087 cmake: Fix enabling PulseAudio monitoring
Also adds a warning if null monitoring is "enabled".
2022-05-28 18:36:36 -04:00
tt2468 f6a77ec0a6 libobs/util: Add %s string replacement for unix time
Adds %s which replaces the keyword with the current unix epoch time.

The %s keyword is common in languages like PHP and Python, and even
some C implementations, but it is not standard so this is a fallback.
2022-05-28 18:30:41 -04:00
jpark37 11da542a0d libobs: Add max_luminance to obs_source_frame
Used in situations where source luminance is greater than HDR nominal
peak setting to avoid clipping by applying BT.2408 maxRGB EETF.
2022-05-27 14:56:47 -07:00
Georges Basile Stavracas Neto ca2d02c2ce Drop GLX renderer
"They must often change, who would be constant in happiness or wisdom"

 - Confucius
2022-05-24 14:31:48 -03:00
Norihiro Kamae 3099b59c2c libobs: Fix hotkey with right-side modifiers
However the hotkeys can be configured with right-side modifiers in UI,
the right modifiers did not work when hitting the hot keys.
This is because `query_hotkeys` in `obs-hotkey.c` was querying states of
only left modifiers.
2022-05-21 16:32:22 -07:00
tt2468 a8c481a80e libobs: Only warn when releasing non-NULL source
Only warn when the pointer provided to obs_source_release() is
non-NULL. In some custom usages of libobs, libobs may be freed before
OBS* smart pointers (like OBSSource) are destructed, leading to a
misleading warning if the pointers have already been cleared with
nullptr.

Previous behavior is basically:
- Clear OBS* pointers with nullptr
- Unload libobs
- Those smart pointers that were cleared will still call
obs_source_release() on destruct
- Warning appears
2022-05-21 15:33:39 -07:00
Claude Heiland-Allen 06f66f3120 libobs: Clamp audio NaN to 0.0f
Add comparison check so that NaN is caught.
Comparisons with NaN always result in false.
NaNs cause problems later in audio encoder.

Note: may break with -ffast-math compiler flag.

Fixes #4885.
2022-05-21 02:24:43 +02:00
jpark37 d233065d60 libobs: Default 10-bit video to sRGB instead of PQ
Matches how VLC operates. HDR is only in effect with proper metadata.
2022-05-17 02:46:52 -07:00
jpark37 4304329d0c libobs: Ignore lower six bits for P010 sources 2022-05-17 02:46:41 -07:00
pkv e66542075d libobs: Fix missing include due to FFmpeg 5 changes
Since [1], avcodec/version.h is not included anymore in codec.h and
therefore is not included any more  in avformat.h.
As a result, LIBAVCODEC_VERSION_INT is no longer defined. This commit
fixes the include.
Since obviously we can't ifdef the avcodec include by referring to an
avcodec version, we ifdef it with the avformat version which was bumped
at the same time [2].

[1] libavcodec: Split version.h
f2da2e1458
[2] doc: Add an entry to APIchanges about changes to version.h and
 version_major.h
f3a0e2ee2b

Signed-off-by: pkv <pkv@obsproject.com>
2022-05-16 16:17:32 -04:00