Python Binding Media Discoverer

This forum is about all development around libVLC.
nathan_vlc
New Cone
New Cone
Posts: 1
Joined: 15 Feb 2019 05:23

Python Binding Media Discoverer

Postby nathan_vlc » 15 Feb 2019 05:59

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.

mfkl
Developer
Developer
Posts: 740
Joined: 13 Jun 2017 10:41

Re: Python Binding Media Discoverer

Postby mfkl » 25 Feb 2019 08:51

Not sure how that works with python interop, you should ask the bindings maintainer.
https://mfkl.github.io

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: Python Binding Media Discoverer

Postby sherington » 25 Feb 2019 10:03

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.

mextex
New Cone
New Cone
Posts: 1
Joined: 14 Dec 2020 13:07

Re: Python Binding Media Discoverer

Postby mextex » 15 Dec 2020 12:06

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!

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Python Binding Media Discoverer

Postby Rémi Denis-Courmont » 15 Dec 2020 15:41

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.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

OlivierAubert
Developer
Developer
Posts: 92
Joined: 08 Mar 2007 15:43

Re: Python Binding Media Discoverer

Postby OlivierAubert » 10 Feb 2021 11:33

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())


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 15 guests