1
0
Эх сурвалжийг харах

libobs: Add obs_get_source_output_flags function

Gets the output flags by its source type.
jp9000 10 жил өмнө
parent
commit
c16f1a7430
2 өөрчлөгдсөн 10 нэмэгдсэн , 0 устгасан
  1. 6 0
      libobs/obs-source.c
  2. 4 0
      libobs/obs.h

+ 6 - 0
libobs/obs-source.c

@@ -409,6 +409,12 @@ uint32_t obs_source_get_output_flags(const obs_source_t *source)
 	return source ? source->info.output_flags : 0;
 }
 
+uint32_t obs_get_source_output_flags(enum obs_source_type type, const char *id)
+{
+	const struct obs_source_info *info = get_source_info(type, id);
+	return info ? info->output_flags : 0;
+}
+
 static void obs_source_deferred_update(obs_source_t *source)
 {
 	if (source->context.data && source->info.update)

+ 4 - 0
libobs/obs.h

@@ -654,6 +654,10 @@ EXPORT bool obs_source_removed(const obs_source_t *source);
  */
 EXPORT uint32_t obs_source_get_output_flags(const obs_source_t *source);
 
+/** Returns capability flags of a source type */
+EXPORT uint32_t obs_get_source_output_flags(enum obs_source_type type,
+		const char *id);
+
 /** Gets the default settings for a source type */
 EXPORT obs_data_t *obs_get_source_defaults(enum obs_source_type type,
 		const char *id);