ios - CvVideoCamera - camera not available, Iphone simulator -
following example of initialization , start of cvvideocamera in swift project ios. xcode 7.3.1, using pre-built opencv 2.4.13 executing on simulator ios 9.3. have tried 2 version of cvvideocamera initialization , start. 1 , directly in swift view controller, in objective c wrapper same effect. easier debugging call initcamera followed startcamera ibaction triggered button, rather viewdidload. expecting after sequence simulator turn macbook camera on , direct video simulator.
the camera not start ( led indicator off , not receiving video in parent uiimageview). there 1 message in application console: 2016-06-10 21:13:20.777 ocvtest2[57252:2485915] camera available: n
is macbook camera supposed available simulator default or requires additional setup? how trouble shoot issue? thank you
my initcamera , startcamera methods :
var mycamera : cvvideocamera! var videocamerawrapper : cvvideocamerawrapper! var camerainitialized : bool = false var camerastarted : bool = false func startcamera() { if(camerainitialized == true && camerastarted == false) { mycamera.start(); camerastarted = true } } func initcamera(parentview: uiimageview!) { if camerainitialized { return } mycamera = cvvideocamera(parentview: imageview) mycamera.defaultavcapturedeviceposition = avcapturedeviceposition.front; mycamera.defaultavcapturesessionpreset = avcapturesessionpreset352x288; mycamera.defaultavcapturevideoorientation = avcapturevideoorientation.portrait mycamera.defaultfps = 30 mycamera.grayscalemode = false mycamera.delegate = self camerainitialized = true }
no, camera not available simulator.
this link contains information on simulator can , cannot do.
Comments
Post a Comment