Comments (5)
from javacpp.
correct. so i assume my java wrapper is off ...
public static native void uvc_free_device_list(@Cast("uvc_device**") @ByPtrPtr PointerPointer<?> uvcDevList, @Cast("uint8_t") byte unref_devices);
any suggestion on how i can fix it? whatever i try to change on it, it either won't compile into the jar or give me a compile error when i call it from ...
UVCController.uvc_free_device_list (uvcDevList, (byte)1);
am at the end of my limited wisdom ...
from javacpp.
uvc_free_device_list() takes only a double pointer, so we don't need the @ByPtrPtr annotation. All that would be done automatically with the Parser BTW.
from javacpp.
thanks for the help, Samuel. I owe you quite a few drinks by now ... i am reviewing the final outcome of the issue for folks who end up here with similar questions.
the calls in the libuvc C library are ...
uvc_error_t uvc_get_device_list(uvc_context_t *ctx, uvc_device_t ***list) { .... }
and
void uvc_free_device_list(uvc_device_t **list, uint8_t unref_devices) { .... }
i am java wrapping them in the jlibuvc with ...
public static native int uvc_get_device_list(UVCContext ctx, @Cast("uvc_device***") @ByPtrPtr PointerPointer<?> uvcDevList);
and
public static native void uvc_free_device_list(@Cast("uvc_device**") PointerPointer<?> uvcDevList, @Cast("uint8_t") byte unref_devices);
i then make the calls do the work with the following code ...
public class UVCLoad {
public static void main(String... arg) throws InterruptedException {
UVCDevice dev = new UVCController.UVCDevice();
UVCContext ctx = new UVCController.UVCContext();
UVCStreamCtrl sctrl = new UVCController.UVCStreamCtrl();
System.out.println("Initialize : " + UVCController.uvc_init(ctx, null));
// I could access the device directly with ...
// System.out.println("Find Camera: " + UVCController.uvc_find_device(ctx, dev, 0x0, 0x0, null));
// but in this example I get the list first, then pull the device at index 0 from it with ...
PointerPointer<UVCDevice> uvcDevList = new PointerPointer<UVCDevice>();
UVCController.uvc_get_device_list(ctx, uvcDevList);
dev = (UVCDevice) uvcDevList.get(UVCDevice.class, 0);
// then I again free everything at the end.
UVCController.uvc_free_device_list(uvcDevList,(byte)0);
UVCController.uvc_unref_device(dev);
UVCController.uvc_exit(ctx);
}
}
i hope this helps ...
from javacpp.
You're welcome! :)
from javacpp.
Related Issues (20)
- retain and release method of DeallocatorReference HOT 5
- NativeDeallocator do not release memory problem HOT 11
- JavaFXFrameConverter.java:[47,12] cannot find symbol symbol: class Image HOT 2
- Warning with "JavaCPP_createStringFromUTF16" method on Mac clang 15
- The current 1.5.10-SNAPSHOT builds are broken and point to missing artifacts HOT 5
- JavaCPP can't link dll file HOT 1
- Open CV 4.8.0 integration HOT 2
- Parser mapping HOT 12
- 'jni.h' file not found HOT 6
- windows Cannot run program "cl" HOT 1
- std::unique_ptr fields HOT 4
- Optional pair HOT 2
- ParserException for valid c++ code HOT 1
- Function pointer returning shared_ptr HOT 10
- LNK2001: Unresolved external, issue with namespace? HOT 7
- infinite recursion when calling virtualized inherited function HOT 4
- Mapping Template Constraints, Parser Error HOT 5
- Parser cannot compile because of QT HOT 4
- Template class with template functions HOT 15
- Inadequate Error Handling HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javacpp.