[vlc-devel] [PATCH 5/7] objects: remove vlc_list_children

Thomas Guillem thomas at gllm.fr
Mon May 27 16:45:14 CEST 2019


---
 include/vlc_objects.h |  2 --
 src/libvlccore.sym    |  1 -
 src/misc/objects.c    | 41 -----------------------------------------
 src/misc/variables.h  |  2 +-
 4 files changed, 1 insertion(+), 45 deletions(-)

diff --git a/include/vlc_objects.h b/include/vlc_objects.h
index 50ffe0f812..0292322e22 100644
--- a/include/vlc_objects.h
+++ b/include/vlc_objects.h
@@ -149,8 +149,6 @@ VLC_API void *vlc_object_create( vlc_object_t *, size_t ) VLC_MALLOC VLC_USED;
 VLC_API void vlc_object_delete(vlc_object_t *obj);
 #define vlc_object_delete(obj) vlc_object_delete(VLC_OBJECT(obj))
 
-VLC_API size_t vlc_list_children(vlc_object_t *, vlc_object_t **, size_t) VLC_USED;
-
 /**
  * Return a tree of object description
  *
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index d7a39f4427..b3da86f16b 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -608,7 +608,6 @@ vlc_interrupt_register
 vlc_interrupt_unregister
 vlc_killed
 vlc_join
-vlc_list_children
 vlc_meta_AddExtra
 vlc_meta_CopyExtraNames
 vlc_meta_Delete
diff --git a/src/misc/objects.c b/src/misc/objects.c
index 185f3a7a17..90edc9c769 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -184,47 +184,6 @@ void vlc_object_Log(vlc_object_t *obj, int prio, const char *module,
     va_end(ap);
 }
 
-/**
- * Lists the children of an object.
- *
- * Fills a table of pointers to children object of an object, incrementing the
- * reference count for each of them.
- *
- * @param obj object whose children are to be listed
- * @param tab base address to hold the list of children [OUT]
- * @param max size of the table
- *
- * @return the actual numer of children (may be larger than requested).
- *
- * @warning The list of object can change asynchronously even before the
- * function returns. The list meant exclusively for debugging and tracing,
- * not for functional introspection of any kind.
- *
- * @warning Objects appear in the object tree early, and disappear late.
- * Most object properties are not accessible or not defined when the object is
- * accessed through this function.
- * For instance, the object cannot be used as a message log target
- * (because object flags are not accessible asynchronously).
- * Also type-specific object variables may not have been created yet, or may
- * already have been deleted.
- */
-size_t vlc_list_children(vlc_object_t *obj, vlc_object_t **restrict tab,
-                         size_t max)
-{
-    vlc_object_internals_t *priv;
-    size_t count = 0;
-
-    vlc_mutex_lock(&tree_lock);
-    vlc_children_foreach(priv, vlc_internals(obj))
-    {
-         if (count < max)
-             tab[count] = vlc_object_hold(vlc_externals(priv));
-         count++;
-    }
-    vlc_mutex_unlock(&tree_lock);
-    return count;
-}
-
 #undef vlc_object_set_module
 void vlc_object_set_module(vlc_object_t *obj, const module_t *module)
 {
diff --git a/src/misc/variables.h b/src/misc/variables.h
index f4fdf433c5..ee74c4cc05 100644
--- a/src/misc/variables.h
+++ b/src/misc/variables.h
@@ -24,6 +24,7 @@
 # define LIBVLC_VARIABLES_H 1
 
 # include <vlc_list.h>
+# include <vlc_common.h>
 
 struct vlc_res;
 
@@ -51,7 +52,6 @@ struct vlc_object_internals
 };
 
 # define vlc_internals(o) ((o)->priv)
-# define vlc_externals(priv) (abort(), (void *)(priv))
 
 extern void var_DestroyAll( vlc_object_t * );
 
-- 
2.20.1



More information about the vlc-devel mailing list