libobs: Add the ability to make sources obsolete

This allows the ability to do things such as change defaults or
properties of sources without necessarily breaking older user
configurations that had older defaults or properties.
This commit is contained in:
jp9000 2020-01-15 01:47:53 -08:00
parent 37a7805ad5
commit 70582174c3
2 changed files with 16 additions and 0 deletions

View File

@ -142,6 +142,17 @@ Source Definition Structure (obs_source_info)
from creating an audio feedback loop. This is primarily only used
with desktop audio capture sources.
- **OBS_SOURCE_CAP_DISABLED** - This source type has been disabled
and should not be shown as a type of source the user can add.
- **OBS_SOURCE_CAP_OBSOLETE** - This source type is obsolete and
should not be shown as a type of source the user can add.
Identical to *OBS_SOURCE_CAP_DISABLED*. Meant to be used when a
source has changed in some way (mostly defaults/properties), but
you want to avoid breaking older configurations. Basically solves
the problem of "I want to change the defaults of a source but I
don't want to break people's configurations"
.. member:: const char *(*obs_source_info.get_name)(void *type_data)
Get the translated name of the source type.

View File

@ -156,6 +156,11 @@ enum obs_icon_type {
*/
#define OBS_SOURCE_CAP_DISABLED (1 << 10)
/**
* Source type is obsolete (has been updated with new defaults/properties/etc)
*/
#define OBS_SOURCE_CAP_OBSOLETE OBS_SOURCE_CAP_DISABLED
/**
* Source should enable monitoring by default. Monitoring should be set by the
* frontend if this flag is set.