libobs: Add source type OBS_SOURCE_TYPE_SCENE

Helps identify a scene without having to compare its type name to
"scene".
This commit is contained in:
jp9000 2015-12-29 15:48:45 -08:00
parent b0104fcee0
commit e68331e988
3 changed files with 3 additions and 2 deletions

View File

@ -534,7 +534,7 @@ void obs_register_source_s(const struct obs_source_info *info, size_t size)
array = &obs->filter_types.da;
} else if (info->type == OBS_SOURCE_TYPE_TRANSITION) {
array = &obs->transition_types.da;
} else {
} else if (info->type != OBS_SOURCE_TYPE_SCENE) {
blog(LOG_ERROR, "Tried to register unknown source type: %u",
info->type);
goto error;

View File

@ -693,7 +693,7 @@ static bool scene_audio_render(void *data, uint64_t *ts_out,
const struct obs_source_info scene_info =
{
.id = "scene",
.type = OBS_SOURCE_TYPE_INPUT,
.type = OBS_SOURCE_TYPE_SCENE,
.output_flags = OBS_SOURCE_VIDEO |
OBS_SOURCE_CUSTOM_DRAW |
OBS_SOURCE_COMPOSITE,

View File

@ -35,6 +35,7 @@ enum obs_source_type {
OBS_SOURCE_TYPE_INPUT,
OBS_SOURCE_TYPE_FILTER,
OBS_SOURCE_TYPE_TRANSITION,
OBS_SOURCE_TYPE_SCENE,
};