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

Romain Vimont rom1v at videolabs.io
Tue Jun 26 21:18:20 CEST 2018


On Tue, Jun 26, 2018 at 08:43:30PM +0300, Rémi Denis-Courmont wrote:
> Le mardi 26 juin 2018, 15:15:29 EEST Romain Vimont a écrit :
> > Several interfaces (qt, macosx) do the same work:
> >  - open SDs;
> >  - listen to SD, and add/remove items on SD events;
> >  - listen to input (preparsing), and add items on events;
> >  - close SD.
> 
> Err no - they don't. The playlist/SD bindings takes care of that.

That's right, technically, it's not the interface, it's the playlist.

The interface calls the relevant functions on the playlist
playlist_ServicesDiscoveryAdd(), etc.) to open/close SD.

> The GUI listen to the playlist events, and that's why you need the media tree 
> if you want to get rid of the playlist. And indeed, you also need a place to 
> store the list of active SDs (presumably, the media tree does that too).
>
> But that does not explain the need for anything other than media tree still.

The media tree is just the tree structure, in itself it is not related
to SD. The media source is the component (containing a media tree) which
opens/closes one SD and provides callbacks to fill the associated tree.

So without a media source, a media tree is useless for services
discovery.

> And even if there is, or will be, a case for replacing input items or input 
> nodes, that's going way too far for a single patch series.

In this version, a media tree contains input_item_node_t for input nodes
(which contain input items). They are not replaced.

> The only change that is absolutely required here is to remove the damned 
> callbacks from input items, since the callbacks will now be on media tree.

The media tree just listens to the input items events (generated during
preparsing) to update the tree (e.g. on "subtree added"). That way, the
current preparsing code works without changes.


More information about the vlc-devel mailing list