Commit graph

2593 commits

Author SHA1 Message Date
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
Kurt Kartaltepe d78b27961c libobs-opengl: Add create_texture_from_pixmap for EGL
create_texture_from_pixmap is only implemented for X11/EGL where it will
bind the provided X11 pixmap to a texture with glEGLImageTargetTexture2DOES
2022-05-15 09:08:53 -03:00
Norihiro Kamae d044231bfc libobs/media-io: Sleep to next audio time accurately
Prior to this change, the audio thread roughly waits the time of
`AUDIO_OUTPUT_FRAMES`, and consecutively processes twice or more if the
latency is accumulated. This behavior causes fluctuation of timing to
output audio packets. This change introduces `os_sleepto_ns_fast` so
that the audio packets will be periodically output.
2022-05-15 02:31:31 -07:00
Norihiro Kamae c491594a51 libobs/util: Add os_sleepto_ns_fast
The function `os_sleepto_ns` has a spin loop so it will consume CPU
resource. The new function has same interface but consumes less CPU
resource with a drawback of less precision.
2022-05-15 02:31:31 -07:00
jpark37 8909e44870 libobs: Cap HLG video at 1000 nits 2022-05-14 16:41:03 -07:00
jpark37 d7fb4361a5 libobs: Lock scene to video color space
Fixes studio mode preview on SDR monitor for HDR canvas rendering SDR
source into SDR swap chain. Needs to render SDR source into HDR render
target, and then tonemap into SDR swap chain for preview.
2022-05-14 16:40:28 -07:00
Jim f2ea473373
Merge pull request #6436 from jpark37/jxr-wic
libobs,image-source,UI: Add JXR support on Windows
2022-05-12 16:09:53 -07:00
Norihiro Kamae dd43635e78 libobs: Fix reserved word in variable names
The use of the reserved name caused initialization failure on Linux.
2022-05-11 11:28:20 -04:00
jpark37 0f53dc28bb libobs: Reduce PQ shader math 2022-05-11 03:38:07 -07:00
jpark37 4af20cf080 libobs/graphics: Add color space and WIC support
Only add support for PQ and CCCS JXR images, e.g. Xbox Series X, and
Xbox Game Bar screenshots on Windows.
2022-05-08 15:25:01 -07:00
jpark37 23396e21e5 libobs: Allow transitions to mix CCCS sources
Wasn't sure if CCCS sources should be allowed, but it fits image source.
2022-05-08 14:25:33 -07:00
jpark37 2a0d8d1c9c libobs: Add support for reading I420 PQ
Not normally a valid combination, but Xbox writes 8-bit HDR videos.
2022-05-08 14:12:41 -07:00
jpark37 ed835810b4 libobs: Use tabs in format_conversion.effect 2022-05-08 14:12:41 -07:00
tytan652 7ed5415a2b libobs: Include HEVC files only if enabled 2022-05-07 16:13:21 -07:00
PatTheMav d0d0fe00d8 libobs: Fix compiler warnings 2022-05-04 12:09:04 -04:00
Jim 952988d9ec
Merge pull request #6231 from mvji/prores_pix_fmt
Add support for GPU conversion of YUV422P10LE, YUV444P12LE, YUVA444P12LE
2022-05-04 02:01:27 -07:00
VodBox 6d0e61d40a libobs: Orient images based on EXIF metadata 2022-05-04 01:58:40 -07:00
tytan652 56d673d55c libobs: Fix sign-compare warning
`diff` is used only if greater than `interval_ns` which is unsigned.
So casting it as unsigned will not change its sign.
2022-05-04 01:37:10 -07:00
PatTheMav 6305b6a973 libobs: Fix LINUX_PORTABLE preprocessor macro usage
To simplify logic in source files, `LINUX_PORTABLE` is only defined
if the associated build flag is enabled. Thus straight-forward `ifdef`
checks suffice.
2022-05-03 14:35:08 -04:00
Norihiro Kamae 34e570c5bc Fix indent on multiline comments 2022-04-30 16:06:23 -07:00
jpark37 7ce8cf8477 libobs/media-io: Preserve video side data on remux 2022-04-30 16:05:01 -07:00
jpark37 a82bbb416f libobs: Fix NaNs when using EETF for HLG 2022-04-26 10:11:28 -07:00
jpark37 ed85307f7e libobs: Clean up color.effect a bit 2022-04-26 10:11:28 -07:00
tt2468 9168797361 libobs,obs-outputs: Fix librtmp1 interference
Details in #6226, basically this fixes an issue where OBS links
to the system-installed librtmp1, which is incompatible with our
librtmp.

