I encountered a situation where I wanted to delete a callback for a
signal while inside of that signal. However it would hard lock, and
even after that, it would mess up the loop for the callback list.
So, change the mutex of the individual signals to a recursive-style
mutex, and then if a callback of a signal is deleted while currently in
that signal, just mark it for deletion, which will happen after the
signal is complete.
When a source/output/etc has a property of a 'list' type, there was no
way to get the names associated with its values. That, and it only
supported lists of either text, or enums (0..[value] only).
Now, you can associate translated names with those values, and use
integer, float, or string values. Put it all in to one function as well
to simplify its usage.
I plan on using this to help get enumerations from devices/etc for
certain types of sources. For example, if I get the properties of an
audio source, I'd like to have a list of available devices with it as
well.
- Signals and dynamic callbacks now require declarations to be made
before being used. What this does is allows us to get information
about the functions dynamically which can be relayed to the user and
plugins for future extended usage (this should have big implications
later for scripting in particular, hopefully).
- Reduced the number of types calldata uses from "everything I could
think of" to simply integer, float, bool, pointer/object, string.
Integer data is now stored as long long. Floats are now stored as
doubles (check em).
- Use a more consistent naming scheme for lexer error/warning macros.
- Fixed a rather nasty bug where switching to an existing scene would
cause it to increment sourceSceneRefs, which would mean that it would
never end up never properly removing the source when the user clicks
removed (stayed in limbo, obs_source_remove never got called)
There were a *lot* of warnings, managed to remove most of them.
Also, put warning flags before C_FLAGS and CXX_FLAGS, rather than after,
as -Wall -Wextra was overwriting flags that came before it.
When using signal callbacks, there is rarely a need to check to see if
the callback paramters are actually validl; in those cases, if they are
invalid, then the signal is being used incorrectly. The calldata_get*
functions are meant to be used more for when using dynamic function
calls rather than when using signals. The calldata_get* functions made
it so that you have to declare your varaibles, and then call that
function to assign that value to those variables, which was slightly
annoying to constantly have to do over and over.
Therefore I created a few extra functions for returning the value
without having to check for validity. Although you would think this
would be an issue for maintaining, keep in mind that these functions
return base types. Admittedly, these functions are merely for
convenience.