Skip to content
Snippets Groups Projects
Commit de9e17f4 authored by Stéphane  DALLONGEVILLE's avatar Stéphane DALLONGEVILLE
Browse files

Added XugglerPlugin.init() to help with native library loading

parent 393e0f41
No related branches found
No related tags found
No related merge requests found
package plugins.stef.library; package plugins.stef.library;
import com.xuggle.ferry.Ferry;
import icy.plugin.abstract_.Plugin; import icy.plugin.abstract_.Plugin;
import icy.plugin.interface_.PluginLibrary; import icy.plugin.interface_.PluginLibrary;
...@@ -10,5 +12,46 @@ import icy.plugin.interface_.PluginLibrary; ...@@ -10,5 +12,46 @@ import icy.plugin.interface_.PluginLibrary;
*/ */
public class XugglerPlugin extends Plugin implements PluginLibrary public class XugglerPlugin extends Plugin implements PluginLibrary
{ {
// static boolean initialized = false;
/**
* Force initialization (native library loading mainly) of Xuggler library
*/
public static synchronized void init()
{
// we try the easier library loading process
if (!initialized)
{
Throwable error = null;
if (loadLibrary(XugglerPlugin.class, "xuggle"))
initialized = true;
try
{
Ferry.load();
initialized = true;
}
catch (Throwable t)
{
error = t;
}
if (!initialized)
{
if (error != null)
System.err.println(error.getMessage());
System.err.println("Xuggler native library load failed.");
}
}
}
/**
* @return true if Xuggler library has been initialized
*/
public static boolean isInitialized()
{
return initialized;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment