Page 1 of 1
libvlc renderer discovery for chromecast
Posted: 20 Aug 2018 18:48
by belovedove123
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
Re: libvlc renderer discovery for chromecast
Posted: 21 Aug 2018 14:51
by chouquette
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!
Re: libvlc renderer discovery for chromecast
Posted: 22 Aug 2018 17:01
by belovedove123
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?