libvlc renderer discovery for chromecast

This forum is about all development around libVLC.
belovedove123
New Cone
New Cone
Posts: 2
Joined: 20 Aug 2018 18:34

libvlc renderer discovery for chromecast

Postby belovedove123 » 20 Aug 2018 18:48

Recently, I'm dedicated to write a program to utilize the libvlc code as a sender to my chromecast which linked to my smart tv, but i don't quite understand the renderer
discovery functions ,how does those function coordinate with each other, what should i put in to the renderer_discovery_list_get() functions, what is LP_LP_RDDescription, pppservices stand for? I use python 3.x , hope someone could help me

chouquette
Developer
Developer
Posts: 291
Joined: 15 Apr 2010 00:54

Re: libvlc renderer discovery for chromecast

Postby chouquette » 21 Aug 2018 14:51

Hi,

I'm not sure how things are done in python, but the basic way to discover a renderer in C is:
- use libvlc_renderer_discoverer_list_get to get a list of available discoverers
- use the name in the information structure that gets returned to instantiate a discoverer using libvlc_renderer_discoverer_new
- Attach yourself to the renderer discoverer event manager: libvlc_renderer_discoverer_event_manager & libvlc_event_attach. The events you should be interested in are renderer_discoverer_item_added and renderer_discoverer_item_deleted
- Start the newly create discoverer using libvlc_renderer_discoverer_start, this will cause libvlc to invoke your event handlers, that you registered in the previous step
- If/when a renderer gets discovered, you can set it to be the currently used renderer by using libvlc_media_player_set_renderer

I don't know the python API but I'd expect it to be similar in term of naming, and to release the resources automatically.
Good luck!

belovedove123
New Cone
New Cone
Posts: 2
Joined: 20 Aug 2018 18:34

Re: libvlc renderer discovery for chromecast

Postby belovedove123 » 22 Aug 2018 17:01

chouquette, I am a green hand in libvlc and I am grateful for your reply, now there is another question, what should I put as parameter in the libvlc_renderer_discoverer_list_get function, I thought it should be a rddescription struct, but when i defined it as ['chromecast','_googlecast._tcp.local'], console implies error as the parameter should be bytes or integer, so what the right parameter should it be?


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 36 guests