Co-authored-by: ewhac <ewhac@ewhac.org>
2022-04-25 18:45:05 -07:00
Andrew Story 961b75b58c libobs,UI: Issue appropriate signals on group / ungroup
Due to the way the frontend works, the logic for inserting the row for
the group in the UI was dropped since the new item_add message will
insert one automatically since it forces a refresh of the scene items.
The reliance on that implicit row insertion when grouping items is a
bit of a code smell, although the alternative would be to add logic to
disable handling the signal for that instant, which is probably a
worse choice.
2022-04-24 12:09:38 -07:00
jp9000 f482111791 libobs: Add ability to configure audio buffering latency
Allows a frontend the ability to set the maximum audio buffering
latency, and specify whether that audio buffering is either fixed (to
the maximum audio buffering latency), or dynamically increasing from 0.

This will be useful if the user wishes to output audio to devices or
through a virtual audio device at a guaranteed minimal latency.
2022-04-24 08:44:33 -07:00
jp9000 090613851e libobs: Fix debug spam from maxed buffering
When audio buffering is maxed, certain sources will always repeat the
same debug logging message of "render audio source [name] has gone
backwards", which shouldn't apply if the audio timestamp is 0 rather
than a valid audio value.
2022-04-24 07:59:35 -07:00
jp9000 e3bdb4ca7b libobs: Add ability to use fixed audio buffering
This is in anticipation to adding low audio latency mode, will cause
audio buffering to be fixed rather than dynamically increasing. Having
fixed audio buffering means that audio latency always stays the same
rather than dynamically increasing.
2022-04-24 07:59:10 -07:00
Jim 84e6d77ad5 Revert "libobs: Allow null sei in obs_extract_avc_headers"
This reverts commit baa8d03f78.
2022-04-22 17:00:55 -07:00
jp9000 493f6337f3 libobs/util: Add ConfigFile::OpenString()
For convenience
2022-04-22 12:49:38 -07:00
jp9000 a9ce118794 libobs/util: Add missing extern "C" header guard 2022-04-22 12:48:54 -07:00
jp9000 baa8d03f78 libobs: Allow null sei in obs_extract_avc_headers 2022-04-22 12:48:09 -07:00
mvji 93490da4c2 obs-ffmpeg: Use YVYU for FFmpeg pix fmt YVYU422
This commit also modifies deps/media-playback and libobs.
2022-04-19 19:39:22 +02:00
mvji d3a8ef7128 libobs: Add support for YUV422P10LE, YUV444P12LE, YUVA444P12LE 2022-04-19 19:37:07 +02:00
Richard Stanway 42ce624b13
libobs: Remove unnecessary blend_type assignment
The code pattern for all other assignments skips the default value.
Detected by PVS Studio.
2022-04-19 03:16:48 +02:00
Richard Stanway 0bc955bdf2
libobs: Fix wrong enum in obs_sceneitem_get_blending_method
Detected by PVS Studio.
2022-04-19 03:16:48 +02:00
Norihiro Kamae 7b8793f6c3 libobs: Log audio timestamp exceeding TS_SMOOTHING_THRESHOLD
Timestamp of some of audio sources desync over the time and audio glitch
is suspected to be caused when the difference between `timestamp` and
`next_audio_ts_min` exceeds TS_SMOOTHING_THRESHOLD.
When such condition happens, leave a log message to investigate the
glitch of the audio.
2022-04-18 07:51:07 -07:00
jpark37 74daf5cbaf libobs: Fix color space auto-convert blending
Need premultiplied alpha for this, not straight alpha.
2022-04-18 05:23:34 -07:00
gxalpha 283f7edfd7 libobs: Make obs_volmeter_get_nr_channels default to 0
Defaulting to 1 means that it can't be differentiated between whether a
source really has 1 channel. Now, should a source not have any audio
(yet), this function makes it very clear that this is the case by
returning 0.
2022-04-17 11:54:50 +10:00
jpark37 338608bd67 libobs,UI: Support HLG nominal peak level
HLG output uses MovieLabs-recommended procedure.

