libobs, docs: Add function to get source version

This commit is contained in:
Clayton Groeneveld 2021-10-28 03:07:05 -05:00 committed by jp9000
parent 92f5afae51
commit 1a7a10048c
3 changed files with 20 additions and 0 deletions

View file

@ -892,6 +892,12 @@ General Source Functions
---------------------
.. function:: uint32_t obs_source_get_version(const obs_source_t *source)
:return: Get version of a source
---------------------
.. function:: signal_handler_t *obs_source_get_signal_handler(const obs_source_t *source)
:return: The source's signal handler

View file

@ -5384,3 +5384,14 @@ void obs_source_restore_filters(obs_source_t *source, obs_data_array_t *array)
da_free(cur_filters);
}
uint32_t obs_source_get_version(const obs_source_t *source)
{
if (!obs_source_valid(source, "obs_source_get_version"))
return 0;
if (!source->info.version)
return 1;
return source->info.version;
}

View file

@ -1177,6 +1177,9 @@ EXPORT void obs_source_remove_caption_callback(obs_source_t *source,
obs_source_caption_t callback,
void *param);
/** Get version of a source **/
EXPORT uint32_t obs_source_get_version(const obs_source_t *source);
enum obs_deinterlace_mode {
OBS_DEINTERLACE_MODE_DISABLE,
OBS_DEINTERLACE_MODE_DISCARD,