[vlc-devel] Network functions for use in a module

Rémi Denis-Courmont remi at remlab.net
Tue Feb 18 23:01:39 CET 2014

Le mardi 18 février 2014, 22:46:59 Alexander Adolf a écrit :
> Is there any prior art in the VLC tree I could use?
> There is a HTTP client in modules/access/http.c. How would I use that from
> my own module?

If you do not need custom headers, you can use stream_UrlNew() and friends 
from <vlc_stream.h>. There are already a bunch of examples in the code.

If however you need custom headers, there is no helper yet, though someone is 
working on it.

> For a DNS request, I'll likely nee to roll my own?

So far VLC only makes "normal" A/AAAA queries, using getaddrinfo(). But I 
infer you want another RR type? In that case, I would advise trying 
res_search() from <resolv.h> but it might be cumbersome. Otherwise use a 
dedicated DNS library, like c-ares.

Реми Денис-Курмон

More information about the vlc-devel mailing list