- If peak luminance is greater than 1000, use maxRGB EETF to 1000.
- Otherwise, don't tonemap.
- Then use normal HLG conversion procedure with gamma 1.2 (1000 nits).
2022-04-14 09:36:44 -07:00
jpark37 72224f0fae libobs: Remove redundant async_color_format member 2022-04-13 06:23:35 -07:00
jpark37 08f50a7d22 libobs: Add more color handling to default/opaque 2022-04-13 06:23:11 -07:00
jpark37 59dbc3eb81 libobs: Rename Rec. 2020 to Rec. 2100
Rec. 2020 is really an SDR spec, but I think HDR10 made it okay to slap
PQ on it, call it an HDR spec. Rec. 2100 came along after and formally
allowed the use of PQ/HLG, so we should use 2100 instead.
2022-04-10 00:13:52 -07:00
tt2468 af67ef8e57 libobs, UI: Fix --verbose logging for stdout
Verbosity of stdout was previously hardcoded to INFO, while log viewer
and log files had correct verbosity. This makes the behavior of
--verbose make sense in all places.
2022-04-09 16:48:37 -07:00
jpark37 06111d5b10 libobs: Add high-precision sRGB support 2022-04-08 17:19:23 -07:00
jpark37 848e128435 libobs,plugins: Replace video matrix function
video_format_get_parameters_for_format provides a more accurate matrix
than video_format_get_parameters.
2022-04-07 19:28:51 -07:00
jpark37 94fa6d064b libobs: Add video_format_get_parameters_for_format
Video matrix is slightly different based on the number of bits per
channel, so derive from video_format for convenience.
2022-04-07 19:28:51 -07:00
wangshaohui db8145e8a2 obs-ffmpeg, win-dshow, deps/media-playback: Use recommended API for AVCodecContext 2022-04-07 01:59:30 -07:00
wangshaohui 1ec70ddf2b libobs: Fix image source not loading upper case file extensions 2022-04-07 01:58:13 -07:00
jpark37 d72d2552ee libobs: Clear image on color convert
Avoid redrawing potentially stale image from previous frame.
2022-04-07 01:50:27 -07:00
jpark37 8194e9431e libobs: Allow transitions to give placeholder
The fade transition could benefit by providing NULL to differentiate a
real source texture from the transparent placeholder. This would give it
a chance to fade correctly for source transitions.
2022-04-07 01:49:57 -07:00
Jim 7f990677c0
Merge pull request #6158 from jpark37/hdr-format-trc
Add I010/P010 support, video_trc enum
2022-04-04 18:28:14 -07:00
jpark37 737696950d libobs: Fix sign mismatch 2022-04-04 00:44:32 -07:00
jpark37 0ed0f2cdb4 libobs: Add I010/P010 support, TRC enum 2022-04-03 00:01:25 -07:00
jpark37 c455aaedba libobs: Add color spaces to deinterlace shaders 2022-04-02 20:14:31 -07:00
jpark37 6fc5566f38 libobs: Add SWS_CS_BT2020 support 2022-04-02 20:14:31 -07:00
jpark37 e638cc9f82 libobs: Add support for nonlinear SRGB blending 2022-04-02 16:02:41 -07:00
jp9000 525c535459 libobs: Update version to 27.2.4 2022-03-27 16:28:40 -07:00
jpark37 525f964b3d libobs: Add color space management
This provides the framework for automatically compositing SDR and HDR
sources together. Source will need to leverage the new
video_get_color_space to opt into HDR support.
2022-03-26 13:00:34 -07:00
jpark37 a8bc994f07 libobs: Add color spaces to scale shaders 2022-03-26 13:00:34 -07:00
jpark37 f0f0cb3038 libobs: Fix stale active_copy_surfaces entries 2022-03-26 10:06:21 -07:00
PatTheMav aae3a6a466 cmake: Fix diverging prefix padding for OBS status outputs
Status output related to OBS configuration is prefixed with the string
"OBS" and added padding for enabled and disabled features. This padding
was not aligned between platforms.

