0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-19 20:32:15 +02:00

libobs: Add obs_view_enum_video_info

This commit is contained in:
derrod 2023-12-01 21:25:46 +01:00 committed by Lain
parent 7c36257cc0
commit 5ea9fcc951
2 changed files with 24 additions and 0 deletions

View File

@ -218,3 +218,21 @@ bool obs_view_get_video_info(obs_view_t *view, struct obs_video_info *ovi)
return false;
}
void obs_view_enum_video_info(obs_view_t *view,
bool (*enum_proc)(void *,
struct obs_video_info *),
void *param)
{
pthread_mutex_lock(&obs->video.mixes_mutex);
for (size_t i = 0, num = obs->video.mixes.num; i < num; i++) {
struct obs_core_video_mix *mix = obs->video.mixes.array[i];
if (mix->view != view)
continue;
if (!enum_proc(param, &mix->ovi))
break;
}
pthread_mutex_unlock(&obs->video.mixes_mutex);
}

View File

@ -955,6 +955,12 @@ EXPORT void obs_view_remove(obs_view_t *view);
EXPORT bool obs_view_get_video_info(obs_view_t *view,
struct obs_video_info *ovi);
/** Enumerate the video info of all mixes using the specified view context */
EXPORT void obs_view_enum_video_info(obs_view_t *view,
bool (*enum_proc)(void *,
struct obs_video_info *),
void *param);
/* ------------------------------------------------------------------------- */
/* Display context */