CameraDriverQTKit.mm
Go to the documentation of this file.00001 #if defined(__APPLE__)
00002
00003 #include <AvailabilityMacros.h>
00004 #ifdef MAC_OS_X_VERSION_10_6
00005
00006 #include "CameraDriverQTKit.h"
00007
00008 #import <QTKit/QTkit.h>
00009
00010 using namespace std;
00011
00012 const std::string CameraDriverQTKit::autoRegisterCameraDriver = DeviceDriver::getRegistry().registerType<CameraDriverQTKit>("Camera");
00013
00014 void CameraDriverQTKit::updateCameraList() {
00015 NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
00016 NSEnumerator *itr = [[QTCaptureDevice inputDevices] objectEnumerator];
00017 while (QTCaptureDevice* dev = [itr nextObject]) {
00018 if([dev isConnected] && ![dev isInUseByAnotherApplication] && ( [dev hasMediaType:QTMediaTypeVideo] || [dev hasMediaType:QTMediaTypeMuxed] )) {
00019 string name = [[dev localizedDisplayName] UTF8String];
00020 if(name.find("Built-in ")==0)
00021 name.erase(0,strlen("Built-in "));
00022 setEntry(name,new CameraSourceQTKit(name,dev));
00023 }
00024 }
00025 [autoreleasepool release];
00026 }
00027
00028 #endif // 10.6 or later
00029 #endif // Apple platform
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040