Skip to content
This repository has been archived by the owner on Jul 23, 2019. It is now read-only.

Commit

Permalink
Fix GStreamer plugin path for exported applications
Browse files Browse the repository at this point in the history
  • Loading branch information
gohai committed May 20, 2016
1 parent 2d6de36 commit 196abe2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ paragraph = Using GL textures & OpenMAX. Currently only supported on the Raspber
# compare different versions of the same library, and check if an update is
# available. You should think of it as a counter, counting the total number of
# releases you've had.
version = 1
version = 1.0.1

# The version as the user will see it. If blank, the version attribute will be
# used here. This should be a single word, with no spaces.
prettyVersion = 1
prettyVersion = 2

# The min and max revision of Processing compatible with your library.
# Note that these fields use the revision and not the version of Processing,
Expand Down
8 changes: 5 additions & 3 deletions src/gohai/glvideo/GLVideo.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,14 @@ public GLVideo(PApplet parent, String fn_or_uri, int flags) {
loaded = true;

String jar = GLVideo.class.getProtectionDomain().getCodeSource().getLocation().getPath();
String nativeLib = jar.substring(0, jar.lastIndexOf(File.separatorChar)) + "/linux-armv6hf";
String nativeLib = jar.substring(0, jar.lastIndexOf(File.separatorChar));
// set a custom plugin path and prevent globally installed libraries from being loaded
gstreamer_setEnvVar("GST_PLUGIN_PATH_1_0", nativeLib + "/gstreamer-1.0/");
gstreamer_setEnvVar("GST_PLUGIN_SYSTEM_PATH_1_0", "");
// the second plugin path is necessary since the directory structure for exported applications
// doesn't contain a linux-armv6hf directory
gstreamer_setEnvVar("GST_PLUGIN_PATH_1_0", nativeLib + "/linux-armv6hf/gstreamer-1.0/:" + nativeLib + "/gstreamer-1.0/");
// keep a local registry
gstreamer_setEnvVar("GST_REGISTRY_1_0", nativeLib + "/gstreamer-1.0/registry");
gstreamer_setEnvVar("GST_REGISTRY_1_0", nativeLib + "/linux-armv6hf/gstreamer-1.0/registry");
// we could also set GST_GL_API & GST_GL_PLATFORM here

if (gstreamer_init() == false) {
Expand Down

0 comments on commit 196abe2

Please sign in to comment.