I was trying to use the ofxUVC addon to control a webcam’s focus and exposure.
First of all my current setup:
Logitech C920 webcam.
Since updating to OF0.10, XCode 10, I can’t seem to connect at all to the camera anymore.
I’ve used this addon without problems with many other OF releases and never had any issues. I’ve tested the camera with an older app that was compiled with OF090 and it still runs great and controls my Logitech C920 without issues.
The problem seems to be that inside
- (id)initWithVendorID:(long)vendorID productID:(long)productID
HRESULT res = (*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID), (LPVOID*) &deviceInterface );
always returns NULL for the deviceInterface.
Does anyone know if Apple changed anything in the way we’re supposed to talk to USB devices since MacOS 10.13? I’ve looked in their documentation, but haven’t found anything.
Could it be to do with the camera permissions in Xcode 10.0 / 10.14?
Are you builds targeting the 10.14 SDK or 10.13?
YESS! Thank you Theo!
That was it. Strange that video worked, but the camera control didn’t…
I actuality checked for the camera privacy change and added the NSCameraUsageDescription key, but then abandoned that idea because I assumed Xcode was compiling against 10.13 (new Xcode isn’t very clear about that)
Good thing I keep a backup of every SDK I’ve ever used ꒰｡•‿•｡꒱
Compiled with 10.13 and now everything works as expected.
Ahh. Glad to hear!
We’re working on an Xcode 10 / 10.14 fix release so hopefully it should be fixed in the next release.
I would be curious to know if its not a pain:
Does it work if built against the 10.14 SDK but with the following as the plist:
I just tested it with your plist, which is almost the same as what I used before to try to fix my problem (the content of my NSCameraUsageDescription was just ‘yo’ before ) but it didn’t work.
As before, everything compiles fine, no crashes, video works, but deviceInterface is just returned NULL again.
Maybe a quirk between running 10.14 compiled code on 10.13?
Funny…I was doing the exact same thing the exact same day…same Logitech camera. Ended up upgrading to Mojave since the videoGrabber.listDevices() with OF1.0 returned empty on a MacMini with the C920 attached (OSX 10.9 or something). There was no privacy prompt. On 10.14 the camera is detected fine, but on a Macbook Pro changing the videoGrabber.setDeviceID when restarting grabbing seems unreliable, it defaults back to built in camera. Just test that as well if you are fixing stuff.