Skip to content

Commit

Permalink
JNA only looks in /usr/lib and /lib by default, pass LD_LIBRARY_PATH
Browse files Browse the repository at this point in the history
Not ideal, since this environment variable is not set by default, so warn the user also. This is e.g. needed for all Debian multi-arch setups, like on Raspbian, as well as people that compiled their libraries themselves in /usr/local/lib.
  • Loading branch information
gohai committed Aug 1, 2015
1 parent bebac5b commit 89fff4c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/processing/video/Video.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ static protected void initImpl() {
if (!gstreamerLibPath.equals("")) {
System.setProperty("jna.library.path", gstreamerLibPath);
}
// outputs the paths JNA is trying
//System.setProperty("jna.debug_load", "true");

if (PApplet.platform == WINDOWS) {
LibraryLoader loader = LibraryLoader.getInstance();
Expand Down Expand Up @@ -153,7 +155,16 @@ static protected void removePlugins() {


static protected void buildLinuxPaths() {
gstreamerLibPath = "";
// looking pretty dire, make sure at least LD_LIBRARY_PATH is set
// see https://github.com/twall/jna/issues/477
String ldPath = System.getenv("LD_LIBRARY_PATH");
if (ldPath == null || ldPath.length() == 0) {
System.out.println("Your system's LD_LIBRARY_PATH environment variable " +
"is not set, limiting the search for the video libraries to /usr/lib " +
"and /lib.");
} else {
gstreamerLibPath = ldPath;
}
gstreamerPluginPath = "";
}

Expand Down

0 comments on commit 89fff4c

Please sign in to comment.