Commit Graph

30 Commits (master)

Author SHA1 Message Date
jpark37 e638cc9f82 libobs: Add support for nonlinear SRGB blending 2022-04-02 16:02:41 -07:00
jw0z96 447b17e75e libobs: Implement additional source blending modes 2021-12-20 09:06:38 -08: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
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
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 e01fcae133 libobs: UI: Fix rotated line scale
The line drawing functions previously assumed the upper-left 3x3 for
box_transform only held scale. The matrix can also hold rotation, so
pass in scale separately.

Fixes https://obsproject.com/mantis/view.php?id=1442
2019-04-19 06:35:42 -07:00
jp9000 35704c4c04 libobs: Remove group_sceneitem from obs_scene struct
(This commit also modifies UI)

Removes obs_scene::group_sceneitem and replaces it with
obs_scene::is_group.  Changes a number of other functions related to
groups so that a group is not inherently tied to a specific scene, and
helps allow a single group to be referenced in multiple scenes if
desired.
2018-07-15 19:01:14 -07:00
jp9000 26d5560da3 libobs: Add scene item grouping
Allows the ability to group scene items.  Groups internally are
sub-scenes, which allows the ability to add unique filters and
transforms to each group.
2018-06-03 15:04:39 -07:00
jp9000 690f738a76 libobs: Add custom size support to scenes
Allows scenes to have a custom size.  Mainly used for grouping, but can
be extended with public API later.
2018-06-03 15:04:39 -07:00
jp9000 ff52d34027 libobs: Defer and refactor scene item transform update
Defers updating the scene item transform to the graphics thread to
reduce the number of transform update calls.
2018-06-03 15:04:39 -07:00
jp9000 2ef00ecec4 libobs: Add private settings to scene items/sources
Allows setting and sharing of user data for sources and scene items.
2017-09-13 21:17:44 -07:00
cg2121 fce078d997 UI, libobs: Add ability to lock individual scene items
Adds a lock checkbox to allow the user to lock a specific scene item.

Closes jp9000/obs-studio#949
2017-06-27 10:27:57 -07:00
jp9000 2c74fc36e2 libobs: Add scene item IDs
Adds a method of uniquely identifying scene items, as well as finding
those scene items via that unique ID.
2017-05-15 00:18:18 -07:00
Ryan Foster be98cee2a0 Fix various typos across multiple modules 2017-04-25 22:39:42 -04:00
jp9000 d49833830c libobs: Add ability to use scale filters on scene items
Allows the ability to use scale filters such as point, bicubic, lanczos
on specific scene items, disabled by default.  When using one of the
latter two options, if the item's scale is under half of the source's
original size, it uses the bilinear low resolution downscale shader
instead.
2016-06-29 08:00:54 -07:00
jp9000 eb1ee87f38 libobs: Add functions to crop individual scene items
Renders the scene item to a texture if crop is enabled; otherwise
renders directly.
2016-03-30 18:59:36 -07:00
jp9000 0d7a969ebf libobs: Add functions to defer scene item update
Allows the ability to defer updating the item transform until all
functions have been executed.
2016-03-30 18:35:59 -07:00
jp9000 3c68196c5c libobs: Buffer scene item visibility actions
This buffers scene item visibility actions so that if
obs_sceneitem_set_visible to true or false, that it will ensure that the
action is mapped to the exact sample point time in which
obs_sceneitem_set_visible is called.  Mapping to the exact sample point
isn't necessary, but it's a nice thing to have.
2016-01-26 11:49:36 -08:00
jp9000 40d6f986e6 libobs: Split scene mutex to improve performance
Splits the scene mutex in to an audio/video mutex to allow video/audio
thread to use the same data at the same time without locking on each
other.
2016-01-26 11:49:34 -08:00
Palana 23a2228142 libobs: Add scene item hotkeys 2015-05-11 20:45:25 +02:00
jp9000 b23f8cc6e1 Scenes: Implement more item positioning features
There are a ridiculous number of features related to scaling and
positioning due to requests by a number of people who complained that
they hated the way that OBS1 would always resize their sources when the
source's base size changed.  There were also people who wanted more
control for how the resizing was handled, or the ability to completely
prevent resizing entirely if desired.  So I made it so that you can
optionally use a 'bounds' system, which allows you to specify different
styles of controlling resizing.

