Desidero visualizzare lo stream della fotocamera anteriore e posteriore di un iPad2 in due UIViews uno accanto all'altro. Per eseguire lo streaming l'immagine di un dispositivo che uso il seguente codiceEseguire più AVCaptureSessions o aggiungere più input
AVCaptureDeviceInput *captureInputFront = [AVCaptureDeviceInput deviceInputWithDevice:[AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo] error:nil];
AVCaptureSession *session = [[AVCaptureSession alloc] init];
session addInput:captureInputFront];
session setSessionPreset:AVCaptureSessionPresetMedium];
session startRunning];
AVCaptureVideoPreviewLayer *prevLayer = [AVCaptureVideoPreviewLayer layerWithSession:session];
prevLayer.frame = self.view.frame;
[self.view.layer addSublayer:prevLayer];
che funziona bene per entrambi macchina fotografica. Per visualizzare lo stream in parallelo, ho provato a creare un'altra sessione, ma non appena viene stabilita la seconda sessione, il primo si blocca.
Quindi ho provato ad aggiungere due AVCaptureDeviceInput alla sessione ma sembra che al momento sia supportato un solo input.
Qualche idea utile su come trasmettere in streaming da entrambe le telecamere?
possibile duplicato di [Come posso ottenere l'autofocus per funzionare in una seconda sessione AVCaptureSession senza ricreare le sessioni?] (Http://stackoverflow.com/questions/5427561/how-can-i-get-autofocus-to-work -in-a-second-avcapturesession-without-recreating) –