Commit Graph

214 Commits (master)

Author SHA1 Message Date
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
PatTheMav ff7f756886 libobs: Explicitly mark variables as unused 2022-07-10 09:59:55 +10: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
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
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
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
jpark37 06111d5b10 libobs: Add high-precision sRGB support 2022-04-08 17:19:23 -07:00
jpark37 e638cc9f82 libobs: Add support for nonlinear SRGB blending 2022-04-02 16:02:41 -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
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
Jim 0523c2e5e9 libobs: Replace addref calls with get_ref 2022-01-24 14:06:50 -08:00
Jim f29e5ffbc7 libobs: Add obs_scene_get_ref() 2022-01-24 14:06:47 -08:00
jw0z96 447b17e75e libobs: Implement additional source blending modes 2021-12-20 09:06:38 -08:00
gxalpha c104e59bd4 libobs: Add obs_scene_prune_sources
Adds a function that goes through the scene and releases all sources
that have been removed.
2021-11-23 22:00:47 -08:00
tt2468 529a412840 libobs: Block sceneitem create if item source is removed
There are some cases where an item may attempt to be created for a
removed source.

Previously, items created from removed sources would lead to the item
itself being saved, but the underlying source not being saved. While
this does not break OBS immediately, it means that the source along
with all associated items will disappear on OBS reload.

This prevents the item from being created in the first place, reducing
the chances of user work being lost.
2021-09-13 01:37:51 -07:00
jp9000 b2839c3ec3 libobs: Actually fix ungroup deadlock
66c27c2cea (#4664) was mistakenly merged. It was also the incorrect
way to fix the deadlock. Because duplicate_item_data() already defers
the texture creation process, we can just add a param to
obs_scene_add_internal() which allows us to exclude the creation of the
item texture for this specific case. The texture will then automatically
be created later before it's used. There was no reason to be creating
the texture there, as it was unnecessary.

Properly fixes obsproject/obs-studio#3166
2021-09-11 22:00:08 -07:00
jp9000 551eff0c26 Revert "libobs: Avoid request graphics lock after full_lock(scene)."
This reverts commit 66c27c2cea.
2021-09-11 21:07:43 -07:00
wangshaohui 66c27c2cea libobs: Avoid request graphics lock after full_lock(scene).
As logic in video render thread, gs lock (obs_enter_graphics) should be requested before full_lock(scene).
However in function obs_sceneitem_group_ungroup called from UI thread, the order for requesting locks are contrary.
2021-09-11 15:49:25 -07:00
jpark37 353868e87c libobs: Fix pthread mutex leaks 2021-08-23 22:57:10 -07:00
liu.haibin d6c77964c0 libobs: Fix stack buffer overflow in build_current_order_info 2021-07-20 08:46:53 -07:00
jpark37 7c72fd1d4c libobs: Plumb texcoord hint to reduce GPU cost
In order to do linear-correct filtering cheaply when scale filtering is
disabled, we need to know whether or not texture coordinates will always
sample from texel centers. This can be computed at the scene item level
relatively easily, and passed along to sources when rendering. Scene
items will use obs_source_set_texcoords_centered to set hint status, and
sources will use obs_source_get_texcoords_centered to retrieve it.
2021-07-11 08:26:29 -07:00
Exeldro 8810e7ae98 libobs: Fix deadlock removing scene item 2021-05-08 00:32:03 -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
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
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
Jim 5d87f3c00b
Merge pull request #3426 from Programatic/undo_redo
UI: Implement Undo/Redo System
2021-03-30 03:16:24 -07: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
Exeldro 32e7ba1abe UI: Add visibility transitions
This also modifies libobs.

This adds the ability for scene items to have transitions
when their visibility is toggled.
2021-03-16 22:15:16 -07:00
jpark37 d48e77385c libobs: Update compare-exchange pattern
Use function that updates previous value automatically.

Also load initial value seq_cst to be safe.
2021-02-03 08:51:31 -08:00
Kurt Kartaltepe 5efb10a5e2 libobs: Fix leaking obs-internal.h
Removes prior attempt to expose libcaption headers which really shouldnt
have public. This instead moves the obs-internal include out of the
public obs-scene.h and into it's implementation.
2021-01-28 23:59:02 -08:00
Exeldro 44ace7618f libobs: Duplicate source name for private sources
Allows for identification of sources in studio mode
2021-01-27 00:24:33 -08:00
jpark37 72efe8b942 libobs: Update render_item to enable linear SRGB
Does nothing without linear-aware modifications to sources.
2021-01-21 07:42:56 -08:00
Richard Stanway d0cbc83da2 libobs: Avoid unnecessary mallocs in audio processing 2021-01-02 14:53:19 +01:00
Clayton Groeneveld fdd34c35fc libobs: Set lock state when duplicating scene item
Fixes bug where the lock state wouldn't be copied when duplicating
a scene.
2020-12-31 13:26:39 -08:00
Jim 665180350d
Merge pull request #2657 from hselasky/improvement
libobs: Implement and use better scaling function for 64-bit integers
2020-05-21 18:07:53 -07:00
Exeldro 74b9ae07f3 libobs: Don't allow duplicating scene sources 2020-04-17 12:40:25 +02:00
Hans Petter Selasky 0e4ea14ba1 libobs: Implement and use better scaling function for 64-bit integers
As os_gettime_ns() gets large the current scaling methods, mostly by casting
to uint64_t, may lead to numerical overflows. Sweep the code and use
util_mul_div64() where applicable.

Signed-off-by: Hans Petter Selasky <hps@selasky.org>
2020-04-05 20:27:28 +02:00
Richard Stanway 4dfb572547 libobs: Check return value from obs_scene_add_internal
Errors in obs_scene_add_internal would cause a crash as the null item is
passed to various signal handlers.
2020-03-12 00:02:46 +01:00
jp9000 3992bd247c libobs: Fix groups not being recognized as groups
The id of the source was being pointer compared rather than string
compared, so naturally with the source versioning system where the
string is duplicated, the pointers no longer matched.
2020-03-09 17:08:51 -07:00
jp9000 476c332a41 libobs: Compare scene/group ids by strcmp 2020-03-09 05:57:01 -07:00
jp9000 6970cc32c2 libobs: Remove unused variable 2020-02-12 18:31:18 -08:00
jp9000 94d4bfdb1c libobs: Restore order 2020-02-09 18:36:58 -08:00