By moving the padding and prefix decoration into its own function,
both elements are controlled in a single place. CMake scripts were
changed to use this new function `obs_status` instead of using CMake's
`message` function directly.
2022-03-26 09:44:23 -04:00
Exeldro 1e242d3630 libobs: Unload show/hide transition on load if none
Fixes an issue where a scene item's show/hide transition would stick
around if there was no show/hide transition in the loaded data
2022-03-24 23:51:10 -07:00
jp9000 4685276d06 libobs: Refactor small bit of code 2022-03-24 23:03:52 -07:00
jp9000 e236a16715 libobs: Refactor hide/show transition functions
Having two separate functions for each hide/show transition action is
silly and makes code awful.
2022-03-24 22:32:41 -07:00
jp9000 5e2c757cd1 libobs/util: Remove deprecation visibility from swig 2022-03-24 22:32:19 -07:00
jpark37 692ca7efce libobs: Add Rec. 2020 video_colorspace enum values
One for PQ, and one for HLG. Including transfer function as part of the
color space simplifies logic by avoid invalid combinations.
2022-03-24 20:56:19 -07:00
jpark37 87ab39c412 libobs: Render main texture for active color space
Preview will draw SDR white luminance from settings (default 300 nits)
when displayed on an HDR monitor rather than CCCS 80 nits.
2022-03-23 22:35:27 -07:00
jpark37 01c0486aad libobs: Add obs_display_update_color_space 2022-03-23 22:35:26 -07:00
jpark37 cd22df09c9 libobs, UI: Add SDR white nits option 2022-03-23 22:35:26 -07:00
jpark37 eccde48926 libobs/graphics: Add gs_is_monitor_hdr
Only Windows is implemented for now. Mac/Linux return false for now.
2022-03-23 22:35:26 -07:00
jpark37 abddfead2f libobs/graphics: Add color space support 2022-03-23 22:35:26 -07:00
jpark37 6f8b364565 libobs: Add OBS_COUNTOF for array count 2022-03-23 09:15:25 -07:00
jpark37 dd86425559 libobs: Add array check for deinterlace logic
Seeing a rare assert on startup for a media source with deinterlacing
already on. Tested with Yadif 2x. Repro is maybe 10% of OBS launches?
2022-03-22 22:22:50 -07:00
jpark37 fee3703f40 libobs/graphics, libobs-d3d11: Add P010 support 2022-03-20 17:22:13 -07:00
jpark37 76893fb7b9 libobs: Add HEVC parsing functions
Also create obs_nal_find_startcode from obs_avc_find_startcode to share
with HEVC functions.
2022-03-19 15:46:34 -07:00
jpark37 c4fb34897e libobs: NV12 textures only for active GPU encoders
Intel GPUs in particular are slow to copy NV12/P010 textures. We can use
ordinary UNORM textures for CPU encoders.
2022-03-19 15:39:09 -07:00
PatTheMav 1fd7770548
libobs: Update CMakeLists.txt for libobs and associated libraries
Also updates libobs-opengl, libobs-d3d11, libobs-winrt
2022-03-16 23:11:08 +01:00
jpark37 1982ee2597 libobs: Handle filter_texrender format mismatch
This is a possibility in the future where a target might switch between
SDR and HDR.
2022-03-08 12:56:35 -08:00
jpark37 16637baf88 libobs/graphics: Add gs_texrender_get_format 2022-03-08 12:56:35 -08:00
Exeldro 0751416db0 libobs: Fix overflow subtracting unsigned numbers
When offset_size is greater than size, size would overflow
2022-03-08 12:31:43 -08:00
Clayton Groeneveld 3df2f3e069 libobs: Add function to load private sources
If a private source is loaded with the obs_load_source function,
it is loaded as a normal source, so add a new function
to load private sources.
2022-03-08 01:49:24 -08:00
jp9000 c5dabb805f libobs: Update version to 27.2.3 2022-03-02 04:25:58 -08:00
jp9000 a8fd2e42df libobs: Update version to 27.2.2 2022-03-01 11:40:16 -08:00
jpark37 fbcb053cfa libobs/util: Use integer math for Windows timing
Cleaner and faster than double math.
2022-02-28 10:11:03 -08:00
jpark37 4e5906d2b0 libobs: Clamp video timing for safety
os_gettime_ns and os_sleepto_ns may not match up exactly.
2022-02-28 10:11:03 -08:00
jp9000 4f15f1062d libobs/util: Fix rounding error with os_sleepto_ns()
os_sleepto_ns() can occasionally return false on times that the
processor may not have reached yet. The reason is because the
count_target, which converts time_target into a QPC counter, is subject
to a rounding error.

