Commit graph

19 commits

Author SHA1 Message Date
Lain 106c7aa61f Update copyrights/names 2023-05-20 01:31:18 -07:00
PatTheMav fb7a9edadc libobs: Fix non-exhaustive switch statements 2023-02-18 15:22:33 -08:00
tytan652 7de0bd350f libobs,plugins: Remove one-case switches 2023-01-16 11:43:47 +01: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
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 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 72224f0fae libobs: Remove redundant async_color_format member 2022-04-13 06:23:35 -07:00
jpark37 06111d5b10 libobs: Add high-precision sRGB support 2022-04-08 17:19:23 -07:00
jpark37 0ed0f2cdb4 libobs: Add I010/P010 support, TRC enum 2022-04-03 00:01: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 9e66a4d1ad libobs: Deinterlace as linear SRGB when needed 2021-01-21 07:42:57 -08:00
jpark37 bdd8d64053 libobs: Separate textures for YUV input
The shaders to unpack YUV information from the same texture were rather
complicated. Breaking them up into separate textures makes the shaders
much simpler, and we can remove the PRECISION_OFFSET hack.

Performance also gets a nice boost on Intel for planar textures.

Intel GPA, SetStablePowerState, Intel HD Graphics 530, 1920x1080

UYVY: 473 us -> 457 us
YUY2: 492 us -> 422 us
YVYU: 491 us -> 441 us
I420: 1637 us -> 505 us
I422: 1644 us -> 482 us
I444: 1653 us -> 504 us
NV12: 1656 us -> 369 us
Y800 (limited): 270 us -> 277 us
Y800 (full): 263 us -> 289 us
RGB (limited): 341 us -> 411 us
BGR3 (limited): 512 us -> 509 us
BGR3 (full): 527 us -> 534 us
2019-08-09 21:14:29 -07:00
jpark37 3ea98b8b0d libobs: Improve timing of unbuffered deinterlacing
There are devices like the GV-USB2 that produce frames with smmoth
timestamps at an uneven pace, which causes OBS to stutter because the
unbuffered path is designed to aggressively operate on the latest frame.

We can make the unbuffered path work by making two adjustments:

- Don't discard the current frame until it has elapsed.
- Don't skip frames in the queue until they have elapsed.

The buffered path still has problems with deinterlacing GV-USB2 output,
but the unbuffered path is better anyway.

Testing:

GV-USB2, Unbuffered: Stuttering is gone!
GV-USB2, Buffered: No regression (still broken).
SC-512N1-L/DVI, Unbuffered: No regression (still works).
SC-512N1-L/DVI, Buffered: No regression (still works).
2019-07-20 21:00:59 -07:00
jp9000 f53df7da64 clang-format: Apply formatting
Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed.  Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
2019-06-23 23:49:10 -07:00
James Park 69c215345a libobs: Simplify YUV conversion
Currently several shaders need "DrawMatrix" techniques to support the
possibility that the input texture is a "YUV" format. Also, "DrawMatrix"
is overloaded for translation in both directions when it is written for
RGB to "YUV" only.

A cleaner solution is to handle "YUV" to RGB up-front as part of format
conversion, and ensure only RGB inputs reach the other shaders. This is
necessary to someday perform correct scale filtering without the cost of
redundant "YUV" conversions per texture tap.

A necessary prerequisite for this is to add conversion support for
VIDEO_FORMAT_I444, and that is now in place. There was already a hack in
place to cover VIDEO_FORMAT_Y800. All other "YUV" formats already have
conversion functions.

"DrawMatrix" has been removed from shaders that only supported "YUV" to
RGB conversions. It still exists in shaders that perform RGB to "YUV"
conversions, and the implementations have been sanitized accordingly.
2019-04-11 23:00:03 -07:00
jp9000 d13fa96851 libobs: Don't use source flags for async buffering
(This commit also modifies the decklink, linux-v4l2, mac-avcapture,
obs-ffmpeg, and win-dshow modules)

Originally, async buffering for sources was supposed to be a
user-controllable flag.  However, that turned out to be less than ideal
because sources (such as the win-dshow plugin) were programmed with
automatic control over their buffering (such as automatically detecting
USB 2.0 capture devices and then enabling in those cases).

The fact that it was a flag caused a design flaw to where buffering
values would be overwritten when a source is loaded from save data.

Because of that, this flag is being deprecated and replaced with a
specific function to enable unbuffered mode instead.
2017-05-13 23:32:40 -07:00
jp9000 d60d222d71 libobs: Mark last video ts even when buffering off
Ensures that the system always has a record of when the last video frame
was played.
2017-02-06 11:43:59 -08:00
jp9000 3cb36bbd51 libobs: Fix deinterlacing discarding flipped status
When rendering the deinterlaced surface, it would not take in to account
whether the async surfaces were marked as flipped or not.
2016-05-01 16:56:21 -07:00
jp9000 07c644c581 libobs: Add deinterlacing API functions
Adds deinterlacing API functions.  Both standard and 2x variants are
supported.  Deinterlacing is set via obs_source_set_deinterlace_mode and
obs_source_set_deinterlace_field_order.

This was implemented in to the core itself because deinterlacing should
happen before effect filters are processed, but after async filters are
processed.  If this were added as a filter, there is the possibility
that a different filter is processed before deinterlacing, which could
mess with the result.  It was also a bit easier to implement this way
due to the fact that that deinterlacing may need to have access to the
previous async frame.

Effects were split in to separate files to reduce load time (especially
for yadif shaders which take a significant amount of time to compile).
2016-03-21 21:22:32 -07:00