Page 1 of 1

Access_output module

Posted: 02 Feb 2005 23:17
by bino
I have written a new access_output module and am trying to test it. How do I go about getting vlc to load it so i can call it from the command line. It compiles and is in the modules/access_output directory.
Thanks for any help
Rob

Posted: 03 Feb 2005 08:41
by Sigmund
try --sout "std{access=directory,mux=ts,url=mydirectory}"

What exactly does this module do?

Posted: 03 Feb 2005 08:43
by Sigmund
sorry, I thought the module was called "directory", a bit tired here. just change "directory" into the name of your module in previous post

Posted: 03 Feb 2005 19:46
by bino
I tried that already, I think maybe the module is not getting compiled in (I'm running a make myplugin.so in the access_output directory). How do arrange for it to get automatically compiled and builtin to vlc?
I'm implementing a reliable multicast library. At the moment I've just copied the udp access_output...
Cheers for the help
Rob

Posted: 03 Feb 2005 19:58
by markfm
[07:02] <markfm> Which file do I edit to add a new plugin?

[07:02] <thedj> Modules.am in the directory of that file

[07:02] <Dnumgis> markfm: vlc-config

[07:02] <thedj> and then add the module to configure.ac

For instance, take the marquee filter, which is actually marq.c.

Open vlc-config and do a search for "marq" -- it's in the "plugins" line, plus there's an entry down at line 513 to add it to the registered items.

Next, look in configure.ac, you'll see a "marq" entry down at line 959.

Finally, in the actual directory where marq.c resides, modules.am has the needed "marq" entry.

(find something similar to what you are doing, replicate the entries)

Posted: 04 Feb 2005 18:23
by bino
OK. I have managed to get it automatically compiled.

However VLC does not show it as an access_output module. Someone on IRC thinks it could be a linker problem which would make sense. However I have no idea how to fix this except that i need to add something into configure.ac. I am only using one external lib.
Does anyone have any idea how to do this?

Cheers for the help so far
Rob

Posted: 04 Feb 2005 23:58
by Sigmund
run from commandline the following command:
vlc -vvv --reset-plugins-cache --color

It should give a yellow line complaining about unresolved symbols in your plugin, it will contain the symbol that is missing, and this could be useful to figure out what to link with.

Posted: 05 Feb 2005 01:45
by markfm
If you know what you are trying to link with, look in configure.ac for:
VLC_ADD_LDFLAGS([dvdread],[-ldvdread ${LDFLAGS_dvdcss}])
or similar, to see how to explicitly add an external library to the build of a given module.

(the VLC_ADD_LDFLAGS is used to pull in the necessary external libraries -- you'll need to edit your copy of configure.ac to pick up a similar line, in the script for building your module)

Posted: 07 Feb 2005 13:13
by bino
OK, I'm almost there (I hope!) but struggling for the autoconf syntax...

At the moment I'm just trying to get the library linked, not worried about checking things. The library I'm using isn't installed on the system (for instance in /lib/), so I'm going to have to specifcy the path explicitly. So I think I do something like this

VLC_ADD_LDFLAGS([access_output_mcl],[/path/to/library.a])

However this does not work! I still fails to resolve the functions from the external library when i try to load it in vlc.

How should I change this so that it works?

Cheers
Rob

Posted: 07 Feb 2005 14:25
by xtophe
hey,

I think autoconf generate itself an option for configure to specify the path.

I would try something like
VLC_ADD_LDFLAGS([access_output_mcl],[-lmcl])

then rebootstrap and now ( may be ( let's cross our fingers)) configure have an option --with-mcl-path so you can give your path

hth,

Posted: 07 Feb 2005 20:29
by bino
Ok, tried that, when it was making it said failed to find library -lmcl....
I had added --with-mcl-path=/path/to/lib/ to configure...
I tried the same but specified the path to the lib explicitly and it compiled fine but then vlc would not load the modules...

Posted: 08 Feb 2005 12:51
by bino
Think I might have found the problem. The library is written in cpp not c, I tried writing a short test program and it would only comile if I used g++ not gcc. So I think the problem is that I'm linking to a cpp library...
Any ideas on how to change configure.ac so that the module can be linked to a cpp lib?
Cheers
Rob

Posted: 08 Feb 2005 13:15
by xtophe
hey,

livedotcom and wxwindows are both c++ libraries so you can have a look at what configure.ac do for them

hth,

Posted: 10 Feb 2005 15:44
by bino
Problem is those modules are written in C++, whereas my module is written in C but links to a C++ library. So i need to use g++ but i have no idea how to program that in configure.ac ...
Does anyone know of any other modules that are written in C but link to C++ libraries?
Thanks for the help
Rob

Posted: 10 Feb 2005 17:18
by markfm
Are you setting up your extern calls to the C++ library? You use things of the form:
extern "C" int normal_c_func( float, int, char );
inside your C code, to set up a link to the external function contained in the C++ library.

There is documentation on this, on the Web. Things like:
http://msdn.microsoft.com/library/defau ... ons_30.asp

For a VLC example, take a look at os_specific.h, which uses an extern "C" section to set up links to BEOS C++ functions (things contained in beos_specific.cpp).

libvlc.c is what has the os_specific.h include. as libvlc.c is a C program, and the BEOS items are C++, it needed to have the right extern structure set up.