diff --git a/libobs/obs.hpp b/libobs/obs.hpp index 16736be7d..0185f9732 100644 --- a/libobs/obs.hpp +++ b/libobs/obs.hpp @@ -47,6 +47,52 @@ using OBSWeakEncoder = OBSRef; +inline void ___source_dummy_addref(obs_source_t *){}; +inline void ___scene_dummy_addref(obs_scene_t *){}; +inline void ___sceneitem_dummy_addref(obs_sceneitem_t *){}; +inline void ___data_dummy_addref(obs_data_t *){}; +inline void ___data_array_dummy_addref(obs_data_array_t *){}; +inline void ___output_dummy_addref(obs_output_t *){}; +inline void ___encoder_dummy_addref(obs_encoder_t *){}; +inline void ___service_dummy_addref(obs_service_t *){}; + +inline void ___weak_source_dummy_addref(obs_weak_source_t *){}; +inline void ___weak_output_dummy_addref(obs_weak_output_t *){}; +inline void ___weak_encoder_dummy_addref(obs_weak_encoder_t *){}; +inline void ___weak_service_dummy_addref(obs_weak_service_t *){}; + +using OBSSourceAutoRelease = + OBSRef; +using OBSSceneAutoRelease = + OBSRef; +using OBSSceneItemAutoRelease = + OBSRef; +using OBSDataAutoRelease = + OBSRef; +using OBSDataArrayAutoRelease = + OBSRef; +using OBSOutputAutoRelease = + OBSRef; +using OBSEncoderAutoRelease = + OBSRef; +using OBSServiceAutoRelease = + OBSRef; + +using OBSWeakSourceAutoRelease = + OBSRef; +using OBSWeakOutputAutoRelease = + OBSRef; +using OBSWeakEncoderAutoRelease = + OBSRef; +using OBSWeakServiceAutoRelease = + OBSRef; + template class OBSRef { T val;