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

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

本文整理了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

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

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

  1. public void clientCode(Loader loader) {
  2. try{
  3. string s = loader.load();
  4. catch (NotFoundException ex){
  5. // handle it
  6. }
  7. }

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

  1. /**
  2. * Loads the native fftw3 library.
  3. * This method has to be called before using any of the bindings to fftw or cpp
  4. * (i.e. {@link DoublePointer} or {@link fftw_plan} and the like).
  5. */
  6. public static void initFFTW(){
  7. if(!setupDone){
  8. synchronized (FFTW_Initializer.class) {
  9. if(!setupDone){
  10. String loadedlib = Loader.load(fftw3.class);
  11. setupDone = true;
  12. System.out.format("Loaded FFTW library [%s]%n",loadedlib);
  13. }
  14. }
  15. }
  16. }

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

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

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

  1. public static void tryLoad() throws Exception {
  2. if (loadingException != null) {
  3. throw loadingException;
  4. } else {
  5. try {
  6. Loader.load(org.bytedeco.javacpp.avutil.class);
  7. Loader.load(org.bytedeco.javacpp.avcodec.class);
  8. Loader.load(org.bytedeco.javacpp.avformat.class);
  9. Loader.load(org.bytedeco.javacpp.postproc.class);
  10. Loader.load(org.bytedeco.javacpp.swresample.class);
  11. Loader.load(org.bytedeco.javacpp.swscale.class);
  12. Loader.load(org.bytedeco.javacpp.avfilter.class);
  13. av_register_all();
  14. avfilter_register_all();
  15. } catch (Throwable t) {
  16. if (t instanceof Exception) {
  17. throw loadingException = (Exception)t;
  18. } else {
  19. throw loadingException = new Exception("Failed to load " + FFmpegFrameRecorder.class, t);
  20. }
  21. }
  22. }
  23. }

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

  1. /**
  2. * Loads native libraries associated with the {@link Class} of the caller.
  3. *
  4. * @param pathsFirst search the paths first before bundled resources
  5. * @return {@code load(getCallerClass(2), loadProperties(), pathsFirst) }
  6. * @see #getCallerClass(int)
  7. * @see #load(Class, Properties, boolean)
  8. */
  9. public static String load(boolean pathsFirst) {
  10. Class cls = getCallerClass(2);
  11. return load(cls, loadProperties(), pathsFirst);
  12. }
  13. /** Returns {@code load(cls, loadProperties(), Loader.pathsFirst)}. */

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

  1. public static void tryLoad() throws Exception {
  2. if (loadingException != null) {
  3. throw loadingException;
  4. } else {
  5. try {
  6. Loader.load(org.bytedeco.javacpp.freenect.class);
  7. } catch (Throwable t) {
  8. throw loadingException = new Exception("Failed to load " + OpenKinectFrameGrabber.class, t);
  9. }
  10. }
  11. }

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

  1. @Override
  2. public boolean canRun() {
  3. int[] count = { 0 };
  4. cuda.cudaGetDeviceCount(count);
  5. if (count[0] <= 0) {
  6. throw new RuntimeException("No CUDA devices were found in system");
  7. }
  8. Loader.load(cublas.class);
  9. return true;
  10. }

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

  1. public static void tryLoad() throws Exception {
  2. if (loadingException != null) {
  3. throw loadingException;
  4. } else {
  5. try {
  6. Loader.load(org.bytedeco.javacpp.opencv_highgui.class);
  7. } catch (Throwable t) {
  8. throw loadingException = new Exception("Failed to load " + IPCameraFrameGrabber.class, t);
  9. }
  10. }
  11. }

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

  1. public static void tryLoad() throws Exception {
  2. if (loadingException != null) {
  3. throw loadingException;
  4. } else {
  5. try {
  6. Loader.load(org.bytedeco.javacpp.dc1394.class);
  7. } catch (Throwable t) {
  8. throw loadingException = new Exception("Failed to load " + DC1394FrameGrabber.class, t);
  9. }
  10. }
  11. }

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

  1. public static void tryLoad() throws Exception {
  2. if (loadingException != null) {
  3. throw loadingException;
  4. } else {
  5. try {
  6. Loader.load(org.bytedeco.javacpp.opencv_highgui.class);
  7. } catch (Throwable t) {
  8. throw loadingException = new Exception("Failed to load " + OpenCVFrameRecorder.class, t);
  9. }
  10. }
  11. }

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

  1. public static void tryLoad() throws Exception {
  2. if (loadingException != null) {
  3. throw loadingException;
  4. } else {
  5. try {
  6. Loader.load(org.bytedeco.javacpp.opencv_highgui.class);
  7. } catch (Throwable t) {
  8. throw loadingException = new Exception("Failed to load " + OpenCVFrameGrabber.class, t);
  9. }
  10. }
  11. }

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

  1. public static void tryLoad() throws Exception {
  2. if (loadingException != null) {
  3. throw loadingException;
  4. } else {
  5. try {
  6. Loader.load(org.bytedeco.javacpp.videoInputLib.class);
  7. } catch (Throwable t) {
  8. throw loadingException = new Exception("Failed to load " + VideoInputFrameGrabber.class, t);
  9. }
  10. }
  11. }

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

  1. class CsvLoader {
  2. @Autowired Verifier verifier;
  3. @Autowired Loader loader;
  4. void verifAndLoad(InputStream csv) {
  5. // loop through csv
  6. if (verifier.verify(myObj)) {
  7. loader.load(myObj);
  8. }
  9. else {
  10. // log the problem eventually store the line for further analysis
  11. }
  12. csv.close();
  13. }
  14. }

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

  1. public static void tryLoad() throws Exception {
  2. if (loadingException != null) {
  3. throw loadingException;
  4. } else {
  5. try {
  6. Loader.load(org.bytedeco.javacpp.avutil.class);
  7. Loader.load(org.bytedeco.javacpp.swresample.class);
  8. Loader.load(org.bytedeco.javacpp.avcodec.class);
  9. Loader.load(org.bytedeco.javacpp.avformat.class);
  10. Loader.load(org.bytedeco.javacpp.swscale.class);
  11. /* initialize libavcodec, and register all codecs and formats */
  12. avcodec_register_all();
  13. av_register_all();
  14. avformat_network_init();
  15. Loader.load(org.bytedeco.javacpp.avdevice.class);
  16. avdevice_register_all();
  17. } catch (Throwable t) {
  18. if (t instanceof Exception) {
  19. throw loadingException = (Exception)t;
  20. } else {
  21. throw loadingException = new Exception("Failed to load " + FFmpegFrameRecorder.class, t);
  22. }
  23. }
  24. }
  25. }

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

  1. public static void tryLoad() throws Exception {
  2. if (loadingException != null) {
  3. throw loadingException;
  4. } else {
  5. try {
  6. Loader.load(org.bytedeco.javacpp.avutil.class);
  7. Loader.load(org.bytedeco.javacpp.swresample.class);
  8. Loader.load(org.bytedeco.javacpp.avcodec.class);
  9. Loader.load(org.bytedeco.javacpp.avformat.class);
  10. Loader.load(org.bytedeco.javacpp.swscale.class);
  11. /* initialize libavcodec, and register all codecs and formats */
  12. av_jni_set_java_vm(Loader.getJavaVM(), null);
  13. avcodec_register_all();
  14. av_register_all();
  15. avformat_network_init();
  16. Loader.load(org.bytedeco.javacpp.avdevice.class);
  17. avdevice_register_all();
  18. } catch (Throwable t) {
  19. if (t instanceof Exception) {
  20. throw loadingException = (Exception)t;
  21. } else {
  22. throw loadingException = new Exception("Failed to load " + FFmpegFrameRecorder.class, t);
  23. }
  24. }
  25. }
  26. }

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

  1. public static void tryLoad() throws Exception {
  2. if (loadingException != null) {
  3. throw loadingException;
  4. } else {
  5. try {
  6. Loader.load(org.bytedeco.javacpp.avutil.class);
  7. Loader.load(org.bytedeco.javacpp.swresample.class);
  8. Loader.load(org.bytedeco.javacpp.avcodec.class);
  9. Loader.load(org.bytedeco.javacpp.avformat.class);
  10. Loader.load(org.bytedeco.javacpp.swscale.class);
  11. // Register all formats and codecs
  12. av_jni_set_java_vm(Loader.getJavaVM(), null);
  13. avcodec_register_all();
  14. av_register_all();
  15. avformat_network_init();
  16. Loader.load(org.bytedeco.javacpp.avdevice.class);
  17. avdevice_register_all();
  18. } catch (Throwable t) {
  19. if (t instanceof Exception) {
  20. throw loadingException = (Exception)t;
  21. } else {
  22. throw loadingException = new Exception("Failed to load " + FFmpegFrameGrabber.class, t);
  23. }
  24. }
  25. }
  26. }

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

  1. public static void tryLoad() throws FrameGrabber.Exception {
  2. if (loadingException != null) {
  3. loadingException.printStackTrace();
  4. throw loadingException;
  5. } else {
  6. try {
  7. Loader.load(org.bytedeco.javacpp.FlyCapture2.class);
  8. } catch (Throwable t) {
  9. throw loadingException = new FrameGrabber.Exception("Failed to load " + FlyCapture2FrameGrabber.class, t);
  10. }
  11. }
  12. }

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

  1. public static void tryLoad() throws FrameGrabber.Exception {
  2. if (loadingException != null) {
  3. loadingException.printStackTrace();
  4. throw loadingException;
  5. } else {
  6. try {
  7. if (freenect2Context != null) {
  8. return;
  9. }
  10. Loader.load(org.bytedeco.javacpp.freenect2.class);
  11. // Context is shared accross cameras.
  12. freenect2Context = new Freenect2();
  13. } catch (Throwable t) {
  14. throw loadingException = new FrameGrabber.Exception("Failed to load " + OpenKinect2FrameGrabber.class, t);
  15. }
  16. }
  17. }

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

  1. public static void tryLoad() throws FrameGrabber.Exception {
  2. if (loadingException != null) {
  3. loadingException.printStackTrace();
  4. throw loadingException;
  5. } else {
  6. try {
  7. if (context != null) {
  8. return;
  9. }
  10. Loader.load(org.bytedeco.javacpp.RealSense.class);
  11. // Context is shared accross cameras.
  12. context = new context();
  13. System.out.println("RealSense devices found: " + context.get_device_count());
  14. } catch (Throwable t) {
  15. throw loadingException = new FrameGrabber.Exception("Failed to load " + RealSenseFrameGrabber.class, t);
  16. }
  17. }
  18. }

相关文章