[FFmpeg-devel] [RFC] Support dynamic loading of third-party libs

Marc Giger gigerstyle at gmx.ch
Tue Jan 13 19:22:45 CET 2015


Hi Michael,


On Mon, 12 Jan 2015 22:57:35 +0100
Michael Niedermayer <michaelni at gmx.at> wrote:

> On Mon, Jan 12, 2015 at 06:59:33PM +0100, Marc Giger wrote:
> > Hi,
> > 
> > Attached is a preliminary patch that enables runtime loading of
> > external libraries via dlopen and friends. Dynamic loading is a
> > build time option (--enable-dynamic-loading) and if it is not
> > activated the libs are linked as usual (still no dependency to
> > dlopen required).
> > 
> > The patch is intended as a basis for a discussion and therefore the
> > following applies:
> > 
> > - only libmp3lame and libva will by dynamically loaded atm
> 
> > - only tested on linux atm
> 
> tested building 32bit binaries on 64bit linux:
> LD      ffmpeg_g
> /usr/bin/ld: cannot find -lva
> collect2: ld returned 1 exit status
> make: *** [ffmpeg_g] Error 1
> 

Interesting...
replace my last point with
- only tested on Linux x86_64 with gcc 4.8.3 atm :-)

> 
> 
> > - deregistering not implemented (dlclose)
> > - versioning (which version of a lib should be loaded?)
> > - library usage counter missing
> > - ...?
> > 
> 
> > What do you think?
> 
> I think binary based distros (and some of their users)
> might like this feature as it would allow them to build packages which
> have fewer hard dependencies but can still use all the libs if they
> are available and installed
> 
> about the code, i think it looks ugly, too many #if too many changes
> interspaced with existing code. Could this be implemeted in a
> nicer way ?
> I am thinking here of keeping (almost) all changes
> outside of existing files

I totally agree. As I already noted the purpose of the patch is
to have basis for discussion and to get a feeling if such a feature
will be accepted by you ffmpeg-devs. In addition I wanted to discuss it
as early as possible so that you can point me in the right direction so
that everybody is happy in the end.

Many thanks for the valuable feedback!

Marc



> 
> 
> [...]
> 
> -- 
> Michael     GnuPG fingerprint:
> 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> Those who are too smart to engage in politics are punished by being
> governed by those who are dumber. -- Plato 




More information about the ffmpeg-devel mailing list