Access_output module

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
bino
New Cone
New Cone
Posts: 8
Joined: 25 Jan 2005 15:54

Access_output module

Postby bino » 02 Feb 2005 23:17

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

Sigmund
Big Cone-huna
Big Cone-huna
Posts: 893
Joined: 26 Nov 2003 09:38

Postby Sigmund » 03 Feb 2005 08:41

try --sout "std{access=directory,mux=ts,url=mydirectory}"

What exactly does this module do?

Sigmund
Big Cone-huna
Big Cone-huna
Posts: 893
Joined: 26 Nov 2003 09:38

Postby Sigmund » 03 Feb 2005 08:43

sorry, I thought the module was called "directory", a bit tired here. just change "directory" into the name of your module in previous post

bino
New Cone
New Cone
Posts: 8
Joined: 25 Jan 2005 15:54

Postby bino » 03 Feb 2005 19:46

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

markfm
Big Cone-huna
Big Cone-huna
Posts: 1536
Joined: 22 Feb 2004 17:42

Postby markfm » 03 Feb 2005 19:58

[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)

bino
New Cone
New Cone
Posts: 8
Joined: 25 Jan 2005 15:54

Postby bino » 04 Feb 2005 18:23

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

Sigmund
Big Cone-huna
Big Cone-huna
Posts: 893
Joined: 26 Nov 2003 09:38

Postby Sigmund » 04 Feb 2005 23:58

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.

markfm
Big Cone-huna
Big Cone-huna
Posts: 1536
Joined: 22 Feb 2004 17:42

Postby markfm » 05 Feb 2005 01:45

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)

bino
New Cone
New Cone
Posts: 8
Joined: 25 Jan 2005 15:54

Postby bino » 07 Feb 2005 13:13

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

xtophe
Big Cone-huna
Big Cone-huna
Posts: 1209
Joined: 24 Nov 2003 10:12
Location: Bristol, England

Postby xtophe » 07 Feb 2005 14:25

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,
Xtophe

bino
New Cone
New Cone
Posts: 8
Joined: 25 Jan 2005 15:54

Postby bino » 07 Feb 2005 20:29

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...

bino
New Cone
New Cone
Posts: 8
Joined: 25 Jan 2005 15:54

Postby bino » 08 Feb 2005 12:51

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

xtophe
Big Cone-huna
Big Cone-huna
Posts: 1209
Joined: 24 Nov 2003 10:12
Location: Bristol, England

Postby xtophe » 08 Feb 2005 13:15

hey,

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

hth,
Xtophe

bino
New Cone
New Cone
Posts: 8
Joined: 25 Jan 2005 15:54

Postby bino » 10 Feb 2005 15:44

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

markfm
Big Cone-huna
Big Cone-huna
Posts: 1536
Joined: 22 Feb 2004 17:42

Postby markfm » 10 Feb 2005 17:18

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.


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 21 guests