libobs: Add API function to get version string

Some plugins are using the OBS_VERSION macro obs-config.h to specify the
current version, which will bake the string in to the plugin, making it
so that if the plugin is not replaced for a patch, it could potentially
have the incorrect version.  This makes it so that a plugin/frontend can
get the current version string that's baked in to libobs itself.
This commit is contained in:
jp9000 2017-07-31 13:52:08 -07:00
parent 8b68ccdc13
commit e423492d61
2 changed files with 8 additions and 0 deletions

View file

@ -884,6 +884,11 @@ uint32_t obs_get_version(void)
return LIBOBS_API_VER;
}
const char *obs_get_version_string(void)
{
return OBS_VERSION;
}
void obs_set_locale(const char *locale)
{
struct obs_module *module;

View file

@ -260,6 +260,9 @@ EXPORT bool obs_initialized(void);
/** @return The current core version */
EXPORT uint32_t obs_get_version(void);
/** @return The current core version string */
EXPORT const char *obs_get_version_string(void);
/**
* Sets a new locale to use for modules. This will call obs_module_set_locale
* for each module with the new locale.