Home:ALL Converter>QTCaptureDevice Closing By itself (FaceTime Camera) Mac

QTCaptureDevice Closing By itself (FaceTime Camera) Mac

Ask Time:2012-01-14T06:21:14         Author:mdominick

Json Formatter

I have a mac app that writes camera data to a file then uploads that file on an [NSTimer] to a server. However, after the camera runs for a while it closes itself and I see this in the log: * QTCaptureDeviceInput warning: The device "FaceTime HD Camera (Built-in)" was closed while still being used in a capture session. Make sure that the session is not running before closing any devices it is using.

No other apps are open that can use the camera in the test case and the object for the device is not being released by me. I have gone so far as to call retain on it to prevent this, to no avail.

I looked at Apple's docs and nowhere that I found did it talk about the camera being shut off by the system, so what could be causing this. In the meantime I have some code that periodically checks if it is open and if it isn't calls open on it.

One thing I forgot I am using this notification and it is being fired: QTCaptureDeviceWasDisconnectedNotification

Author:mdominick,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/8858037/qtcapturedevice-closing-by-itself-facetime-camera-mac
yy