[vlc-devel] [PATCH 1/3] objects: introduce vlc_object_parent()

Thomas Guillem thomas at gllm.fr
Thu Feb 28 08:59:01 CET 2019


LGTM for the whole set. 

On Wed, Feb 27, 2019, at 18:37, RĂ©mi Denis-Courmont wrote:
> ---
>  include/vlc_objects.h | 10 ++++++++++
>  src/libvlccore.sym    |  1 +
>  src/misc/objects.c    |  5 +++++
>  3 files changed, 16 insertions(+)
> 
> diff --git a/include/vlc_objects.h b/include/vlc_objects.h
> index 4d59fcfd0b..11b18243e0 100644
> --- a/include/vlc_objects.h
> +++ b/include/vlc_objects.h
> @@ -109,6 +109,16 @@ VLC_API size_t vlc_list_children(vlc_object_t *, 
> vlc_object_t **, size_t) VLC_US
>   */
>  VLC_API const char *vlc_object_typename(const vlc_object_t *obj) 
> VLC_USED;
>  
> +/**
> + * Gets the parent of an object.
> + *
> + * \return the parent object (NULL if none)
> + *
> + * \note The returned parent object pointer is valid as long as the child is.
> + */
> +VLC_API vlc_object_t *vlc_object_parent(vlc_object_t *obj) VLC_USED;
> +#define vlc_object_parent(o) vlc_object_parent(VLC_OBJECT(o))
> +
>  VLC_API char *vlc_object_get_name( const vlc_object_t * ) VLC_USED;
>  
>  #define vlc_object_create(a,b) vlc_object_create( VLC_OBJECT(a), b )
> diff --git a/src/libvlccore.sym b/src/libvlccore.sym
> index a861c988e5..ef9e2d5561 100644
> --- a/src/libvlccore.sym
> +++ b/src/libvlccore.sym
> @@ -675,6 +675,7 @@ vlc_object_find_name
>  vlc_object_hold
>  vlc_object_release
>  vlc_object_typename
> +vlc_object_parent
>  vlc_object_get_name
>  vlc_once
>  vlc_rand_bytes
> diff --git a/src/misc/objects.c b/src/misc/objects.c
> index 07cd418231..c92d74b88a 100644
> --- a/src/misc/objects.c
> +++ b/src/misc/objects.c
> @@ -282,6 +282,11 @@ const char *vlc_object_typename(const vlc_object_t *obj)
>      return vlc_internals(obj)->typename;
>  }
>  
> +vlc_object_t *(vlc_object_parent)(vlc_object_t *obj)
> +{
> +    return obj->obj.parent;
> +}
> +
>  static vlc_mutex_t name_lock = VLC_STATIC_MUTEX;
>  
>  #undef vlc_object_set_name
> -- 
> 2.20.1
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list