libobs: Deprecate obs object addref functions

Deprecates:
obs_source_addref()
obs_output_addref()
obs_encoder_addref()
obs_service_addref()
obs_scene_addref()

These functions should be considered unsafe and not used. Instead, use:
obs_source_get_ref()
obs_output_get_ref()
obs_encoder_get_ref()
obs_service_get_ref()
obs_scene_get_ref()

These functions return a pointer to the incremented object only if the
object is still valid, otherwise they will return null, indicating that
the object is no longer valid or is unsafe to use.

The reason why this is being done is because certain third party plugins
seem to be using addref, and are somehow managing to call addref on
sources that have already been fully released. For the sake of safety,
almost all usage of these functions within OBS have also been replaced
as well.
This commit is contained in:
Jim
2022-01-24 12:07:02 -08:00
committed by jp9000
parent 0523c2e5e9
commit 03d9bda387
10 changed files with 66 additions and 6 deletions

View File

@@ -33,6 +33,12 @@
#define FORCE_INLINE inline __attribute__((always_inline))
#endif
#if defined(IS_LIBOBS) || defined(SWIG)
#define OBS_EXTERNAL_DEPRECATED
#else
#define OBS_EXTERNAL_DEPRECATED OBS_DEPRECATED
#endif
#ifdef _MSC_VER
#define EXPORT __declspec(dllexport)
#else