Browse Source

libobs: Add source type OBS_SOURCE_TYPE_SCENE

Helps identify a scene without having to compare its type name to
"scene".
jp9000 9 years ago
parent
commit
e68331e988
3 changed files with 3 additions and 2 deletions
  1. 1 1
      libobs/obs-module.c
  2. 1 1
      libobs/obs-scene.c
  3. 1 0
      libobs/obs-source.h

+ 1 - 1
libobs/obs-module.c

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

+ 1 - 1
libobs/obs-scene.c

@@ -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,

+ 1 - 0
libobs/obs-source.h

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