ios - Camera takes long to capture images in iPhone -


i working on app includes camera feature,at time user can capture upto 5 images 1 after another.i using avfoundation capturing multiple images thing working issue when clicking on capture button,it takes around 5 seconds capture ,can anybudy please me wheer wrong?my code below.

code

        avcapturesession *session = [[avcapturesession alloc] init];          [session beginconfiguration];         session.sessionpreset = avcapturesessionpresetphoto; -(void)takephoto :(uiviewcontroller *)sender {      if ([customcamera issourcetypeavailable:uiimagepickercontrollersourcetypecamera])     {          currentpicker = self.picker;         self.picker.sourcetype = uiimagepickercontrollersourcetypecamera;         if (self.mediatype == videotype)         {              self.picker.mediatypes = [nsarray arraywithobject:(nsstring *)kuttypemovie];             self.picker.videoquality = uiimagepickercontrollerqualitytypemedium;             self.picker.videomaximumduration = 180.0f;         }         else{                  //self.multipleimagepicker = [[rpmultipleimagepickerviewcontroller alloc] init];                 self.multipleimagepicker.sourcetype = uiimagepickercontrollersourcetypephotolibrary;                 self.multipleimagepicker.delegatecaptureimage = self;                 self.picker.delegate = self;                 self.picker.mediatypes = [nsarray arraywithobject:(nsstring *)kuttypeimage];                 self.picker.showscameracontrols = no;                 self.picker.navigationbarhidden = yes;                 self.picker.toolbarhidden = yes;                 [self setcameraoverlayview];              //added jigar...                 camoverlayview.view.alpha = 0.0f;                 self.picker.cameraoverlayview = camoverlayview.view;                 [uiview beginanimations:nil context:null];                 [uiview setanimationdelay:2.2f];                 camoverlayview.view.alpha = 1.0f;                 [uiview commitanimations];              //setting delay capture screen          }         [self presentviewcontroller:self.picker animated:yes completion:nil];     }     else     {         uialertview *alert =[[uialertview alloc] initwithtitle:nil message:@"no camera available in device" delegate:self cancelbuttontitle:@"ok" otherbuttontitles:nil, nil];         [alert show];     }   } 


Comments