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:
parent
7c36257cc0
commit
5ea9fcc951
@ -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);
|
||||
}
|
||||
|
@ -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 */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user