From b92e941b4f24d33b2b2677bcc005492d493ef606 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Tue, 7 Dec 2021 20:51:05 -0800 Subject: [PATCH] libobs: Add source cap to hint not to show properties (This commit also modifies UI) Adds a source capability flag to indicate that properties should not be shown on creation --- UI/window-basic-main.cpp | 5 +++++ libobs/obs-source.h | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 93c372af4..fe53cf70b 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -5607,6 +5607,11 @@ static inline bool should_show_properties(obs_source_t *source, const char *id) return false; if (!obs_source_configurable(source)) return false; + + uint32_t caps = obs_source_get_output_flags(source); + if ((caps & OBS_SOURCE_CAP_DONT_SHOW_PROPERTIES) != 0) + return false; + return true; } diff --git a/libobs/obs-source.h b/libobs/obs-source.h index fafb1c2dd..17456ef55 100644 --- a/libobs/obs-source.h +++ b/libobs/obs-source.h @@ -196,6 +196,12 @@ enum obs_media_state { */ #define OBS_SOURCE_SRGB (1 << 15) +/** + * Source type prefers not to have its properties shown on creation + * (prefers to rely on defaults first) + */ +#define OBS_SOURCE_CAP_DONT_SHOW_PROPERTIES (1 << 16) + /** @} */ typedef void (*obs_source_enum_proc_t)(obs_source_t *parent,