CLI Wrapper for cCameraListener?
-
- Posts: 3
- Joined: Thu Jun 16, 2011 6:41 pm
CLI Wrapper for cCameraListener?
I know that some of the Camera SDK has been wrapped in .NET by other forum members. I have the camera set to only send non-empty, valid frames and have been successful in polling for frames but I am struggling with the implementation of the wrapper for listening for frames. Is it possible to expose the cCameraListener class so I can wait on available frames instead of just polling for frames? Any attempts I have made in exposing this functionality via a ref class has not been successful.
-
- Posts: 3
- Joined: Thu Jun 16, 2011 6:41 pm
Re: CLI Wrapper for cCameraListener?
I posed the question on stack overflow and someone was kind enough to answer. For the benefit of this forum, here is the link:
http://stackoverflow.com/questions/6448 ... c-via-c-cl
I was hoping that the processor usage would be less with an implementation where I was listening for frames instead of polling for frames in a while loop. It does seem to be less, but only slightly.
NaturalPoint admins, does the back end implementation of the listener just end up polling anyway?
http://stackoverflow.com/questions/6448 ... c-via-c-cl
I was hoping that the processor usage would be less with an implementation where I was listening for frames instead of polling for frames in a while loop. It does seem to be less, but only slightly.
NaturalPoint admins, does the back end implementation of the listener just end up polling anyway?
Re: CLI Wrapper for cCameraListener?
The listener class is a true callback architecture designed to help users achieve the absolute lowest latency. However the polling approach is very light weight as well so your observation that it doesn't necessarily buy you performance is probably a good one.
If you're concerned with minimizing the latency as much as possible, it's definitely recommended to listen for the callbacks. The callbacks do not come from the main process thread, so you'll want to be thread-safe about what you do within your callback.
I'll see if I can get an appropriate implementation added to the wrapper for the listener class.
If you're concerned with minimizing the latency as much as possible, it's definitely recommended to listen for the callbacks. The callbacks do not come from the main process thread, so you'll want to be thread-safe about what you do within your callback.
I'll see if I can get an appropriate implementation added to the wrapper for the listener class.