[vlc-devel] Advertising VLC Http interface on bonjour

akash mehrotra mehrotra.akash at gmail.com
Mon Aug 15 19:17:09 CEST 2011


Hi,

I'm trying to get VLC to advertise the luahttp interface on bonjour.

OS: Ubuntu 11.04
I have copied bonjour.c and bonjour.h to modules/lua from
modules/access_output

The git diff for the code I changed is:

diff --git a/modules/lua/Modules.am b/modules/lua/Modules.am
index a806804..6332817 100644
--- a/modules/lua/Modules.am
+++ b/modules/lua/Modules.am
@@ -1,4 +1,6 @@
 SOURCES_lua = \
+       bonjour.c \
+       bonjour.h \
        extension.c \
        extension.h \
        extension_thread.c \
diff --git a/modules/lua/intf.c b/modules/lua/intf.c
index 22b974a..995f1ac 100644
--- a/modules/lua/intf.c
+++ b/modules/lua/intf.c
@@ -31,6 +31,7 @@
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
+#include "bonjour.h"

 #include <vlc_common.h>
 #include <vlc_interface.h>
@@ -192,7 +193,7 @@ static int Start_LuaIntf( vlc_object_t *p_this, const
char *name )
         lua_close( L );
         goto error;
     }
-
+bonjour_start_service( p_this , "http", "Http", 8080, "text" );
     /*
      * Get the lua-config string.
      * If the string is empty, try with the old http-* or telnet-* options




Additionally I changed the vlc-config to :

    lua)
      cflags="${cflags} -I/usr/include/lua5.1 -D_REENTRANT"
      libs="${libs} -llua5.1 -ldl -lm -L/usr/lib/i386-linux-gnu
-lavahi-common -lavahi-client  "



make runs successfully, but on running vlc, I get errors like:


[0x8c7c2b0] main libvlc warning: cannot read
/home/akash/vlc/src/.libs/vlc/plugins/plugins.dat (No such file or
directory)


[0x8d23700] main interface debug: looking for interface module: 1 candidate
[0x8d23700] main interface warning: cannot load module
`/home/akash/vlc/modules/lua/.libs/liblua_plugin.so'
(/home/akash/vlc/modules/lua/.libs/liblua_plugin.so: undefined symbol:
bonjour_start_service)
[0x8d23700] main interface error: possibly corrupt module cache
[0x8d23700] main interface debug: no interface module matching
"luahttp,none" could be loaded
[0x8d23700] main interface debug: TIMER module_need() : 0.967 ms - Total
0.967 ms / 1 intvls (Avg 0.967 ms)
[0x8d23700] main interface error: no suitable interface module
Error: callback on "intf-add" dangling
/home/akash/vlc/src/.libs/libvlccore.so.5(?)[0xb77a6000]
[0x8d242e0] main interface debug: looking for interface module: 4 candidates
[0x8d242e0] main interface warning: cannot load module
`/home/akash/vlc/modules/lua/.libs/liblua_plugin.so'
(/home/akash/vlc/modules/lua/.libs/liblua_plugin.so: undefined symbol:
bonjour_start_service)
[0x8d242e0] main interface error: possibly corrupt module cache
[0x8d242e0] main interface warning: cannot load module
`/home/akash/vlc/modules/lua/.libs/liblua_plugin.so'
(/home/akash/vlc/modules/lua/.libs/liblua_plugin.so: undefined symbol:
bonjour_start_service)
[0x8d242e0] main interface error: possibly corrupt module cache
[0x8d242e0] main interface warning: cannot load module
`/home/akash/vlc/modules/lua/.libs/liblua_plugin.so'
(/home/akash/vlc/modules/lua/.libs/liblua_plugin.so: undefined symbol:
bonjour_start_service)
[0x8d242e0] main interface error: possibly corrupt module cache
[0x8d242e0] main interface warning: cannot load module
`/home/akash/vlc/modules/lua/.libs/liblua_plugin.so'
(/home/akash/vlc/modules/lua/.libs/liblua_plugin.so: undefined symbol:
bonjour_start_service)
[0x8d242e0] main interface error: possibly corrupt module cache
[0x8d242e0] main interface debug: no interface module matching "lua,none"
could be loaded
[0x8d242e0] main interface debug: TIMER module_need() : 2.688 ms - Total
2.688 ms / 1 intvls (Avg 2.688 ms)
[0x8d242e0] main interface error: no suitable interface module


Sample avahi program (from the avahi documentation) compiles with

 gcc -D_REENTRANT -L/usr/lib/i386-linux-gnu -lavahi-common -lavahi-client
test.c

and runs fine



Can anyone help with what's wrong here?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20110815/1cdc5ed7/attachment.html>


More information about the vlc-devel mailing list