+ajwong
Hrmm I wasn't aware we still had to symlink as we use dlopen() which should find the correct libavcodec/format/util libraries.
I'm not a library loading pro so let me know if I didn't answer your question!
Andrew
Don’t link against it, just change the path that’s passed to dlopen.
See media::InitializeMediaLibrary(const FilePath&) in
media/base/media_posix.cc. When building with use_system_ffmpeg, put
the path to the system’s ffmpeg library into the map, instead of a
path that refers to module_dir.
Mark
Unfortunately the mapping from file name to path is rather complicated
(consider it depends on ld.so.conf among other things). But on the
bright side I think that requesting the bare filename without a path
will do the right thing in terms of searching the library path.
I think Paweł didn't have enough context to ask the more important
question, which is why there is this strange dlopening etc. business
in the first place, or why the library has a different name than
ffmpeg. In the latter case I can at least imagine it's due to us
adding API, but I am just guessing, as I don't know much about this...
According to Paweł, people are just using symbolic links now, which
are far more “static” than you can get with code.
> But on the
> bright side I think that requesting the bare filename without a path
> will do the right thing in terms of searching the library path.
That’s true.
> I think Paweł didn't have enough context to ask the more important
> question, which is why there is this strange dlopening etc. business
> in the first place,
Once upon a time, the ffmpeg components were checked in as binary bits
(as they still are for Windows). In order to not incur a load-time
penalty, the libraries were loaded as needed instead of being linked
against directly.
I never liked checked-in binary components, and apparently Albert
didn’t either, because he improved matters by transitioning Mac and
Linux to building ffmpeg from source.
Personally, I’d prefer if it were just linked right in statically, but
I suspect that there’s a license-type concern based on someone’s [ed.:
FSF’s flawed] interpretation of the GPL and understanding of linking.
> or why the library has a different name than
> ffmpeg.
Originally, in the checked-in binary world, there were three
libraries: libavcodec, libavformat, and libavutil. Now that they’re
built from source, the independent pieces are built into a single
library. It’s an amalgamation of these three components smushed
together, so it’s big. That makes it a “sumo.”
http://codereview.chromium.org/300013 is where most of the magic
happened. It was a wild ride.
Mark
+ajwong
Hrmm I wasn't aware we still had to symlink as we use dlopen() which should find the correct libavcodec/format/util libraries.
See #ifdefs in
chrome/browser/password_manager/native_backend_gnome_x.cc
We basically simulate the world as if we had linked to it directly in
the dlopen case, so the majority of the code is written the same.
On Mon, Jul 26, 2010 at 11:25 AM, Albert J. Wong (王重傑)
> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev
>