ios - AVCapture loses ability to set focus when using ZBar SDK -
this has been stumping me days...
in app using avcapture take photo, using zbar sdk scan bar code. problem once load zbar after taking picture, lose ability auto focus when taking picture. if load zbar first, can adjust focus when taking picture, zbar loses ability focus! tried swapping out zbar shopsavvy code scanner sdk , im encountering same problem...
here code using set camera turn on auto focus no error occurring, , unable focus!
avcapturedevice *device = [[self videoinput] device]; if ([device isfocuspointofinterestsupported] && [device isfocusmodesupported:avcapturefocusmodecontinuousautofocus]) { nserror *error; if ([device lockforconfiguration:&error]) { [device setfocuspointofinterest:point]; [device setfocusmode:avcapturefocusmodecontinuousautofocus]; [device unlockforconfiguration]; } else { if ([[self delegate] respondstoselector:@selector(capturemanager:didfailwitherror:)]) { [[self delegate] capturemanager:self didfailwitherror:error]; } } }
turns out need release each capture session before loading new one. in case, wasn't releasing capture session before loading zbar, , wasn't releasing zbar before loading capture session.
Comments
Post a Comment