/** Returns {@code load(cls, loadProperties(), Loader.pathsFirst)}. */ public static String load(Class cls) { return load(cls, loadProperties(), Loader.pathsFirst); } /**
public void clientCode(Loader loader) { try{ string s = loader.load(); catch (NotFoundException ex){ // handle it } }
/** * Loads the native fftw3 library. * This method has to be called before using any of the bindings to fftw or cpp * (i.e. {@link DoublePointer} or {@link fftw_plan} and the like). */ public static void initFFTW(){ if(!setupDone){ synchronized (FFTW_Initializer.class) { if(!setupDone){ String loadedlib = Loader.load(fftw3.class); setupDone = true; System.out.format("Loaded FFTW library [%s]%n",loadedlib); } } } }
/** Returns {@code load(getCallerClass(2), loadProperties(), Loader.pathsFirst)}. */ public static String load() { return load(getCallerClass(2), loadProperties(), Loader.pathsFirst); } /**
public static void tryLoad() throws Exception { if (loadingException != null) { throw loadingException; } else { try { Loader.load(org.bytedeco.javacpp.avutil.class); Loader.load(org.bytedeco.javacpp.avcodec.class); Loader.load(org.bytedeco.javacpp.avformat.class); Loader.load(org.bytedeco.javacpp.postproc.class); Loader.load(org.bytedeco.javacpp.swresample.class); Loader.load(org.bytedeco.javacpp.swscale.class); Loader.load(org.bytedeco.javacpp.avfilter.class); av_register_all(); avfilter_register_all(); } catch (Throwable t) { if (t instanceof Exception) { throw loadingException = (Exception)t; } else { throw loadingException = new Exception("Failed to load " + FFmpegFrameRecorder.class, t); } } } }
/** * Loads native libraries associated with the {@link Class} of the caller. * * @param pathsFirst search the paths first before bundled resources * @return {@code load(getCallerClass(2), loadProperties(), pathsFirst) } * @see #getCallerClass(int) * @see #load(Class, Properties, boolean) */ public static String load(boolean pathsFirst) { Class cls = getCallerClass(2); return load(cls, loadProperties(), pathsFirst); } /** Returns {@code load(cls, loadProperties(), Loader.pathsFirst)}. */
public static void tryLoad() throws Exception { if (loadingException != null) { throw loadingException; } else { try { Loader.load(org.bytedeco.javacpp.freenect.class); } catch (Throwable t) { throw loadingException = new Exception("Failed to load " + OpenKinectFrameGrabber.class, t); } } }
@Override public boolean canRun() { int[] count = { 0 }; cuda.cudaGetDeviceCount(count); if (count[0] <= 0) { throw new RuntimeException("No CUDA devices were found in system"); } Loader.load(cublas.class); return true; }
public static void tryLoad() throws Exception { if (loadingException != null) { throw loadingException; } else { try { Loader.load(org.bytedeco.javacpp.opencv_highgui.class); } catch (Throwable t) { throw loadingException = new Exception("Failed to load " + IPCameraFrameGrabber.class, t); } } }
public static void tryLoad() throws Exception { if (loadingException != null) { throw loadingException; } else { try { Loader.load(org.bytedeco.javacpp.dc1394.class); } catch (Throwable t) { throw loadingException = new Exception("Failed to load " + DC1394FrameGrabber.class, t); } } }
public static void tryLoad() throws Exception { if (loadingException != null) { throw loadingException; } else { try { Loader.load(org.bytedeco.javacpp.opencv_highgui.class); } catch (Throwable t) { throw loadingException = new Exception("Failed to load " + OpenCVFrameRecorder.class, t); } } }
public static void tryLoad() throws Exception { if (loadingException != null) { throw loadingException; } else { try { Loader.load(org.bytedeco.javacpp.opencv_highgui.class); } catch (Throwable t) { throw loadingException = new Exception("Failed to load " + OpenCVFrameGrabber.class, t); } } }
public static void tryLoad() throws Exception { if (loadingException != null) { throw loadingException; } else { try { Loader.load(org.bytedeco.javacpp.videoInputLib.class); } catch (Throwable t) { throw loadingException = new Exception("Failed to load " + VideoInputFrameGrabber.class, t); } } }
class CsvLoader { @Autowired Verifier verifier; @Autowired Loader loader; void verifAndLoad(InputStream csv) { // loop through csv if (verifier.verify(myObj)) { loader.load(myObj); } else { // log the problem eventually store the line for further analysis } csv.close(); } }
public static void tryLoad() throws Exception { if (loadingException != null) { throw loadingException; } else { try { Loader.load(org.bytedeco.javacpp.avutil.class); Loader.load(org.bytedeco.javacpp.swresample.class); Loader.load(org.bytedeco.javacpp.avcodec.class); Loader.load(org.bytedeco.javacpp.avformat.class); Loader.load(org.bytedeco.javacpp.swscale.class); /* initialize libavcodec, and register all codecs and formats */ avcodec_register_all(); av_register_all(); avformat_network_init(); Loader.load(org.bytedeco.javacpp.avdevice.class); avdevice_register_all(); } catch (Throwable t) { if (t instanceof Exception) { throw loadingException = (Exception)t; } else { throw loadingException = new Exception("Failed to load " + FFmpegFrameRecorder.class, t); } } } }
public static void tryLoad() throws Exception { if (loadingException != null) { throw loadingException; } else { try { Loader.load(org.bytedeco.javacpp.avutil.class); Loader.load(org.bytedeco.javacpp.swresample.class); Loader.load(org.bytedeco.javacpp.avcodec.class); Loader.load(org.bytedeco.javacpp.avformat.class); Loader.load(org.bytedeco.javacpp.swscale.class); /* initialize libavcodec, and register all codecs and formats */ av_jni_set_java_vm(Loader.getJavaVM(), null); avcodec_register_all(); av_register_all(); avformat_network_init(); Loader.load(org.bytedeco.javacpp.avdevice.class); avdevice_register_all(); } catch (Throwable t) { if (t instanceof Exception) { throw loadingException = (Exception)t; } else { throw loadingException = new Exception("Failed to load " + FFmpegFrameRecorder.class, t); } } } }
public static void tryLoad() throws Exception { if (loadingException != null) { throw loadingException; } else { try { Loader.load(org.bytedeco.javacpp.avutil.class); Loader.load(org.bytedeco.javacpp.swresample.class); Loader.load(org.bytedeco.javacpp.avcodec.class); Loader.load(org.bytedeco.javacpp.avformat.class); Loader.load(org.bytedeco.javacpp.swscale.class); // Register all formats and codecs av_jni_set_java_vm(Loader.getJavaVM(), null); avcodec_register_all(); av_register_all(); avformat_network_init(); Loader.load(org.bytedeco.javacpp.avdevice.class); avdevice_register_all(); } catch (Throwable t) { if (t instanceof Exception) { throw loadingException = (Exception)t; } else { throw loadingException = new Exception("Failed to load " + FFmpegFrameGrabber.class, t); } } } }
public static void tryLoad() throws FrameGrabber.Exception { if (loadingException != null) { loadingException.printStackTrace(); throw loadingException; } else { try { Loader.load(org.bytedeco.javacpp.FlyCapture2.class); } catch (Throwable t) { throw loadingException = new FrameGrabber.Exception("Failed to load " + FlyCapture2FrameGrabber.class, t); } } }
public static void tryLoad() throws FrameGrabber.Exception { if (loadingException != null) { loadingException.printStackTrace(); throw loadingException; } else { try { if (freenect2Context != null) { return; } Loader.load(org.bytedeco.javacpp.freenect2.class); // Context is shared accross cameras. freenect2Context = new Freenect2(); } catch (Throwable t) { throw loadingException = new FrameGrabber.Exception("Failed to load " + OpenKinect2FrameGrabber.class, t); } } }
public static void tryLoad() throws FrameGrabber.Exception { if (loadingException != null) { loadingException.printStackTrace(); throw loadingException; } else { try { if (context != null) { return; } Loader.load(org.bytedeco.javacpp.RealSense.class); // Context is shared accross cameras. context = new context(); System.out.println("RealSense devices found: " + context.get_device_count()); } catch (Throwable t) { throw loadingException = new FrameGrabber.Exception("Failed to load " + RealSenseFrameGrabber.class, t); } } }