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

libobs: Add obs_obj_is_private()

Returns true if an obs object is considered private. (Author's note: the
concept of "private" objects is not ideal, but we're stuck with it for
now)
jp9000 4 жил өмнө
parent
commit
33c5563c1e
2 өөрчлөгдсөн 10 нэмэгдсэн , 0 устгасан
  1. 9 0
      libobs/obs.c
  2. 1 0
      libobs/obs.h

+ 9 - 0
libobs/obs.c

@@ -2239,6 +2239,15 @@ void *obs_obj_get_data(void *obj)
 	return context->data;
 }
 
+bool obs_obj_is_private(void *obj)
+{
+	struct obs_context_data *context = obj;
+	if (!context)
+		return false;
+
+	return context->private;
+}
+
 bool obs_set_audio_monitoring_device(const char *name, const char *id)
 {
 	if (!name || !id || !*name || !*id)

+ 1 - 0
libobs/obs.h

@@ -727,6 +727,7 @@ EXPORT enum obs_obj_type obs_obj_get_type(void *obj);
 EXPORT const char *obs_obj_get_id(void *obj);
 EXPORT bool obs_obj_invalid(void *obj);
 EXPORT void *obs_obj_get_data(void *obj);
+EXPORT bool obs_obj_is_private(void *obj);
 
 typedef bool (*obs_enum_audio_device_cb)(void *data, const char *name,
 					 const char *id);