[vlc-devel] [PATCH v3 1/3] Introduce media source and media tree API

Romain Vimont rom1v at videolabs.io
Fri Jun 29 16:34:54 CEST 2018

On Fri, Jun 29, 2018 at 03:00:03PM +0300, Rémi Denis-Courmont wrote:
> Le jeudi 28 juin 2018, 11:55:30 EEST Romain Vimont a écrit :
> > Add an API to manage "services discovery" out of the playlist.
> > 
> > A "media source provider", associated to the libvlc instance, allows to
> > retrieve media sources (each associated to a services discovery module).
> Creating a separate object systematically looks like a case of "worse of both 
> worlds". If you create it systematically, you can embed it into the instance. 

libvlc_int_t does not (and should not) know about the private part of
media source provider, so it cannot be embedded.

> Or then create it on demand (like e.g. VLM).

This is a good idea. This would avoid to create an instance

However, this has drawbacks:
 - synchronize every get of the instance:
 - add a mutex in libvlc_int_t (or use a static mutex – a bit dirty
   IMO – like for VLM);
 - handle the possibility that the instance could not be created for
   each call to vlc_media_source_provider_Get().

Since the instance is quite lightweight, I'm not sure it's worth it.

What do you think?

More information about the vlc-devel mailing list