Commit graph

2197 commits

Author SHA1 Message Date
Exeldro 93205e5729 libobs/callback: Fix signal_handler_disconnect_global 2021-07-04 04:32:45 -07:00
jpark37 c021338ceb libobs,deps/media-playback: Avoid bitfields
Use unused padding of obs_source_frame/obs_source_frame2 instead.
2021-06-11 07:02:37 -07:00
jp9000 3887c09066 libobs: Update version to 27.0.1 2021-06-10 08:50:41 -07:00
jpark37 1fa152092c libobs: Plumb linear alpha flag
Use union for backwards compatibility.
2021-06-04 19:04:08 -07:00
jpark37 c6937eb559 libobs: Assume sRGB instead of linear for 64 bpp
Should fix regression for 16-bit PNGs.
2021-06-01 19:08:07 -07:00
jpark37 35c07bb7e6 libobs: Restrict direct filtering to SRGB match
Fixes issue where color-correction filter v1 changes from v26 to v27.
2021-05-31 12:33:55 -07:00
jp9000 0ca465c683 libobs: Update version to 27.0.0 2021-05-30 11:54:46 -07:00
jpark37 8cf28ceafd libobs: Straight alpha blend for filtered inputs
This is necessary if the source contains overlapping draws.
2021-05-22 05:48:26 -07:00
jp9000 6b2c3f4845 libobs: Add obs_group_or_scene_from_source()
Makes it a little bit easier to get a scene from either a source or
group.
2021-05-17 16:34:09 -07:00
jpark37 df30e3aca6 libobs: Add srgb.h to CMakeLists.txt 2021-05-13 18:31:18 -07:00
jpark37 a8f0a27a3a libobs: Remove DrawAlphaBlend technique 2021-05-11 13:12:39 -07:00
jpark37 abe1cb1425 libobs: Support premultiplying images on load
Add gs_image_alpha_mode enum for requested alpha handling: straight,
premultiplied with SRGB conversion, and just premultiplied. Both
premultiplied settings behave the same if the image is not SRGB, linear
is assumed.

Add gs_image_file3_t to store the alpha mode.

Add srgb.h file with helper functions.

Clean up vec4.h to use helpers, and remove unused functionality.

Update FFmpeg image loader to perform premultiplication on load.
2021-05-11 03:44:02 -07:00
jpark37 c1948c16b0 libobs: Fix direct rendering test
Pass test if the filter wants SRGB, and the source supports SRGB.
2021-05-11 03:08:49 -07:00
jpark37 83cb43f166 libobs: Mark unused parameters 2021-05-08 14:12:54 -07:00
jpark37 ef72eb70ec libobs: Fix uninitialized variable warning 2021-05-08 14:12:54 -07:00
Exeldro 8810e7ae98 libobs: Fix deadlock removing scene item 2021-05-08 00:32:03 -07:00
jpark37 5a8842d9f0 libobs: Support 64 bpp images
Useful for loading high-precision alpha channels.
2021-05-05 09:43:34 -07:00
jpark37 de7cec3dee libobs: Add DrawAlphaBlend technique
Useful when fixed-function blend does not provide enough precision.
2021-05-05 09:43:34 -07:00
jpark37 ae7718a765 libobs, obs-filters: SRGB backwards compatibility
Add OBS_SOURCE_SRGB to indicate sources that support SRGB rendering. We
can use this flag to know which sources do not know how to handle SRGB,
and disable accordingly inside obs_source_main_render().

We can also use this flag to clean up the filter interface and remove
the SRGB-specific functions. We also need to disable direct rendering if
the filter source wants to render SRGB, but the parent source does not
support it.

Scenes and groups are marked as having SRGB support, and those are
internal sources that we control.
2021-05-03 01:19:56 -07:00
jp9000 60447872c0 libobs: Add obs_source_reset_settings()
Allows the ability to reset (erase) a source's existing settings and
replace them with new settings. This is useful for things such as
reverting to older settings.
2021-04-30 18:37:38 -07:00
jp9000 0fd1238d45 libobs: Add functions to backup/restore filters
Adds functions to backup and restore filters (along with their order) on
a specified source. Useful for undo/redo operations.
2021-04-30 00:11:52 -07:00
jpark37 a44e09f2e4 libobs: Don't force premultiplied alpha on filters
Many filters need to remultiply alpha on output.
2021-04-28 18:09:52 -07:00
Jim 81e9ad818f
Merge pull request #4587 from jpark37/alpha-hack
Apply alpha in nonlinear space for images and async video
2021-04-25 11:26:21 -07:00
tt2468 cb6a381823 libobs: Fix crash in missingfiles when source is invalid 2021-04-25 09:36:50 -07:00
jpark37 aed52412d4 libobs: Render async video with DrawNonlinearAlpha
Match previous OBS alpha behavior.

