|
@@ -307,11 +307,10 @@ static void obs_source_init_audio_hotkeys(struct obs_source *source)
|
|
|
obs_source_hotkey_push_to_talk, source);
|
|
|
}
|
|
|
|
|
|
-static obs_source_t *obs_source_create_internal(const char *id,
|
|
|
- const char *name,
|
|
|
- obs_data_t *settings,
|
|
|
- obs_data_t *hotkey_data,
|
|
|
- bool private)
|
|
|
+static obs_source_t *
|
|
|
+obs_source_create_internal(const char *id, const char *name,
|
|
|
+ obs_data_t *settings, obs_data_t *hotkey_data,
|
|
|
+ bool private, uint32_t last_obs_ver)
|
|
|
{
|
|
|
struct obs_source *source = bzalloc(sizeof(struct obs_source));
|
|
|
|
|
@@ -336,6 +335,7 @@ static obs_source_t *obs_source_create_internal(const char *id,
|
|
|
source->mute_unmute_key = OBS_INVALID_HOTKEY_PAIR_ID;
|
|
|
source->push_to_mute_key = OBS_INVALID_HOTKEY_ID;
|
|
|
source->push_to_talk_key = OBS_INVALID_HOTKEY_ID;
|
|
|
+ source->last_obs_ver = last_obs_ver;
|
|
|
|
|
|
if (!obs_source_init_context(source, settings, name, hotkey_data,
|
|
|
private))
|
|
@@ -388,13 +388,23 @@ obs_source_t *obs_source_create(const char *id, const char *name,
|
|
|
obs_data_t *settings, obs_data_t *hotkey_data)
|
|
|
{
|
|
|
return obs_source_create_internal(id, name, settings, hotkey_data,
|
|
|
- false);
|
|
|
+ false, LIBOBS_API_VER);
|
|
|
}
|
|
|
|
|
|
obs_source_t *obs_source_create_private(const char *id, const char *name,
|
|
|
obs_data_t *settings)
|
|
|
{
|
|
|
- return obs_source_create_internal(id, name, settings, NULL, true);
|
|
|
+ return obs_source_create_internal(id, name, settings, NULL, true,
|
|
|
+ LIBOBS_API_VER);
|
|
|
+}
|
|
|
+
|
|
|
+obs_source_t *obs_source_create_set_last_ver(const char *id, const char *name,
|
|
|
+ obs_data_t *settings,
|
|
|
+ obs_data_t *hotkey_data,
|
|
|
+ uint32_t last_obs_ver)
|
|
|
+{
|
|
|
+ return obs_source_create_internal(id, name, settings, hotkey_data,
|
|
|
+ false, last_obs_ver);
|
|
|
}
|
|
|
|
|
|
static char *get_new_filter_name(obs_source_t *dst, const char *name)
|
|
@@ -4695,3 +4705,10 @@ bool obs_source_audio_active(const obs_source_t *source)
|
|
|
? os_atomic_load_bool(&source->audio_active)
|
|
|
: false;
|
|
|
}
|
|
|
+
|
|
|
+uint32_t obs_source_get_last_obs_version(const obs_source_t *source)
|
|
|
+{
|
|
|
+ return obs_source_valid(source, "obs_source_get_last_obs_version")
|
|
|
+ ? source->last_obs_ver
|
|
|
+ : 0;
|
|
|
+}
|