简体   繁体   中英

Utilizing jna library in application rather than applet

I'm trying to use a JNA library in my project.

My situation is as follows:

I have an applet that shows camera input.

If I run the Applet using the command run as applet I get the correct result:

an applet that shows the camera input

If I remove jna.jar from the build path it gives me error as expected.

If I rename the directory of the native plugins it gives me error as expected.

If I try to run the whole application I get the error:

GStreamer-WARNING **: Failed to load plugin C:/Users/aaa/Desktop/bbb/ccc/video/library/\\windows64\\plugins\\libgstwavparse.dll on 30+ dlls

The path C:/Users/aaa/Desktop/bbb/ccc/video/library/\\windows64\\plugins\\ is the one that if renamed makes the applet crash (so the correct one) and jna.jar and the library that used by JNA are imported in each project involved: the root project from which the application is started and the view project that instantiates the camera showing applet.

As previously suggested, I have tried

System.setProperty("jna.library.path","C:/Users/aaa/Desktop/bbb/ccc/video/library/windows64/plugins/" );

etc... in all possible forms to reference the correct directory but to no avail.

The library is a 3 rd party library and actually should work.

The problems may be in my total lack of knowledge of JNA and/or Gstreamer or even of some basics at this point.

Is there any workaround? Why do the applet and application that instantiates the applet work differently when referencing DLLs... or Gstreamer DLLs... or the Processing 2.2.1 included Gstreamer DLLs?

Ok i managed to make it work this way: if i write a main directly in the View project and add the applet to a panel it now works... so that solves some issues(the applet was in a panel even before anyways)... the same exact dummy main gives the warning as before if run under root project alas: failed to load plugin:"correct path"

As said before i have a root project and a view project(N Vproject to be frank) the video lib is included in the VProject and the dlls are under is project resources. Is it possible that running the app from the main project something (like different system variables) end up causing problems? Just not knowing the issue i precedently added and removed(and combinations) all that could be added in relation to jna platform and to tha jna-using-video lib to both projects.

i really do care about uncoupling in this case because im sort of writing a framework and this is a major limitation. Any insight?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM