Commit Graph

2399 Commits (302862fe33097f2a6ec68fbde82ad12b41943910)

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