objective c - Supported AVCaptureSessionPreset on iOS device -


is there way check whether concrete avcapturesessionpreset supported on ios device? want set resolution of avcapturesession, not know how check whether divice capable capture camera frames using selected resolution.

avcapturesession * _session; nsstring * _sessionpreset; _sessionpreset = avcapturesessionpreset1920x1080;  // here perform check.  [_session setsessionpreset:_sessionpreset]; 

use this:

if ([self.capturesession cansetsessionpreset:avcapturesessionpreset1920x1080])     {         self.capturesession.sessionpreset = avcapturesessionpreset1920x1080;     } else if ([self.capturesession cansetsessionpreset:avcapturesessionpreset640x480])         {             nslog(@"set preview port 640x480");             self.capturesession.sessionpreset = avcapturesessionpreset640x480;         } 

Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -