libobs: Add obs_scene_get_ref()

This commit is contained in:
Jim 2022-01-24 13:02:39 -08:00
parent b77ccceae7
commit f29e5ffbc7
2 changed files with 11 additions and 0 deletions

View file

@ -1649,6 +1649,15 @@ void obs_scene_addref(obs_scene_t *scene)
obs_source_addref(scene->source);
}
obs_scene_t *obs_scene_get_ref(obs_scene_t *scene)
{
if (!scene)
return NULL;
if (obs_source_get_ref(scene->source) != NULL)
return scene;
return NULL;
}
void obs_scene_release(obs_scene_t *scene)
{
if (scene)

View file

@ -1593,6 +1593,8 @@ EXPORT obs_scene_t *obs_scene_duplicate(obs_scene_t *scene, const char *name,
EXPORT void obs_scene_addref(obs_scene_t *scene);
EXPORT void obs_scene_release(obs_scene_t *scene);
EXPORT obs_scene_t *obs_scene_get_ref(obs_scene_t *scene);
/** Gets the scene's source context */
EXPORT obs_source_t *obs_scene_get_source(const obs_scene_t *scene);