Webcam support incomplete for mac

Hi,

I’ve recently tried again to upgrade to the latest JUCE version. However, two of my apps which rely on webcam support are still broken since Apple made the switch from Quicktime to AV.

I’m currently using JUCE 4.3.1 and rolling back the Apple SDK version to get around this problem. However, it would be nice to use the latest JUCE version, in light of the recent introduction of the audio DSP classes.

Basically, the problem is annoyingly simple, the video stuff works perfectly fine; its just when I call the “getAvailableDevices()” function in “juce_mac_CameraDevice” (in order to get a list of available webcam devices), the function now returns “default” only:

JUCE 4.3.1:
static StringArray getAvailableDevices()
{
StringArray results;
NSArray* devs = [QTCaptureDevice inputDevicesWithMediaType: QTMediaTypeVideo];

    for (int i = 0; i < (int) [devs count]; ++i)
    {
        QTCaptureDevice* dev = (QTCaptureDevice*) [devs objectAtIndex: i];
        results.add (nsStringToJuce ([dev localizedDisplayName]));
    }

    return results;
}

And now in JUCE 5.1.2:
static StringArray getAvailableDevices()
{
StringArray results;
results.add (“default”);
return results;
}

Which is fine if the “default” camera happens to be the camera the user wants to use, but in some cases it is not.

Therefore, if someone is able to direct me towards a workaround, or provide an ETA on when this feature will return; this would be much appreciated : )

Many thanks and best regards,
keag

bump

yes, it’s on the to-do list!

Hey,
I was just wondering if there is going to be a fix for this in the foreseeable future?
The code is still hardcoded to not find webcam devices other than the default, which is not always the device that you want to use.

JUCE 5.4.3 in juce_mac_CameraDevice.h:
static StringArray getAvailableDevices()
{
StringArray results;
results.add (“default”);
return results;
}

Or have there been some work arounds since then?

I wondered the same recently and poked around the internet for an answer: https://stackoverflow.com/questions/31119524/unable-to-get-devices-using-avcapturedevice/31119615

It’s not terribly complicated to set up…

Apologies, I just don’t fully get it.

The camera capture feature works perfectly fine… Except for this one function which was never completed.
Instead of returning the list of available camera devices, the function is hardcoded to just return one option: ‘default’. This has been the case when opening the camera demo for over 2 years now:

I understand that it may not be top priority on the TODO list, but 2 years is a little longer than I had anticipated for there to be a fix integrated into a JUCE release. Especially if it is indeed “not terribly complicated to set up”…

1 Like