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
2019-07-26 00:02:31 -07:00
parent 916d89a73b
commit aee84cc743
3 changed files with 29 additions and 0 deletions

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;
}
}