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

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -