org.bytedeco.javacpp.Loader.load()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(231)

本文整理了Java中org.bytedeco.javacpp.Loader.load()方法的一些代码示例,展示了Loader.load()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Loader.load()方法的具体详情如下:
包路径:org.bytedeco.javacpp.Loader
类名称:Loader
方法名:load

Loader.load介绍

[英]Returns load(getCallerClass(2), loadProperties(), Loader.pathsFirst).
[中]返回load(getCallerClass(2),loadProperties(),Loader)。路径第一)。

代码示例

代码示例来源:origin: bytedeco/javacpp

/** Returns {@code load(cls, loadProperties(), Loader.pathsFirst)}. */
public static String load(Class cls) {
  return load(cls, loadProperties(), Loader.pathsFirst);
}
/**

代码示例来源:origin: stackoverflow.com

public void clientCode(Loader loader) {
  try{
   string s = loader.load();
  catch (NotFoundException ex){
   // handle it
  }     
}

代码示例来源:origin: com.github.hageldave.ezfftw/ezfftw

/**
 * 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);
      }
    }
  }
}

代码示例来源:origin: bytedeco/javacpp

/** Returns {@code load(getCallerClass(2), loadProperties(), Loader.pathsFirst)}. */
public static String load() {
  return load(getCallerClass(2), loadProperties(), Loader.pathsFirst);
}
/**

代码示例来源:origin: org.bytedeco/javacv

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);
      }
    }
  }
}

代码示例来源:origin: bytedeco/javacpp

/**
 * 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)}. */

代码示例来源:origin: org.bytedeco/javacv

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);
    }
  }
}

代码示例来源:origin: org.nd4j/nd4j-cuda-10.0

@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;
}

代码示例来源:origin: org.bytedeco/javacv

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);
    }
  }
}

代码示例来源:origin: org.bytedeco/javacv

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);
    }
  }
}

代码示例来源:origin: org.bytedeco/javacv

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);
    }
  }
}

代码示例来源:origin: org.bytedeco/javacv

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);
    }
  }
}

代码示例来源:origin: org.bytedeco/javacv

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);
    }
  }
}

代码示例来源:origin: stackoverflow.com

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();
  }
}

代码示例来源:origin: io.antmedia/ant-media-server-common

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);
      }
    }
  }
}

代码示例来源:origin: org.bytedeco/javacv

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);
      }
    }
  }
}

代码示例来源:origin: org.bytedeco/javacv

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);
      }
    }
  }
}

代码示例来源:origin: org.bytedeco/javacv

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);
    }
  }
}

代码示例来源:origin: org.bytedeco/javacv

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);
    }
  }
}

代码示例来源:origin: org.bytedeco/javacv

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);
    }
  }
}

相关文章