Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: Kammie on March 05, 2012, 08:03:06 PM

Title: Avidemux 2.6 writing plugins
Post by: Kammie on March 05, 2012, 08:03:06 PM
Hi,
I'm new to Avidemux but I'd like to try writing my own plugins for Avidemux on Windows. I found this page about writing plugins for Avidemux 2.6 http://www.avidemux.org/admWiki/doku.php?id=build:devel_2.6 (http://www.avidemux.org/admWiki/doku.php?id=build:devel_2.6) and I wanted to try compiling the example dummy plugin (without compiling Avidemux itself)

I did everything according to the text, i managed to compile in CodeBlocks and i have the files libADM_vf_logo.dll and libADM_vf_logo.dll.a. But now I'm lost. I assumed that I need to copy the files in the plugins directory but when I run Avidemux the plugin is not available. And when I look in the log file there is a message saying "[ADM_vf_plugin] Unable to load libADM_vf_logo.dll".

Anybody sees what I'm missing?
Title: Re: Avidemux 2.6 writing plugins
Post by: mean on March 06, 2012, 06:38:32 AM
Is there more informations regarding why the plugin could not be loaded ?
It is usually missng symbols
Title: Re: Avidemux 2.6 writing plugins
Post by: Kammie on March 06, 2012, 01:48:23 PM
As far as I can tell, there is no more information why it couldn't be loaded. Here is the part of file admlog.txt:

...
[ADM_vf_plugin] Plugin loaded version 1.0.0, name glResize/OpenGl Resize
[ADM_vf_plugin] Plugin loaded version 1.0.0, name kerndelDeint/Kernel Deint.
[ADM_vf_plugin] Plugin loaded version 1.0.0, name largeMedian/Large Median (5x5).
[ADM_vf_plugin] Plugin loaded version 1.0.0, name lavdeint/Libavdec Deinterlacers
[ADM_vf_plugin] Unable to load libADM_vf_logo.dll
[ADM_vf_plugin] Plugin loaded version 1.0.0, name lumaonly/GreyScale
[ADM_vf_plugin] Plugin loaded version 1.0.0, name Mean/Mean convolution.
[ADM_vf_plugin] Plugin loaded version 1.0.0, name Median/Median convolution.
[ADM_vf_plugin] Plugin loaded version 1.0.0, name mpdelogo/MPlayer delogo
...

It only says it couldn't be loaded, without any explanation. Or should I be looking somewhere else?
Title: Re: Avidemux 2.6 writing plugins
Post by: Agent_007 on March 06, 2012, 05:54:48 PM
Dependency Walker might give more info if something is missing from .dll
Title: Re: Avidemux 2.6 writing plugins
Post by: Kammie on March 08, 2012, 10:08:23 PM
I tried checking the dll file with Dependency Walker as suggested. It showed me that some dependencies are really missing but it's only avidemux libraries (libADM_core6.dll and several others). But actually the same dependencies are "missing" in the dlls of the plugins which come with avidemux (They're not really missing but they're in the parent folder so Dependency Walker can't see them).

But the Dependency Walker revealed one difference between my dll and the original plugins. The problem is probably connected with the library libstdc++-6.dll, undefined refence to __gxx_personality_v0. All the original plugins have __gxx_personality_sj0. I have no idea what it means or what is the difference, it is showed on the screenshot below. I googled a little bit and learned that it probably has something to do with linking with gcc instead of g++ but i checked and I'm using g++. I'm using MinGW. Any hints how to fix this?

(https://avidemux.org/smif/proxy.php?request=http%3A%2F%2Fimg193.imageshack.us%2Fimg193%2F7645%2Fdepwalker.jpg&hash=fc5cb96c33e0bf4e6ce7cf2ce1e9ab857490afae)
Title: Re: Avidemux 2.6 writing plugins
Post by: gruntster on March 08, 2012, 10:57:23 PM
It looks like you're using a GCC compiler that uses Dwarf-2 exception handling and using your DLL with an Avidemux build that uses SJLJ exception handling.

Dwarf-2 only works on 32-bit so I'd recommend going with SJLJ: http://sourceforge.net/apps/trac/mingw-w64/wiki/Exception%20Handling

You can also remove your plugin's dependency on __gxx_personality_v0 by disabling exceptions (use the -fno-exceptions compiler parameter).
Title: Re: Avidemux 2.6 writing plugins
Post by: Kammie on March 09, 2012, 09:46:13 AM
Great, I used the compiler parameter and everything works now.

Thanks a lot!