libobs: Add "monitoring by default" source cap

(This also modifies the UI module)

Adds the ability for a source to monitor by default.  This is mainly
aimed at browser sources, so that they do not stop outputting audio by
default like they used to.
This commit is contained in:
jp9000 committed 2019-07-26 00:05:14 -07:00
1 parent 916d89a73b
commit aee84cc743
3 files changed
+29

No files matched your search

+8
View File
@@ -197,6 +197,14 @@ bool AddNew(QWidget *parent, const char *id, const char *name,
newSource = source;
/* set monitoring if source monitors by default */
uint32_t flags = obs_source_get_output_flags(source);
if ((flags & OBS_SOURCE_MONITOR_BY_DEFAULT) != 0) {
obs_source_set_monitoring_type(
source,
OBS_MONITORING_TYPE_MONITOR_ONLY);
}
success = true;
}
}