mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
Base: Move AutoRelease helpers to utils + build fix
- Moves the AutoRelease helpers to utils/Obs.h - Fixes build using obsproject/obs-studio/pull/5580
This commit is contained in:
parent
edf4e942fa
commit
c4ab69481b
@ -129,17 +129,6 @@ bool IsDebugEnabled()
|
|||||||
return !_config || _config->DebugEnabled;
|
return !_config || _config->DebugEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
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*) {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event has been emitted from a vendor.
|
* An event has been emitted from a vendor.
|
||||||
*
|
*
|
||||||
|
@ -29,30 +29,9 @@ with this program. If not, see <https://www.gnu.org/licenses/>
|
|||||||
#pragma pop_macro("strtoll")
|
#pragma pop_macro("strtoll")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "utils/Obs.h"
|
||||||
#include "plugin-macros.generated.h"
|
#include "plugin-macros.generated.h"
|
||||||
|
|
||||||
// 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*);
|
|
||||||
|
|
||||||
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>;
|
|
||||||
|
|
||||||
class Config;
|
class Config;
|
||||||
typedef std::shared_ptr<Config> ConfigPtr;
|
typedef std::shared_ptr<Config> ConfigPtr;
|
||||||
|
|
||||||
|
@ -50,6 +50,19 @@ std::vector<std::string> ConvertStringArray(char **array)
|
|||||||
return ret;
|
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()
|
std::string Utils::Obs::StringHelper::GetObsVersion()
|
||||||
{
|
{
|
||||||
uint32_t version = obs_get_version();
|
uint32_t version = obs_get_version();
|
||||||
|
@ -24,6 +24,31 @@ with this program. If not, see <https://www.gnu.org/licenses/>
|
|||||||
|
|
||||||
#include "Json.h"
|
#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*);
|
||||||
|
|
||||||
|
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>;
|
||||||
|
#endif
|
||||||
|
|
||||||
template <typename T> T* GetCalldataPointer(const calldata_t *data, const char* name) {
|
template <typename T> T* GetCalldataPointer(const calldata_t *data, const char* name) {
|
||||||
void *ptr = nullptr;
|
void *ptr = nullptr;
|
||||||
calldata_get_ptr(data, name, &ptr);
|
calldata_get_ptr(data, name, &ptr);
|
||||||
|
Loading…
Reference in New Issue
Block a user