Using numbers I generated from an actual clock cycle on my own CPU, I
can show an example of this occurring: if the clock frequency value is
10000000.0, and you call os_sleepto_ns(42164590320600), it will convert
that number first to a double floating point of its QPC value:
421645903205.99994. Then, because it converts that to a LONGLONG
integer, it of course strips off the decimal point. If you convert
421645903205 *back* to a time value, the new value will be
42164590320500, which is lower than the original value by approximately
100 nanoseconds. While this may seem insignificant, it was apparently
enough to cause the os_sleepto_ns() call in video_sleep() to sometimes
return false despite the current time being lower than the target time,
which would cause it to incorrectly calculate how many frames were
duplicated by subtracting the frame time from the current system time,
divide that by the current frame interval, set the vframe_info.count
value to 0, and thus cause an infinite loop in the encode_gpu()
function because queue_frame now starts returning negative numbers in
perpetuity.

This change fixes some rare reports of users having their video lock up
and disconnect, forcing the user to have to forcibly shut down the
program.

Thanks to Twitch user SNLabat for having the patience to kindly provide
us with a dump file from the freeze, and to Matt for coordinating with
that user to obtain it from them.
2022-02-28 02:07:13 -08:00
obiwac c50c625555 libobs/graphics: gs_query_dmabuf_* on FreeBSD too 2022-02-26 15:36:08 -08:00
jpark37 5d1261eddb libobs: Only resize display if dimensions change 2022-02-26 01:09:07 -08:00
jp9000 f5b64ee33f libobs: Update version to 27.2.1 2022-02-20 16:35:15 -08:00
derrod 269d48f681 libobs: Adjust path for legacy browser source block
The current path would prevent the browser source from loading if OBS
itself is in the "Application Support" folder, where it might end up
when being installed via certain distribution platforms.
This adjusts the existing hack to specifically check for the obs-studio
subfolder where the old browser source library would reside.
2022-02-19 15:45:36 -08:00
Julian Orth 99a6c97b9e libobs: Map wayland keymap with MAP_PRIVATE
Wayland clients are required to use MAP_PRIVATE starting with version 7
of the wl_seat protocol.

Signed-off-by: Julian Orth <ju.orth@gmail.com>
2022-02-16 14:25:16 -03:00
jpark37 3a1124a5fd libobs/util: Fix VS static analysis warnings 2022-02-12 15:06:10 -08:00
jp9000 b68ee1ccae libobs: Update version to 27.2.0 2022-02-10 16:43:18 -08:00
jp9000 edfd5ad604 libobs: Add obs_object abstraction and functions
With this, you can now cast normal obs objects (services, outputs,
sources, encoders) to an obs_object_t, and then use obs_object_*
functions to get references, release references, and similar for weak
object references as well. This allows the ability for the frontend to
use an object of any of those types interchangeably in certain
situations without having to handle each specific type individually.

This is useful because the properties view in particular doesn't care
what type of object it uses, it just needs to be able to hold weak
references to abstract OBS objects.
2022-02-02 22:35:56 -08:00
jp9000 6b944a2f3c libobs: Rename OBSObj to OBSPtr
Makes it a bit more explicit that it's just a pointer RAII, and because
an OBSObject will be added
2022-02-02 22:35:56 -08:00