If disabled, the source will always automatically resize and only the
base scale is applied.  If enabled, you have a variety of different ways
to limit/control how it can resize within the bounds, or make it so it
can't resize at all.  You can also control alignment within that
bounding box, so you can make it so that a source always aligns to a
side or corner of the box.

I also added an alignment value which changes how the source is oriented
relative to the position of the scene item.  For example, setting
bottom-right alignment will make it so that the position of the item is
the bottom right corner of the source.  When the source resizies, it
will resize leftward and upward in that case, which solves the problem
of how a source resizes relative to a desired position.
2014-06-15 20:33:13 -07:00
jp9000 154e0c59e1 Use atomic functions where appropriate
Also, rename atomic functions to be consistent with the rest of the
platform/threading functions, and move atomic functions to threading*
files rather than platform* files
2014-03-16 18:26:46 -07:00
jp9000 8e81d8be56 Revamp API and start using doxygen
The API used to be designed in such a way to where it would expect
exports for each individual source/output/encoder/etc.  You would export
functions for each and it would automatically load those functions based
on a specific naming scheme from the module.

The idea behind this was that I wanted to limit the usage of structures
in the API so only functions could be used.  It was an interesting idea
in theory, but this idea turned out to be flawed in a number of ways:

 1.) Requiring exports to create sources/outputs/encoders/etc meant that
     you could not create them by any other means, which meant that
     things like faruton's .net plugin would become difficult.

 2.) Export function declarations could not be checked, therefore if you
     created a function with the wrong parameters and parameter types,
     the compiler wouldn't know how to check for that.

 3.) Required overly complex load functions in libobs just to handle it.
     It makes much more sense to just have a load function that you call
     manually.  Complexity is the bane of all good programs.

 4.) It required that you have functions of specific names, which looked
     and felt somewhat unsightly.

So, to fix these issues, I replaced it with a more commonly used API
scheme, seen commonly in places like kernels and typical C libraries
with abstraction.  You simply create a structure that contains the
callback definitions, and you pass it to a function to register that
definition (such as obs_register_source), which you call in the
obs_module_load of the module.

It will also automatically check the structure size and ensure that it
only loads the required values if the structure happened to add new
values in an API change.

The "main" source file for each module must include obs-module.h, and
must use OBS_DECLARE_MODULE() within that source file.

Also, started writing some doxygen documentation in to the main library
headers.  Will add more detailed documentation as I go.
2014-02-12 08:04:50 -07:00
jp9000 103ef75310 Improve thread safety for scene items
Scene items previously were removed by calling obs_sceneitem_destroy,
but this proved to be a potential race condition where two different
threads could try to destroy the same scene item at the same time.

Instead of doing that, reference counting is now used on scene items,
and an explicit obs_sceneitem_remove function is used instead for item
removal, which sets a 'removed' variable to ensure it can only be called
exactly one time.
2014-01-30 01:31:52 -07:00
jp9000 1c91e0d0e0 forgot to lock the mutex when destroying a scene item 2014-01-01 10:28:37 -07:00
jp9000 966c091078 make scene items use linked list rather than array (containers are a bad habit), add a few functions for getting scene item information, also use a mutex to prevent race conditions when using the linked list 2014-01-01 10:22:55 -07:00
jp9000 8298fa4dc7 With the permission of my fellow contributors, I'm switching obs-studio back to GPL v2+ to prevent issues between this project and the original OBS project, and for personal reasons to avoid legal ambiguity (not political reasons, I admittedly would prefer GPL v3+) 2013-12-02 22:24:38 -07:00
jp9000 9570f0b8d7 change names, fix some bugs, minor GL/D3D fixes, update tests, fix effect files, output a little more debug information 2013-10-14 12:37:52 -07:00
Peter SZTANOJEV 0301b24ace modernize header guards to #pragma once 2013-10-14 13:21:15 +02:00
jp9000 f255ae1922 first commit 2013-09-30 19:37:13 -07:00