I am trying to intiailize and run a UtilPipeline from a DLL (details on why below). When I run my depth acquisition code directly in a test application, it initializes and runs fine. But the same code run from my DLL hangs on startup. I've traced the hang to the following line in:
util_capture.cpp:
UtilCapture::CreateCapture() {
/*stuff that seems to work fine*/
return m_session->CreateImpl<PXCCapture>(&desc2, capture); // HANG HERE!
}
It hits that CreateImpl and never comes back. I've printed out the contents of the desc2 structure, and it looks plausible enough:
G(4) SG(3) Alg(0) Iuid(843336531) V(1.0) Accel(255) Merit(201) vend(32902) PCUID(-661186491.0.0.0) Friendly(DepthSense 325 Audio/Video Capture) Reserved(12) (-0-0-0-0-0-0-0-0-0-0-0-0-)
My suspicion is that it has to do with the run-time libraries. To take a variable out of the equation, I've incorporated all of the util_* source and headers into my project (temp test) to ensure they have the same settings as my code. With /MTd they compile and link without any warnings. With /MDd I have to ignore LIBCMTD to get a warning-free link. The run-time behavior is the same in either case, I get the same hang at the same CreateImpl.
My questions are:
Is it known that I need to compile with one or the other of /MT and /MD in order to link with libpxc_d.lib, or should either work?
Has anyone accessed the SDK from a DLL module?
Are there any known situations which would cause a hang at CreateImpl<>, or any other things to try?
Thanks!
Note for those curious about why I would be doing this: I am working on an OpenNI wrapper for the camera, which among other things would open it up for access under projects like kinfu and the many cool libraries of PCL. I've done this for other depth cameras, so I'm pretty confident that the problem is just my build settings or lib compatibilities or the like, rather than a code or hardware problem. If I do manage to get something working, I'd be happy to share what I find.


