Page 1 of 1

Python Binding Media Discoverer

Posted: 15 Feb 2019 05:59
by nathan_vlc
Hello All-

How do I know what sources are available for a system with the python bindings? I think I have to use the MediaDiscoverer, but not quite sure. Looking at the API instance.Media_discoverer_new() needs a psz_name...ok and a hint in the doc to use instance.media_discoverer_list_get to get a list of names. Ok. That function takes an i_cat, which found in the source, but also a ppp_services. Ok, source has this to say:

@param ppp_services: address to store an allocated array of renderer discoverer services (must be freed with libvlc_renderer_list_release()

But I have no idea what that means. I tried passing in a list but it didn't like it.

I googled and search here on forum/docs but no luck.

Thanks for any insight.

Re: Python Binding Media Discoverer

Posted: 25 Feb 2019 08:51
by mfkl
Not sure how that works with python interop, you should ask the bindings maintainer.

Re: Python Binding Media Discoverer

Posted: 25 Feb 2019 10:03
by sherington
I don't know Python well, but for that API function you pass in a value that can hold a pointer. The API uses that to return a pointer to the first item in the list, i.e. it stores the list pointer inside the value that you passed in, which your code can than extract and use.

The VLC API allocates the list, you don't. You just need to pass VLC a variable that can hold a pointer to the list that VLC will allocate.

Re: Python Binding Media Discoverer

Posted: 15 Dec 2020 12:06
by mextex
Hi there,
I´d also like to use the Media Discoverer with Python Bindings and have the same questions as nathan_vlc. Is there already a known solution for this?
Thanks you!

Re: Python Binding Media Discoverer

Posted: 15 Dec 2020 15:41
by Rémi Denis-Courmont
Please refer to the documentation for your bindings. You're not very likely to get an answer here, except for the native C API, or one of the few bindings whose maintainer roams here.

Re: Python Binding Media Discoverer

Posted: 10 Feb 2021 11:33
by OlivierAubert
I am actually roaming here from time to time. For this question, you have to instanciate the MediaDiscoverer through a vlc Instance, just like in the native libvlc API (which the python bindings merely wrap), something like:

Code: Select all

i = vlc.Instance() discoverer = i.media_discoverer_new("foo") list(discoverer.media_list())