config.get( name ): Get the VLC configuration option "name"'s value.
config.set( name, value ): Set the VLC configuration option "name"'s value.
HTTPd
-----
http( host, port, [cert, key, ca, crl]): create a new HTTP (SSL) daemon.
local h = vlc.httpd( "localhost", 8080 )
h:handler( url, user, password, acl, callback, data ) -- add a handler for given url. If user and password are non nil, they will be used to authenticate connecting clients. If acl is non nil, it will be used to restrict access. callback will be called to handle connections. The callback function takes 7 arguments: data, url, request, type, in, addr, host. It returns the reply as a string.
h:file( url, mime, user, password, acl, callback, data ) -- add a file for given url with given mime type. If user and password are non nil, they will be used to authenticate connecting clients. If acl is non nil, it will be used to restrict access. callback will be called to handle connections. The callback function takes 2 arguments: data and request. It returns the reply as a string.
h:redirect( url_dst, url_src ): Redirect all connections from url_src to url_dst.
Input
-----
input.info(): Get the current input's info. Return value is a table of tables. Keys of the top level table are info category labels.
input.is_playing(): Return true if input exists.
input.get_title(): Get the input's name.
input.stats(): Get statistics about the input. This is a table with the following fields:
msg.info( [str1, [str2, [...]]] ): Output info messages.
Misc
----
misc.version(): Get the VLC version string.
misc.copyright(): Get the VLC copyright statement.
misc.license(): Get the VLC license.
misc.datadir(): Get the VLC data directory.
misc.userdatadir(): Get the user's VLC data directory.
misc.homedir(): Get the user's home directory.
misc.configdir(): Get the user's VLC config directory.
misc.cachedir(): Get the user's VLC cache directory.
misc.datadir_list( name ): FIXME: write description ... or ditch function if it isn't usefull anymore, we have datadir and userdatadir :)
misc.mdate(): Get the current date (in miliseconds).
misc.lock_and_wait(): Lock our object thread and wait for a wake up signal.
misc.signal(): Wake up our object thread.
misc.should_die(): Returns true if the interface should quit.
misc.quit(): Quit VLC.
Net
---
net.url_parse( url, [option delimiter] ): Parse URL. Returns a table with
fields "protocol", "username", "password", "host", "port", path" and
"option".
net.listen_tcp( host, port ): Listen to TCP connections. This returns an
object with an accept method. This method takes an optional timeout
argument (in miliseconds). For example:
local l = vlc.net.listen_tcp( "localhost", 1234 )
while true do
local fd = l:accept( 500 )
if fd >= 0 do
net.send( fd, "blabla" )
net.close( fd )
end
end
net.close( fd ): Close file descriptor.
net.send( fd, string, [length] ): Send data on fd.
net.recv( fd, [max length] ): Receive data from fd.
net.select( nfds, fds_read, fds_write, timeout ): Monitor a bunch of file descriptors. Returns number of fds to handle and the amount of time not slept. See "man select".
net.fd_set_new(): Create a new fd_set.
local fds = vlc.net.fd_set_new()
fds:clr( fd ) -- remove fd from set
fds:isset( fd ) -- check if fd is set
fds:set( fd ) -- add fd to set
fds:zero() -- clear the set
net.fd_read( fd, [max length] ): Read data from fd.
net.fd_write( fd, string, [length] ): Write data to fd.
net.stat( path ): Stat a file. Returns a table with the following fields:
.type
.mode
.uid
.gid
.size
.access_time
.modification_time
.creation_time
net.opendir( path ): List a directory's contents.
Objects
-------
object.input(): Get the current input object.
object.playlist(): Get the playlist object.
object.libvlc(): Get the libvlc object.
object.find( object, type, mode ): Find an object of given type. mode can
be any of "parent", "child" and "anywhere". If set to "parent", it will
look in "object"'s parent objects. If set to "child" it will look in
"object"'s children. If set to "anywhere", it will look in all the
objects. If object is unset, the current module's object will be used.
Type can be: "libvlc", "module", "intf", "playlist", "input", "decoder",