DrawNonlinearAlpha requires premultiplied alpha blend state.
2021-04-25 02:13:01 -07:00
jpark37 50dfa566e6 libobs: Filter using premultiplied alpha
Convert incoming straight alpha color to premultiplied at filter begin,
and process premultiplied value at filter end.

If direct rendering is allowed, we assume the input source outputs
premultiiplied alpha. If not, that source will need to be updated.
2021-04-25 01:27:19 -07:00
jpark37 840e2b3d43 libobs: Add DrawNonlinearAlpha technique
This allows OBS to mimic other programs that incorrectly use alpha.

Requires premultiplied blend state.
2021-04-24 17:18:42 -07:00
jp9000 74c2379eba libobs: Add obs_data_get_last_json()
Helper function to return the last generated json string for this
object.
2021-04-23 12:38:50 -07:00
jp9000 09ffab6f90 libobs: Add helper func to find a scene by name 2021-04-16 20:28:14 -07:00
jp9000 0dc1e01b5b libobs: Save obs_data json in compact form 2021-04-16 19:09:55 -07:00
tt2468 7b2b723270 libobs: Return target vec not current when within EPSILON
If current vector is within EPSILON, it would return the current,
when logically the target should be returned instead.
2021-04-13 05:31:00 -07:00
Exeldro b9a2fe7851 libobs: Add transition save/load functions
Moves the transition saving/loading to functions, and refactors existing
code to use those functions instead.
2021-04-11 10:10:54 -07:00
Ford Smith 2932cd0fd3 UI: Fix wrong behavior with undo/redo and groups 2021-04-10 11:28:04 -07:00
jp9000 d332a8ea76 libobs: Add obs_source_is_scene() 2021-04-09 04:30:30 -07:00
jp9000 33c5563c1e libobs: Add obs_obj_is_private()
Returns true if an obs object is considered private. (Author's note: the
concept of "private" objects is not ideal, but we're stuck with it for
now)
2021-04-09 04:30:30 -07:00
jp9000 ca08df9fb2 libobs: Add obs_source_load2()
Allows loading a source and all of its filters automatically.
Previously, the original obs_source_load would not load filters.
2021-04-09 04:30:29 -07:00
jp9000 0ecf24d0ed libobs: Add obs_source_enum_full_tree()
Allows the ability to enumerate all sources and subsources in a source's
hierarchy, regardless of whether they're active or not.
2021-04-09 04:30:29 -07:00
jpark37 9220316700 libobs: Add filter functions for SRGB support
This way, legacy filters can use the original functions without
triggering SRGB support.
2021-04-04 00:58:38 -07:00
Richard Stanway 6078dfef76 libobs: Don't save temporarily removed sources
The only references to these sources exist in the undo buffer, they are
not attached to a scene and cause issues when loaded on the next
startup.
2021-04-04 00:09:17 +02:00
Richard Stanway cdbb216bd0 libobs: Remove unnecessary null check 2021-04-03 00:31:07 +02:00
jpark37 62bc8f905a libobs: obs-scene type fixes
Replace "rot" int usages with double.

Add explicit narrowing casts to fix warnings.
2021-03-31 06:07:11 -07:00
jpark37 0a121b6d22 flibobs: Fix unnecessary truncation 2021-03-31 06:07:11 -07:00
jpark37 3c09074ed5 libobs/util: Skip pointless free for null 2021-03-31 06:07:11 -07:00
jpark37 d5e265d7dd libobs/util: Fix warnings for about null usages 2021-03-31 06:07:11 -07:00
Exeldro edc439b0a5 libobs: fix property group check 2021-03-30 03:44:23 -07:00
Jim e92c1fe6bc
Merge pull request #4287 from GeorgesStavracas/gbsneto/pipewire
Wayland / PipeWire capture
2021-03-30 03:16:46 -07:00
Jim 5d87f3c00b
Merge pull request #3426 from Programatic/undo_redo
UI: Implement Undo/Redo System
2021-03-30 03:16:24 -07:00
Kurt Kartaltepe 705a47b0e4 libobs, libobs-opengl: add drm format param
This adds the drmbuf format as a parameter separate from the obs texture
format that will be used. drmbuf's may have a variety of formats that we
need to pass correctly to get a usable texture which may correspond to
multi-platform texture formats.
2021-03-29 17:00:31 -03:00
Ford Smith 3a620c485e UI: Undo/Redo Transformations
Implements undo/redo for transformations of sources, both through
preview and the transformations properties.
2021-03-29 03:06:26 -04:00
Ford Smith 60d95cb5bd UI/libobs: Undo/Redo Sources and Scenes
Implements the Undo/Redo for scenes and sources, ranging from renaming,
deletion, addition. It also adds several elements to libobs that were
designed to facilitate undo/redo, and should not affect the rest of
libobs.
2021-03-29 03:06:26 -04:00