Does (or will) the camera work on iOS?
Currently the CameraDevice class will not seem to work on iOS, even though the JUCE_USE_CAMERA and JUCE_USE_QUICKTIME flags are enabled.
The JuceDemo app shows a camera demo on OS X (if the JUCE_USE_CAMERA flag is enabled), but there is no way to get the camera demo to work on iOS.
Is the camera is iOS not supported?
If not, is there any way around it in a cross-platform way?
We want to be able to present a QR code from a JUCE desktop app, then read the QR code in a JUCE mobile app. The mobile app gives us no way to access the camera, so this seems to be impossible right now.
A simpler question would be: what is the minimum possible way to show the image from the camera onto the screen on a mobile device (ideally this would work on iOS and Android). I’m not worried about writing custom DSP code if it comes to it, I just want to be able to get the camera image in the first place.
This doesn’t quite answer the question but you could write an adapter on iOS for Brad Larson’s GPUImage: https://github.com/BradLarson/GPUImage
The API is really nice, and to do something like this would only be a few lines of code to get the image out of the camera. You can also do some pre-processing on the image on the GPU.
I used this some time ago for an image-driven synth using artificial neural networks to perform image recognition/mapping.
The AVFoundation classes for IOS and OSX are really alike. So it should not be a big deal getting this to work. Probably an hour of two work for one of the JUCE devs. Actually quite surprised the camera does not already work for IOS. At the same time, there is tons of code to be found on how to access the camera on IOS. The tricky bit is wrapping it inside a c++ class because it’s all Objective-C.
Ahhh, it seems that JUCE still uses Quicktime for this. I thought it used AVFoundation. Quicktime is depecrated and not at all available on IOS.
Feature Request: Add an AVFoundation based Camera Device class for IOS and OSX.
Yep, we’ll be doing that soon!
Made a really simple AVCameraDevice implementation that mimics the JUCE CameraDevice — I’ve seen other people have done the same thing as well.
Can’t wait for the update!