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

2443 Commits

Author SHA1 Message Date
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