|
1 | 1 | import ctypes, os |
2 | 2 |
|
3 | 3 | # If this is a debian package then package_dir is a symlink: |
4 | | -# /usr/lib/pymodules/python2.7/cefpython3 |
5 | | -# Cefpython3 files including executables are located in: |
6 | | -# /usr/share/pyshared/cefpython3 |
7 | | -# Cefpython3 .so libraries are located in: |
8 | | -# /usr/lib/pyshared/python2.7/cefpython3 |
| 4 | +# /usr/lib/pymodules/python2.7/cefpython3/ |
| 5 | +# The real directory in which cefpython files are located is: |
| 6 | +# /usr/share/pyshared/cefpython3/ |
9 | 7 |
|
| 8 | +# Package dir will be /usr/lib/pymodules/python2.7/cefpython3/ |
| 9 | +# when using the debian package. For the distutils setup it |
| 10 | +# will be /usr/local/lib/python2.7/dist-packages/cefpython3/. |
10 | 11 | package_dir = os.path.dirname(os.path.abspath(__file__)) |
11 | 12 |
|
12 | | -# This loads the libcef.so library for the main python executable. |
| 13 | +# This loads the libcef.so library for the python process. |
13 | 14 | libcef_so = os.path.join(package_dir, "libcef.so") |
14 | 15 | ctypes.CDLL(libcef_so, ctypes.RTLD_GLOBAL) |
15 | 16 |
|
16 | | -# Other .so libraries may also be required |
| 17 | +# Other .so libraries may also be required. |
| 18 | +# Loading the libffmpegsumo.so library is probably redundant to |
| 19 | +# load for the python process, as it shows from testing. It is |
| 20 | +# only loaded by the subprocess executable with the use of the |
| 21 | +# LD_LIBRARY_PATH env variable. But just to be sure let's load |
| 22 | +# it as well for future proof. |
17 | 23 | libffmpegsumo_so = os.path.join(package_dir, "libffmpegsumo.so") |
18 | 24 | ctypes.CDLL(libffmpegsumo_so, ctypes.RTLD_GLOBAL) |
19 | 25 |
|
20 | | -# This loads the libcef.so library for the subprocess executable. |
| 26 | +# This will allow the subprocess executable to load the libcef.so |
| 27 | +# and libffmpeg.so libraries. |
21 | 28 | os.environ["LD_LIBRARY_PATH"] = package_dir |
22 | 29 |
|
23 | 30 | # This env variable will be returned by cefpython.GetModuleDirectory(). |
|
0 commit comments