libobs: Add obs_enum_all_sources()
There is currently no way to enumerate *all* sources in OBS. Only inputs and scenes have a way to be enumerated. Some applications like obs-websocket have features that need to take advantage of enumerating all sources in order to function properly.
This commit is contained in:
@@ -1526,6 +1526,13 @@ static inline void obs_enum(void *pstart, pthread_mutex_t *mutex, void *proc,
|
||||
pthread_mutex_unlock(mutex);
|
||||
}
|
||||
|
||||
void obs_enum_all_sources(bool (*enum_proc)(void *, obs_source_t *),
|
||||
void *param)
|
||||
{
|
||||
obs_enum(&obs->data.first_source, &obs->data.sources_mutex, enum_proc,
|
||||
param);
|
||||
}
|
||||
|
||||
void obs_enum_outputs(bool (*enum_proc)(void *, obs_output_t *), void *param)
|
||||
{
|
||||
obs_enum(&obs->data.first_output, &obs->data.outputs_mutex, enum_proc,
|
||||
|
Reference in New Issue
Block a user