Utils/Obs: Fix build (again)

This commit is contained in:
tt2468 2021-12-17 15:48:59 -08:00
parent 84e649a6f7
commit a40e79e987
2 changed files with 24 additions and 28 deletions

View File

@ -50,19 +50,6 @@ std::vector<std::string> ConvertStringArray(char **array)
return ret;
}
#if !defined(OBS_HAS_AUTORELEASE)
void ___source_dummy_addref(obs_source_t*) {}
void ___weak_source_dummy_addref(obs_weak_source_t*) {}
void ___scene_dummy_addref(obs_scene_t*) {}
void ___sceneitem_dummy_addref(obs_sceneitem_t*) {}
void ___data_dummy_addref(obs_data_t*) {}
void ___data_array_dummy_addref(obs_data_array_t*) {}
void ___output_dummy_addref(obs_output_t*) {}
void ___data_item_dummy_addref(obs_data_item_t*) {}
void ___data_item_release(obs_data_item_t* dataItem){ obs_data_item_release(&dataItem); }
void ___properties_dummy_addref(obs_properties_t*) {}
#endif
std::string Utils::Obs::StringHelper::GetObsVersion()
{
uint32_t version = obs_get_version();

View File

@ -24,29 +24,38 @@ with this program. If not, see <https://www.gnu.org/licenses/>
#include "Json.h"
#if !defined(OBSSourceAutoRelease)
#define OBS_HAS_AUTORELEASE
// Autorelease object definitions
void ___source_dummy_addref(obs_source_t*);
void ___weak_source_dummy_addref(obs_weak_source_t*);
void ___scene_dummy_addref(obs_scene_t*);
void ___sceneitem_dummy_addref(obs_sceneitem_t*);
void ___data_dummy_addref(obs_data_t*);
void ___data_array_dummy_addref(obs_data_array_t*);
void ___output_dummy_addref(obs_output_t*);
void ___data_item_dummy_addref(obs_data_item_t*);
void ___data_item_release(obs_data_item_t*);
void ___properties_dummy_addref(obs_properties_t*);
inline void ___properties_dummy_addref(obs_properties_t*){}
using OBSPropertiesAutoDestroy = OBSRef<obs_properties_t*, ___properties_dummy_addref, obs_properties_destroy>;
#if !defined(OBS_AUTORELEASE)
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<obs_source_t*, ___source_dummy_addref, obs_source_release>;
using OBSWeakSourceAutoRelease = OBSRef<obs_weak_source_t*, ___weak_source_dummy_addref, obs_weak_source_release>;
using OBSSceneAutoRelease = OBSRef<obs_scene_t*, ___scene_dummy_addref, obs_scene_release>;
using OBSSceneItemAutoRelease = OBSRef<obs_sceneitem_t*, ___sceneitem_dummy_addref, obs_sceneitem_release>;
using OBSDataAutoRelease = OBSRef<obs_data_t*, ___data_dummy_addref, obs_data_release>;
using OBSDataArrayAutoRelease = OBSRef<obs_data_array_t*, ___data_array_dummy_addref, obs_data_array_release>;
using OBSOutputAutoRelease = OBSRef<obs_output_t*, ___output_dummy_addref, obs_output_release>;
using OBSDataItemAutoRelease = OBSRef<obs_data_item_t*, ___data_item_dummy_addref, ___data_item_release>;
using OBSPropertiesAutoDestroy = OBSRef<obs_properties_t*, ___properties_dummy_addref, obs_properties_destroy>;
using OBSEncoderAutoRelease = OBSRef<obs_encoder_t *, ___encoder_dummy_addref, obs_encoder_release>;
using OBSServiceAutoRelease = OBSRef<obs_service_t *, ___service_dummy_addref, obs_service_release>;
using OBSWeakSourceAutoRelease = OBSRef<obs_weak_source_t*, ___weak_source_dummy_addref, obs_weak_source_release>;
using OBSWeakOutputAutoRelease = OBSRef<obs_weak_output_t *, ___weak_output_dummy_addref, obs_weak_output_release>;
using OBSWeakEncoderAutoRelease = OBSRef<obs_weak_encoder_t *, ___weak_encoder_dummy_addref, obs_weak_encoder_release>;
using OBSWeakServiceAutoRelease = OBSRef<obs_weak_service_t *, ___weak_service_dummy_addref, obs_weak_service_release>;
#endif
template <typename T> T* GetCalldataPointer(const calldata_t *data, const char* name) {